<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=6889170&amp;fmt=gif">
Skip to content
  • There are no suggestions because the search field is empty.

Overview | UI & Options

Scripts can present a configuration UI to the user by defining a class that extends ScriptOptions. Each public property becomes a configurable option in the ReadySuite property grid. Use attributes to control how properties are displayed, grouped, and validated.

Setting Up Options

Define a class that inherits from ScriptOptions, then override LoadOptions() in your script to wire it up:

C# Copy
public class MyOptions : ScriptOptions
{
    public MyOptions()
    {
        // Set default values in the constructor
        Enabled = true;
        MaxItems = 100;
    }

    [Category("Settings")]
    [Description("Enable processing.")]
    public bool Enabled { get; set; }

    [Category("Settings")]
    [Description("Maximum number of items to process.")]
    public int MaxItems { get; set; }
}

public override void LoadOptions()
{
    Options = new MyOptions();
}

Layout and Display Attributes

Attribute Purpose
[Category("...")] Groups properties under a collapsible heading in the property grid
[Description("...")] Tooltip text shown when the property is selected
[DisplayName("...")] Overrides the property name shown in the UI
C# Copy
[Category("Output Fields")]
[DisplayName("PDF Portfolio")]
[Description("Field indicating whether the source is a PDF portfolio.")]
public FieldItem IsPdfPortfolioField { get; set; }

Field Pickers

Use FieldItem as a property type to present a field picker. The [FieldItem] attribute controls the picker behavior:

Parameter Purpose
AllowNew Allow the user to create a new field
AllowNull Allow no selection (optional field)
AllowSystemFields Include system fields in the picker
Types Restrict to specific FieldItemType values
C# Copy
// Required text field picker that allows creating new fields
[Category("Output")]
[Required(ErrorMessage = "Output field is required.")]
[FieldItem(AllowNew = true, AllowSystemFields = false, AllowNull = false, Types = new[] { FieldItemType.Text })]
public FieldItem OutputField { get; set; }

// Optional boolean field picker (read-only selection from existing fields)
[Category("Input")]
[FieldItem(AllowNew = false, AllowNull = true, Types = new[] { FieldItemType.Boolean })]
public FieldItem FlagField { get; set; }

Use List<FieldItem> when the user needs to select multiple fields:

C# Copy
[Category("Input")]
[Description("Fields to include in the export.")]
[NotNullOrEmptyCollection(ErrorMessage = "At least one field is required.")]
[FieldItem(Types = new[] { FieldItemType.Text, FieldItemType.Memo })]
public List<FieldItem> InputFields { get; set; }

Dropdown Selectors (Enums)

Any property automatically renders as a dropdown. Use [Description] attributes on enum members for display-friendly names:

C# Copy
public enum OutputMode
{
    [Description("Write to field")] Field,
    [Description("Write to file")] File,
    [Description("Write to field and file")] Both
}

[Category("Settings")]
[Description("Select where the output is written.")]
public OutputMode Mode { get; set; }

For multi-select scenarios, use a [Flags] enum:

C# Copy
[Flags]
public enum ReportTypes
{
    None = 0,
    Summary = 1,
    Details = 2,
    Errors = 4
}

File and Folder Browsers

Use editor attributes to provide browse dialogs for path properties:

C# Copy
// Folder browser
[Category("Output")]
[Description("Folder where files will be saved.")]
[Editor(typeof(FolderPathEditor), typeof(UITypeEditor))]
public string OutputFolder { get; set; }

// File open browser
[Category("Input")]
[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
public string InputFile { get; set; }

// File save browser
[Category("Output")]
[Editor(typeof(SaveFileNameEditor), typeof(UITypeEditor))]
public string ReportFile { get; set; }

The DateFormatEditor provides a specialized picker for date format strings:

C# Copy
[Category("Settings")]
[Editor("Compiled.EDD.Scripting.UI.DateFormatEditor, Compiled.EDD.Scripting.UI", typeof(System.Drawing.Design.UITypeEditor))]
public string DateTimeFormat { get; set; }

Validation

Use validation attributes to enforce requirements before the script runs:

C# Copy
// Always required
[Required(ErrorMessage = "Body field is required.")]
public FieldItem Body { get; set; }

// Required only when another property has a specific value
[RequiredIf("Mode", OutputMode.File, ErrorMessage = "Output folder is required when writing to file.")]
public string OutputFolder { get; set; }

// Required when a bool is true
[RequiredIf("Truncate", true, ErrorMessage = "Max length must be set when truncation is enabled.")]
public int MaxLength { get; set; }

// Collection must have at least one item
[NotNullOrEmptyCollection(ErrorMessage = "At least one field must be selected.")]
public List<FieldItem> Fields { get; set; }

String Lists

Use List<string> for properties where the user enters multiple string values. These render as a line-based editor:

C# Copy
[Category("Settings")]
[Description("File extensions to include.")]
[NotNullOrEmptyCollection(AllowNullOrWhiteSpaceStrings = false, ErrorMessage = "At least one extension is required.")]
public List<string> Extensions { get; set; }

Supported Property Types

Type UI Control
bool Checkbox
string Text box
int, long, float, double, decimal Numeric text box
char Single character text box
DateTime Date/time picker
FieldItem Field picker dropdown
List<FieldItem> Multi-field picker
List<string> Line-based string editor
List<FindAndReplaceItem> Find-and-replace grid editor
enum Dropdown selector
[Flags] enum Multi-select dropdown

Other primitive types render with the property grid's default editor. To customize how a property is displayed — file or folder browsers, custom pickers, etc. — apply an [Editor] attribute as shown in File and Folder Browsers.