public ImageSelectorWidgetFunction(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(NullableDataReference <IImageFile>), entityTokenFactory)
        {
            var mediaFolderSelectorWidget = new WidgetFunctionProvider(MediaFileFolderSelectorWidget.CompositeName);

            base.AddParameterProfile(
                new ParameterProfile(MediaFileFolderReferenceParameterName,
                                     typeof(DataReference <IMediaFileFolder>),
                                     false,
                                     new ConstantValueProvider(new DataReference <IMediaFileFolder>()),
                                     mediaFolderSelectorWidget,
                                     new Dictionary <string, object>(),
                                     "Image folder",
                                     new HelpDefinition("Select a media folder to choose images from. Default is 'all media'."))
                );

            var requiredWidget = StandardWidgetFunctions.GetBoolSelectorWidget("Yes, require selection", "No, optional");

            base.AddParameterProfile(
                new ParameterProfile(RequiredParameterName,
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(true),
                                     requiredWidget,
                                     new Dictionary <string, object>(),
                                     "Selection required",
                                     new HelpDefinition("Specify if selecting an image should be required."))
                );
        }
示例#2
0
        public MediaFileSelectorWidgetFunction(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(NullableDataReference <IMediaFile>), entityTokenFactory)
        {
            var widget = new WidgetFunctionProvider(MediaFileFolderSelectorWidget.CompositeName);

            base.AddParameterProfile(
                new ParameterProfile("MediaFileFolderReference", typeof(DataReference <IMediaFileFolder>), false,
                                     new ConstantValueProvider(new DataReference <IMediaFileFolder>()), widget, new Dictionary <string, object>(),
                                     "Media Folder", new HelpDefinition("Select a media folder to choose files from. Default is all media files.")));

            base.AddParameterProfile(
                new ParameterProfile("FileExtensionFilter", typeof(string), false,
                                     new ConstantValueProvider(""), StandardWidgetFunctions.TextBoxWidget, null,
                                     "File Extension Filter", new HelpDefinition("Limit the list to files which have the specified extension. Default is no filter.")));

            base.AddParameterProfile(
                new ParameterProfile("IncludeSubfolders", typeof(bool), false,
                                     new ConstantValueProvider(true), StandardWidgetFunctions.GetBoolSelectorWidget("Include files from subfolders", "Only show files from the specified Media folder"), null,
                                     "Include Subfolders", new HelpDefinition("When false files from subfolders will no be included.")));

            var requiredWidget = StandardWidgetFunctions.GetBoolSelectorWidget("Yes, require selection", "No, optional");

            base.AddParameterProfile(
                new ParameterProfile(RequiredParameterName, typeof(bool), false,
                                     new ConstantValueProvider(true), requiredWidget, new Dictionary <string, object>(),
                                     "Selection required", new HelpDefinition("Specify if selecting a media file should be required."))
                );
        }
