private void themeCombo_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (m_iSuspendUpdate > 0)
            {
                return;
            }

            int index = themeCombo.SelectedIndex;

            if (index == -1)
            {
                return;
            }

            NTheme theme = null;

            switch (index)
            {
            case 0:
                theme = new Nevron.UI.Themes.System.NSystemTheme();
                break;

            case 1:
                theme = new Nevron.UI.Themes.Office2003.NOffice2003Theme();
                break;

            case 2:
                theme = LoadResourceTheme("Office2007Blue.xml");
                break;
            }

            if (theme == null)
            {
                return;
            }

            INTheme oldTheme = NThemeManager.Instance.CurrentTheme;

            NThemeManager.Instance.CurrentTheme = theme;

            oldTheme.Dispose();
        }
        private void OnThemeTreeViewSelectedPathChanged(NValueChangeEventArgs arg1)
        {
            NTreeView     treeView     = (NTreeView)arg1.CurrentTargetNode;
            NTreeViewItem selectedItem = treeView.SelectedItem;

            if (selectedItem == null)
            {
                return;
            }

            if (selectedItem.Tag is NTheme)
            {
                // Apply the selected theme to the document box's document
                NTheme theme = (NTheme)selectedItem.Tag;
                m_DocumentBox.Document.InheritStyleSheets = false;
                m_DocumentBox.Document.StyleSheets.ApplyTheme(theme);
            }
            else if (NStringHelpers.Equals(selectedItem.Tag, "inherit"))
            {
                // Make the document inherit its style sheets and clear all current ones
                m_DocumentBox.Document.InheritStyleSheets = true;
                m_DocumentBox.Document.StyleSheets.Clear();
            }
        }
        internal NTheme LoadResourceTheme(string themeName)
        {
            Type     t        = GetType();
            Assembly assembly = t.Assembly;

            string path = "Nevron.Examples.UI.WinForm.Resources.Themes.";

            Stream stream;

            if (NExamplesForm.IsVBContext)
            {
                stream = assembly.GetManifestResourceStream(themeName);
            }
            else
            {
                stream = assembly.GetManifestResourceStream(path + themeName);
            }

            NTheme theme = NTheme.FromStream(stream, typeof(NTheme));

            stream.Close();

            return(theme);
        }