/// <summary>
        /// Initializes a new instance of the <see cref="SettingItemViewModel"/> class.
        /// </summary>
        /// <param name="settingDescriptor">The setting descriptor.</param>
        /// <param name="setting"></param>
        public SettingItemViewModel(SettingDescriptor settingDescriptor, SettingInfo setting)
        {
            _setting = setting;

            this.SettingDescriptor = settingDescriptor;

            // Find out editor
            string editorName = Editor;
            if (string.IsNullOrWhiteSpace(editorName))
            {
                editorName = settingDescriptor.SettingItem.SettingType.FullName;
            }

            this.TypeEditor = TypeEditors.TypeEditorCache.CreateTypeEditor(editorName);
            this.TypeEditor.Initialize(this.EditorParameter);
            try
            {
                this.TypeEditor.Value = settingDescriptor.SettingItem.Value;
            }
            catch (System.Exception)
            {
                Logger.Instance.LogFormat(LogType.Warning, this, Properties.Resources.SettingItemViewModelSetSettingError, settingDescriptor.SettingItem.Name, settingDescriptor.Identifier);
                this.TypeEditor.Value = settingDescriptor.SettingItem.DefaultValue;
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SettingItemViewModel"/> class.
        /// </summary>
        /// <param name="settingDescriptor">The setting descriptor.</param>
        public SettingItemViewModel(SettingDescriptor settingDescriptor)
        {
            this.SettingDescriptor = settingDescriptor;

            // Find out editor
            string editorName = settingDescriptor.SettingItem.SettingType.FullName;
            if (!string.IsNullOrWhiteSpace(settingDescriptor.SettingItem.EditorName))
            {
                editorName = settingDescriptor.SettingItem.EditorName;
            }

            this.TypeEditor = TypeEditors.TypeEditorCache.CreateTypeEditor(editorName);
            this.TypeEditor.Value = settingDescriptor.SettingItem.Value;
        }
        internal void Add(SettingDescriptor descriptor, SettingInfo setting)
        {
            string categoryText = GetCategoryText(setting.Category);

            CategoryViewModel cvm = CategoryItems.Find(c => c.Category == categoryText);
            if (cvm == null)
            {
                cvm = new CategoryViewModel();
                cvm.Category = categoryText;
                CategoryItems.Add(cvm);
            }

            cvm.SettingItems.Add(new SettingItemViewModel(descriptor, setting));
        }