示例#3
0
        private void SetParameterProfiles()
        {
            base.AddParameterProfile(
                new ParameterProfile("Options",
                                     typeof(IEnumerable),
                                     true,
                                     new NoValueValueProvider(),
                                     null,
                                     null,
                                     "Options", new HelpDefinition("A list of elements to use as options. Expected types are IEnumerable (simple lists) and Dictionary.")));

            base.AddParameterProfile(
                new ParameterProfile("KeyFieldName",
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(null),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Source key field name", new HelpDefinition("If your option source returns a list of objects or XElements, use this field to specify the name of the field (property) to use for key values. Leave this empty to use the source option value as a string.")));

            base.AddParameterProfile(
                new ParameterProfile("LabelFieldName",
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(null),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Source label field name", new HelpDefinition("If your option source returns a list of objects or XElements, use this field to specify the name of the field (property) to use for labels. Leave this empty to use the source option value as a string.")));

            base.AddParameterProfile(
                new ParameterProfile("Required",
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(true),
                                     StandardWidgetFunctions.GetBoolSelectorWidget("Yes, selection is required", "No, a 'none' selection is allowed."),
                                     null,
                                     "Selection required", new HelpDefinition("When true the user is forced to make a selection. This feature is not available when 'multiple selection' is enabled.")));

            base.AddParameterProfile(
                new ParameterProfile("Multiple",
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(false),
                                     StandardWidgetFunctions.GetBoolSelectorWidget("Yes, allow multiple selections.", "No, allow only one selection."),
                                     null,
                                     "Multiple selection", new HelpDefinition("When true the user can select zero, one or more values. The selected values will be joined in a comma seperated string like 'A,B,C'.")));

            base.AddParameterProfile(
                new ParameterProfile("Compact",
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(false),
                                     StandardWidgetFunctions.GetBoolSelectorWidget("Yes, use compact/popup UI.", "No, show all options."),
                                     null,
                                     "Compact mode", new HelpDefinition("When true the UI element will be compact.")));
        }
        private void SetParameterProfiles()
        {
            base.AddParameterProfile(
                new ParameterProfile("ElementProvider",
                                     typeof(string),
                                     true,
                                     new ConstantValueProvider(string.Empty),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Element Provider", new HelpDefinition("The name of a tree element provider (as defined in Composite.config)")));

            base.AddParameterProfile(
                new ParameterProfile("SelectableElementReturnValue",
                                     typeof(string),
                                     true,
                                     new ConstantValueProvider("EntityToken"),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Element field to return", new HelpDefinition("The name of the element field whose value to return for selection. Typical values here can be DataId (for data trees), Uri (for linkable elements), or EntityToken (for any element). Element providers may provide more fields.")));

            base.AddParameterProfile(
                new ParameterProfile("SelectableElementPropertyName",
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(string.Empty),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Selection filter, Property Name", new HelpDefinition("An element must have this field to be selectable.")));

            base.AddParameterProfile(
                new ParameterProfile("SelectableElementPropertyValue",
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(string.Empty),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Selection filter, Property Value", new HelpDefinition("The value of the property optionally used (if provided) to further identify a selectable tree element by. Seperate multiple values with spaces.")));

            base.AddParameterProfile(
                new ParameterProfile("SerializedSearchToken",
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(string.Empty),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Search Token", new HelpDefinition("A search token, seriallized, to filter which tree elements is shown. To filter what is selectable, use the 'Selection filter' properties.")));
            base.AddParameterProfile(
                new ParameterProfile("Required",
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(true),
                                     StandardWidgetFunctions.GetBoolSelectorWidget("Yes, selection is required", "No, a 'none' selection is allowed."),
                                     null,
                                     "Required", new HelpDefinition("An option that indicates whether the user is required to make a selection")));
        }
        public TextBoxWidgetFuntion(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(string), entityTokenFactory)
        {
            ParameterProfile spellCheckPP =
                new ParameterProfile(TextBoxWidgetFuntion.SpellCheckParameterName,
                                     typeof(bool), false,
                                     new ConstantValueProvider(true), StandardWidgetFunctions.GetBoolSelectorWidget("Allow spell checking", "Do not allow spell checking"), null,
                                     "Spell check", new HelpDefinition("By default text will be spell checked (when available). You should explicitly disable spell checking on fields that contain e-mails, code values etc. not suitable for spell checking. "));

            base.AddParameterProfile(spellCheckPP);
        }
示例#6
0
        private void SetParameterProfiles()
        {
            base.AddParameterProfile(
                new ParameterProfile("ElementProvider",
                                     typeof(string),
                                     true,
                                     new ConstantValueProvider(string.Empty),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Element Provider", new HelpDefinition("The name of a tree element provider (as defined in Composite.config)")));

            base.AddParameterProfile(
                new ParameterProfile("SelectableElementPropertyName",
                                     typeof(string),
                                     true,
                                     new ConstantValueProvider(string.Empty),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Selectable Element Property Name", new HelpDefinition("The name of a property used to identify a selectable tree element by")));

            base.AddParameterProfile(
                new ParameterProfile("SelectableElementPropertyValue",
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(string.Empty),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Selectable Element Property Value", new HelpDefinition("The value of the property optionally used (if provided) to further identify a selectable tree element by")));

            base.AddParameterProfile(
                new ParameterProfile("SelectableElementReturnValue",
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(string.Empty),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Selectable Element Return Value", new HelpDefinition("The value to return for the selected tree element")));
            base.AddParameterProfile(
                new ParameterProfile("SerializedSearchToken",
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(string.Empty),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Selectable Element Return Value", new HelpDefinition("A search token to filter tree elements by")));
            base.AddParameterProfile(
                new ParameterProfile("Required",
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(true),
                                     StandardWidgetFunctions.GetBoolSelectorWidget("Yes, selection is required", "No, a 'none' selection is allowed."),
                                     null,
                                     "Required", new HelpDefinition("An option that indicates whether the user is required to make a selection")));
        }
        private void SetParameterProfiles()
        {
            base.AddParameterProfile(
                new ParameterProfile(Parameter_Options,
                                     typeof(IEnumerable),
                                     true,
                                     new NoValueValueProvider(),
                                     null,
                                     null,
                                     "Options", new HelpDefinition("A list of elements to use as options. Expected types are IEnumerable (simple lists) and Dictionary.")));

            base.AddParameterProfile(
                new ParameterProfile(Parameter_KeyFieldName,
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(null),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Source key field name", new HelpDefinition("If your option source returns a list of objects or XElements, use this field to specify the name of the field (property) to use for key values. Leave this empty to use the source option value as a string.")));

            base.AddParameterProfile(
                new ParameterProfile(Parameter_LabelFieldName,
                                     typeof(string),
                                     false,
                                     new ConstantValueProvider(null),
                                     StandardWidgetFunctions.TextBoxWidget,
                                     null,
                                     "Source label field name", new HelpDefinition("If your option source returns a list of objects or XElements, use this field to specify the name of the field (property) to use for labels. Leave this empty to use the source option value as a string.")));

            base.AddParameterProfile(
                new ParameterProfile("Required",
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(true),
                                     StandardWidgetFunctions.GetBoolSelectorWidget("Yes, selection is required", "No, a 'none' selection is allowed."),
                                     null,
                                     "Selection required", new HelpDefinition("When true the user is forced to make a selection. This feature is not available when 'multiple selection' is enabled.")));
        }
示例#8
0
        private void SetParameterProfiles()
        {
            base.AddParameterProfile(
                new ParameterProfile("TreeNodes",
                                     typeof(IEnumerable <SelectionTreeNode>),
                                     true,
                                     new NoValueValueProvider(),
                                     null,
                                     null,
                                     "Tree Nodes", new HelpDefinition("The structure to use for building hierarchy for selection. Call a function that return IEnumerable<SelectionTreeNode>.")));

            base.AddParameterProfile(
                new ParameterProfile("Required",
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(true),
                                     StandardWidgetFunctions.GetBoolSelectorWidget("Yes, selection is required", "No, a 'none' selection is allowed."),
                                     null,
                                     "Selection required", new HelpDefinition("When true the user is forced to make a selection. This feature is not available when 'multiple selection' is enabled.")));

            base.AddParameterProfile(
                new ParameterProfile("AutoSelectChildren",
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(false),
                                     StandardWidgetFunctions.GetBoolSelectorWidget("Yes, auto select child elements.", "No, only one selection on click."),
                                     null,
                                     "Auto select children", new HelpDefinition("When true a selection will automatically select all descendant elements in the hierarchy.")));

            base.AddParameterProfile(
                new ParameterProfile("AutoSelectParents",
                                     typeof(bool),
                                     false,
                                     new ConstantValueProvider(false),
                                     StandardWidgetFunctions.GetBoolSelectorWidget("Yes, auto select parents.", "No, only one selection on click."),
                                     null,
                                     "Auto select parents", new HelpDefinition("When true a selection will automatically select all ancestor elements in the hierarchy.")));
        }