Esempio n. 1
0
 /// <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()));
 }
Esempio n. 3
0
        /// <summary>
        /// Gets the theme of the editor as text based on property
        /// </summary>
        /// <returns>The text value of the mode.</returns>
        private string EditorThemeAsString(CodeEditorTheme theme)
        {
            string[] themeValues = new string[] { "github", "chrome", "crimson_editor", "dawn", "dreamweaver", "eclipse", "solarized_light", "textmate",
                                                  "tomorrow", "xcode", "github", "ambiance", "chaos", "clouds_midnight", "cobalt", "idle_fingers", "kr_theme",
                                                  "merbivore", "merbivore_soft", "mono_industrial", "monokai", "pastel_on_dark", "solarized_dark", "terminal", "tomorrow_night", "tomorrow_night_blue",
                                                  "tomorrow_night_bright", "tomorrow_night_eighties", "twilight", "vibrant_ink" };

            return(themeValues[(int)theme]);
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the theme of the editor as text based on property
        /// </summary>
        /// <returns>The text value of the mode.</returns>
        private string EditorThemeAsString( CodeEditorTheme theme )
        {
            string[] themeValues = new string[] { "github", "chrome", "crimson_editor", "dawn", "dreamweaver", "eclipse", "solarized_light", "textmate",
                "tomorrow", "xcode", "github", "ambiance", "chaos", "clouds_midnight", "cobalt", "idle_fingers", "kr_theme",
                "merbivore", "merbivore_soft", "mono_industrial", "monokai", "pastel_on_dark", "solarized_dark", "terminal", "tomorrow_night", "tomorrow_night_blue",
                "tomorrow_night_bright", "tomorrow_night_eighties", "twilight", "vibrant_ink"};

            return themeValues[(int)theme];
        }
 /// <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()));
 }