Example #1
0
 private void loadSettings()
 {
     foreach (var setting in SettingsManager.Instance.RegisteredSettings)
     {
         ISettingEditorControl editorControl = SettingEditorTypeRegister.GetEditorForSetting(setting);
         Control editorControlCasted         = editorControl as Control;
         if (editorControlCasted != null)
         {
             editorControlCasted.Dock = DockStyle.Top;
             getPageForCategory(setting.Category).Controls.Add(editorControlCasted);
         }
     }
 }
Example #2
0
        private static Type GetTypeForEditor(ISettingEditorControl editor)
        {
            object[] attributes     = editor.GetType().GetCustomAttributes(true);
            object   foundAttribute = attributes.FirstOrDefault(attr => (attr is SettingEditorControlTypeAttribute));

            if (foundAttribute == null)
            {
                return(null);
            }
            SettingEditorControlTypeAttribute typedAttribute = foundAttribute as SettingEditorControlTypeAttribute;

            return(typedAttribute?.Type);
        }
Example #3
0
 private void loadSettings()
 {
     foreach (var setting in SettingsManager.Instance.RegisteredSettings)
     {
         ISettingEditorControl editorControl = SettingEditorTypeRegister.Instance.GetEditorForSetting(setting);
         Control editorControlCasted         = editorControl as Control;
         if (editorControlCasted != null)
         {
             editorControlCasted.Dock = DockStyle.Top;
             TabPage pageForCategory = getPageForCategory(setting.Category);
             Control.ControlCollection pagesControlCollection = pageForCategory.Controls;
             pagesControlCollection.Add(editorControlCasted);
             pagesControlCollection.SetChildIndex(editorControlCasted, 0);
         }
     }
 }