예제 #1
0
 private void LoadThemeFile(string themeFile)
 {
     try
     {
         _themeFile = new ThemeFile(themeFile);
         DisplayThemeFile();
     }
     catch (Exception ex)
     {
         ErrorDispatcher.DispatchError(ex);
         _themeFile = null;
     }
 }
예제 #2
0
 private void CreateNewThemeFile()
 {
     try
     {
         _themeFile = new ThemeFile();
         DisplayThemeFile();
     }
     catch (Exception ex)
     {
         ErrorDispatcher.DispatchError(ex);
         _themeFile = null;
     }
 }
예제 #3
0
        public override void ShowProperties(List<string> strItems, object additionalData)
        {
            _themeFile = null;
            _editedThemeName = null;
            _editedThemeElementName = null;

            txtNodeName.ReadOnly = false;
            List<object> args = additionalData as List<object>;

            this.SuspendLayoutEx();
            pnlContent.SuspendLayoutEx();
            pnlThemeProperties.SuspendLayoutEx();

            try
            {
                _raiseEvents = false;

                lblIsDefault.Visible = chkIsDefault.Visible = false;

                pnlThemeProperties.Controls.Clear();
                pnlThemeProperties.RowStyles.Clear();

                if (args != null && args.Count > 0)
                {
                    _themeFile = args[0] as ThemeFile;
                    if (_themeFile != null)
                    {
                        KeyValuePair<string, Theme>? themePair = null;
                        KeyValuePair<string, string>? themeElementPair = null;

                        if (args.Count > 1 && args[1] is KeyValuePair<string, Theme>)
                        {
                            themePair = (KeyValuePair<string, Theme>)args[1];
                            _editedThemeName = themePair.Value.Key;
                        }

                        if (args.Count > 2 && args[2] is KeyValuePair<string, string>)
                        {
                            themeElementPair = (KeyValuePair<string, string>)args[2];
                            _editedThemeElementName = themeElementPair.Value.Key;
                        }

                        if (themeElementPair.HasValue)
                            DisplayThemeElementProperties(themeElementPair.Value);
                        else if (themePair.HasValue)
                            DisplayThemeProperties(themePair.Value);
                        else
                            DisplayThemeFileProperties();
                    }
                }
            }
            finally
            {
                pnlThemeProperties.ResumeLayoutEx();
                pnlContent.ResumeLayoutEx();
                this.ResumeLayoutEx();
                base.Modified = false;

                _raiseEvents = true;
            }
        }