/// <summary> /// Initializes a new instance of the <see cref="DateRangeFieldAttribute" /> class. /// </summary> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="mode">The mode.</param> /// <param name="theme">The theme.</param> /// <param name="height">The height.</param> /// <param name="required">if set to <c>true</c> [required].</param> /// <param name="defaultValue">The default value.</param> /// <param name="category">The category.</param> /// <param name="order">The order.</param> /// <param name="key">The key.</param> public CodeEditorFieldAttribute(string name, string description = "", CodeEditorMode mode = CodeEditorMode.Text, CodeEditorTheme theme = CodeEditorTheme.Rock, int height = 200, bool required = true, string defaultValue = "", string category = "", int order = 0, string key = null) : base(name, description, required, defaultValue, category, order, key, typeof(Rock.Field.Types.CodeEditorFieldType).FullName) { EditorMode = mode; EditorTheme = theme; EditorHeight = height; }
/// <summary> /// Initializes a new instance of the <see cref="DateRangeFieldAttribute" /> class. /// </summary> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="mode">The mode.</param> /// <param name="theme">The theme.</param> /// <param name="height">The height.</param> /// <param name="required">if set to <c>true</c> [required].</param> /// <param name="defaultValue">The default value.</param> /// <param name="category">The category.</param> /// <param name="order">The order.</param> /// <param name="key">The key.</param> public CodeEditorFieldAttribute( string name, string description = "", CodeEditorMode mode = CodeEditorMode.Text, CodeEditorTheme theme = CodeEditorTheme.Rock, int height = 200, bool required = true, string defaultValue = "", string category = "", int order = 0, string key = null ) : base( name, description, required, defaultValue, category, order, key, typeof( Rock.Field.Types.CodeEditorFieldType ).FullName ) { FieldConfigurationValues.Add(EDITOR_MODE, new Field.ConfigurationValue(mode.ToString())); FieldConfigurationValues.Add(EDITOR_THEME, new Field.ConfigurationValue(theme.ToString())); FieldConfigurationValues.Add(EDITOR_HEIGHT, new Field.ConfigurationValue(height.ToString())); }
/// <summary> /// Initializes a new instance of the <see cref="DateRangeFieldAttribute" /> class. /// </summary> /// <param name="name">The name.</param> /// <param name="description">The description.</param> /// <param name="mode">The mode.</param> /// <param name="theme">The theme.</param> /// <param name="height">The height.</param> /// <param name="required">if set to <c>true</c> [required].</param> /// <param name="defaultValue">The default value.</param> /// <param name="category">The category.</param> /// <param name="order">The order.</param> /// <param name="key">The key.</param> public CodeEditorFieldAttribute(string name, string description = "", CodeEditorMode mode = CodeEditorMode.Text, CodeEditorTheme theme = CodeEditorTheme.Rock, int height = 200, bool required = true, string defaultValue = "", string category = "", int order = 0, string key = null) : base(name, description, required, defaultValue, category, order, key, typeof(Rock.Field.Types.CodeEditorFieldType).FullName) { FieldConfigurationValues.Add(EDITOR_MODE, new Field.ConfigurationValue(mode.ToString())); FieldConfigurationValues.Add(EDITOR_THEME, new Field.ConfigurationValue(theme.ToString())); FieldConfigurationValues.Add(EDITOR_HEIGHT, new Field.ConfigurationValue(height.ToString())); }
public ClickableTextOutput(string title, string query, int resultsCount, IDictionary <string, List <string> > resultsDict, bool editorDecompile, IEnumerable <string> failedList = null) { InitializeComponent(); Title = title; Query = query; ResultsCount = resultsCount; this.resultsDict = resultsDict; this.editorDecompile = editorDecompile ? CodeEditorMode.Decompile : CodeEditorMode.DontDecompile; this.failedList = failedList; }
public ClickableTextOutput(string title, string query, int resultsCount, IOrderedEnumerable <KeyValuePair <string, List <string> > > resultsDict, bool editorDecompile, IOrderedEnumerable <string> failedList = null) { InitializeComponent(); Title = title; Query = query; ResultsCount = resultsCount; this.resultsDict = resultsDict.ToDictionary(x => x.Key, x => x.Value); this.editorDecompile = editorDecompile ? CodeEditorMode.Decompile : CodeEditorMode.DontDecompile; this.failedList = failedList?.ToList(); }
/// <summary> /// Gets the mode of the editor as text based on property /// </summary> /// <returns>The text value of the mode.</returns> private string EditorModeAsString(CodeEditorMode mode) { string[] modeValues = new string[] { "text", "css", "html", "liquid", "javascript", "less", "powershell", "sql", "typescript", "csharp", "markdown" }; return(modeValues[(int)mode]); }
/// <summary> /// Gets the mode of the editor as text based on property /// </summary> /// <returns>The text value of the mode.</returns> private string EditorModeAsString( CodeEditorMode mode ) { string[] modeValues = new string[] { "text", "css", "html", "liquid", "javascript", "less", "powershell", "sql", "typescript", "csharp", "markdown" }; return modeValues[(int)mode]; }