Types/AnyBox.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
40
41
42
43
44
45
46
Add-Type -TypeDefinition @"
namespace AnyBox {
 public enum InputType {
  None, Text, FileOpen, FileSave, FolderOpen, Checkbox, Password, Date, Link
 };
 
 public enum MessagePosition { Top, Left };
 public enum SetPresentation { ComboBox, Radio, Radio_Wide };

 public class Prompt
 {
  public string Name;
  public string Tab;
  public string Group;
  public InputType InputType = InputType.Text;
  public string Message;
  public MessagePosition MessagePosition = MessagePosition.Top;
  public string Alignment;
  public System.UInt16 FontSize;
  public string FontFamily;
  public string FontColor;
  public string DefaultValue;
  public System.UInt16 LineHeight = 1;
  public bool ReadOnly = false;
  public string[] ValidateSet;
  public SetPresentation ShowSetAs = SetPresentation.ComboBox;
  public string RadioGroup;
  public bool ValidateNotEmpty = false;
  public System.Management.Automation.ScriptBlock ValidateScript;
  public bool ShowSeparator = false;
  public bool Collapsible = false;
  public bool Collapsed = false;
 }

 public class Button
 {
  public string Name;
  public string Text;
  public string ToolTip;
  public bool IsCancel = false;
  public bool IsDefault = false;
  public System.Management.Automation.ScriptBlock OnClick;
 }
}
"@