-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Class.Validations.ps1
39 lines (37 loc) · 1.09 KB
/
Class.Validations.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Validation for Fonts
$Script:PDFFont = {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
([iText.IO.Font.Constants.StandardFonts] | Get-Member -Static -MemberType Property).Name | Where-Object { $_ -like "*$wordToComplete*" }
}
$Script:PDFFontValidation = {
$Array = @(
(& $Script:PDFFont)
''
)
$_ -in $Array
}
$Script:PDFTextAlignments = {
([iText.Layout.Properties.TextAlignment] | Get-Member -static -MemberType Property).Name
}
$Script:PDFTextAlignmentValidation = {
$Array = @(
(& $Script:PDFTextAlignments)
''
)
$_ -in $Array
}
$Script:PDFFontList = {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
@(
([iText.IO.Font.Constants.StandardFonts] | Get-Member -Static -MemberType Property).Name
if ($Script:Fonts.Keys) { $Script:Fonts.Keys }
) | Where-Object { $_ -like "*$wordToComplete*" }
}
$Script:PDFFontValidationList = {
$Array = @(
(& $Script:PDFFont)
$Script:Fonts.Keys
''
)
$_ -in $Array
}