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."))
                );
        }
        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."))
                );
        }
 public SvgIconSelectorWidgetFuntion(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(string), entityTokenFactory)
 {
     base.AddParameterProfile(
         new ParameterProfile(SvgIconSelectorWidgetFuntion.SvgSpritePathParameterName,
             typeof(string), true,
             new ConstantValueProvider(null), StandardWidgetFunctions.TextBoxWidget, null,
             "Svg Sprite Path", new HelpDefinition("Path to the SVG sprite. Example: ~/Composite/images/sprite.svg")));
 }
        public CheckBoxWidgetFuntion(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(bool), entityTokenFactory)
        {
            ParameterProfile pp =
                new ParameterProfile("ItemLabel", typeof(string), false,
                    new ConstantValueProvider(""), StandardWidgetFunctions.TextBoxWidget, null,
                    "Sub label", new HelpDefinition("Text to whow beside the checkbox"));

            base.AddParameterProfile(pp);
        }
        public DateSelectorWidgetFunction(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(DateTime), entityTokenFactory)
        {
            ParameterProfile pp =
                new ParameterProfile("ReadOnly", typeof(bool), false,
                    new ConstantValueProvider(false), StandardWidgetFunctions.CheckBoxWidget, null,
                    "Read only", new HelpDefinition("When selected users can not change the date."));

            base.AddParameterProfile(pp);
        }
        /// <exclude />
        protected CompositeWidgetFunctionBase(string compositeName, Type returnType, EntityTokenFactory entityTokenFactory)
        {
            if (string.IsNullOrEmpty(compositeName)) throw new ArgumentNullException("compositeName");

            this.Namespace = compositeName.Substring(0,compositeName.LastIndexOf('.'));
            this.Name = compositeName.Substring(compositeName.LastIndexOf('.')+1);
            this.ReturnType = returnType;
            this.ParameterProfiles = new List<ParameterProfile>();
            _entityTokenFactory = entityTokenFactory;
        }
        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);
        }
        public FormMarkupWidgetFuntion(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(string), entityTokenFactory)
        {
            var markupParameterProfile =
                new ParameterProfile(MarkupParameterName,
                    typeof(string), true,
                    new ConstantValueProvider(
            @"<TextBox Label=""$label"" Help=""$help"" SpellCheck=""true"">
            <TextBox.Text>
              <cms:bind source=""$binding"" />
            </TextBox.Text>
            </TextBox>"), StandardWidgetFunctions.TextAreaWidget, null,
                    "Markup", new HelpDefinition("Markup will be inserted into result form markup. Macroses are: '$binding', '$label' and '$help'"));

            base.AddParameterProfile(markupParameterProfile);
        }
        public FontIconSelectorWidgetFuntion(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(string), entityTokenFactory)
        {
            base.AddParameterProfile(
                new ParameterProfile(FontIconSelectorWidgetFuntion.ClassNameOptionsParameterName,
                    typeof(object), true,
                    new ConstantValueProvider(null), StandardWidgetFunctions.TextAreaWidget, null,
                    "Class Name Options", new HelpDefinition("A list of class names the user should be able to choose from. Pass in a (comma seperated) string, a IEnumerable<string> or a Dictionary<string,string>.")));

            base.AddParameterProfile(
                new ParameterProfile(FontIconSelectorWidgetFuntion.StylesheetPathParameterName,
                    typeof(string), true,
                    new ConstantValueProvider(null), StandardWidgetFunctions.TextBoxWidget, null,
                    "Stylesheet Path", new HelpDefinition("Path to style sheet containing class name definitions and web font include. Example: ~/Frontend/styles/glyphicons.less")));

            base.AddParameterProfile(
                new ParameterProfile(FontIconSelectorWidgetFuntion.ClassNamePrefixParameterName,
                    typeof(string), false,
                    new ConstantValueProvider(""), StandardWidgetFunctions.TextBoxWidget, null,
                    "Class Name Prefix", new HelpDefinition("String to always prepend to the class name options for font icons to be shown in drop down. Bootstrap Example: 'glyphicon glyphicon-'")));
        }
 public DecimalTextBoxWidgetFuntion(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(decimal), entityTokenFactory)
 {
 }
 public SelectorWidgetFunction(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(object), entityTokenFactory)
 {
     SetParameterProfiles();
 }
 public VisualXhtmlEditorFuntion(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(Composite.Core.Xml.XhtmlDocument), entityTokenFactory)
 {
     SetParameterProfiles("common");
 }
 public GuidTextBoxWidgetFuntion(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(Guid), entityTokenFactory)
 {
 }
 public ConsoleIconSelectorWidgetFuntion(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(string), entityTokenFactory)
 {
 }
 /// <exclude />
 public DataIdMultiSelectorWidgetFunction(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(string), entityTokenFactory)
 {
     SetParameterProfiles();
 }
 /// <exclude />
 public VisualXhtmlEditorFuntion(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(string), entityTokenFactory)
 {
     BuildParameterProfiles();
 }
 public BoolSelectorWidgetFuntion(EntityTokenFactory entityTokenFactory, string trueLabel, string falseLabel)
     : base(CompositeName, typeof(bool), entityTokenFactory)
 {
     SetParameterProfiles(false, trueLabel, falseLabel);
 }
 public BoolSelectorWidgetFuntion(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(bool), entityTokenFactory)
 {
     SetParameterProfiles( true, "True", "False");
 }
 public DataTypeSelectorWidgetFunction(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(Type), entityTokenFactory)
 {
 }
 public MediaFileFolderSelectorWidget(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(DataReference<IMediaFileFolder>), entityTokenFactory)
 {
 }
 public PageReferenceSelectorWidgetFunction(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(DataReference<IPage>), entityTokenFactory)
 {
 }
 public IntegerTextBoxWidgetFuntion(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(int), entityTokenFactory)
 {
 }
 public UrlComboBoxWidgetFunction(EntityTokenFactory entityTokenFactory)
     : base(CompositeName, typeof(string), entityTokenFactory)
 {
 }
		public FrontendFileUploadWidgetFunction(EntityTokenFactory entityTokenFactory)
			: base(CompositeName, typeof(string), entityTokenFactory)
		{
		}