コード例 #1
0
 public void Read(string name, XmlReadStream stream)
 {
     if (stream.StartElement(name))
     {
         stream.Read("OptionsPanelVisible", ref this.m_OptionsPanelVisible);
         stream.Read("FastFindShowFiles", ref this.m_FastFindShowFiles);
         stream.Read("FastFindShowLines", ref this.m_FastFindFindText);
         stream.Read("FastFindWildcards", ref this.m_FastFindWildcards);
         stream.Read("MatchWholeWord", ref this.m_MatchWholeWord);
         stream.Read("RegExpression", ref this.m_RegExpression);
         stream.Read("SolutionFilesMatchCase", ref this.m_SolutionFilesMatchCase);
         stream.Read("FindTextMatchCase", ref this.m_FindTextMatchCase);
         stream.Read("UseLogicalOperators", ref this.m_UseLogicalOperators);
         stream.Read("FastFindFileExt", ref this.m_FastFindFileExt);
         stream.EndElement();
     }
 }
コード例 #2
0
ファイル: Settings.cs プロジェクト: xiaoxiyouran/VSAnything
        private void Read(XmlReadStream stream)
        {
            stream.Read("FastFindFormSize", ref this.m_FastFindFormSize);
            stream.Read("EMail", ref this.m_EMail);
            stream.Read("RegKey", ref this.m_RegKey);
            stream.Read("SolutionFiles", ref this.m_SolutionFiles);
            stream.Read("OldSearches", ref this.m_OldSearches);
            stream.Read("TipIndex", ref this.m_TipIndex);
            stream.Read("LastShowTipDay", ref this.m_LastShowTipDay);
            stream.Read("ShownWelcomeForm", ref this.m_ShownWelcomeForm);
            this.m_FastFindControlSettings_Modal.Read("FastFindControlSettings", stream);
            this.m_FastFindControlSettings.Read("FastFindControlSettings_Docked", stream);
            bool disable_tips = false;

            if (stream.Read("DisableTips", ref disable_tips))
            {
                VSAnythingPackage.Inst.GetSettingsDialogPage().EnableTips = !disable_tips;
            }
            bool remember_last_find = false;

            if (stream.Read("FastFindRememberLastFind", ref remember_last_find))
            {
                VSAnythingPackage.Inst.GetSettingsDialogPage().RememberLastFind = remember_last_find;
            }
            bool spaces_as_wildcards = false;

            if (stream.Read("SpacesAsWildcardsForFindFile", ref spaces_as_wildcards))
            {
                VSAnythingPackage.Inst.GetSettingsDialogPage().SpacesAsWildcardsForFindFile = spaces_as_wildcards;
            }
            PathMode find_files_path_mode = PathMode.Relative;

            if (stream.ReadEnum <PathMode>("FindFilesPathMode", ref find_files_path_mode))
            {
                VSAnythingPackage.Inst.GetSettingsDialogPage().FindFilesPathMode = find_files_path_mode;
            }
            PathMode find_text_path_mode = PathMode.Relative;

            if (stream.ReadEnum <PathMode>("FindTextPathMode", ref find_text_path_mode))
            {
                VSAnythingPackage.Inst.GetSettingsDialogPage().FindTextPathMode = find_text_path_mode;
            }
            int maximum_file_size = 0;

            if (stream.Read("MaximumFileSize", ref maximum_file_size))
            {
                VSAnythingPackage.Inst.GetSettingsDialogPage().MaximumFileSize = maximum_file_size;
            }
            string font_name = null;

            if (stream.Read("FontName", ref font_name))
            {
                VSAnythingPackage.Inst.GetAppearanceDialogPage().FontName = font_name;
            }
            float font_size = 0f;

            if (stream.Read("FontSize", ref font_size))
            {
                VSAnythingPackage.Inst.GetAppearanceDialogPage().FontSize = font_size;
            }
            try
            {
                string colour_theme = null;
                if (stream.Read("ColourTheme", ref colour_theme))
                {
                    VSAnythingPackage.Inst.GetAppearanceDialogPage().ColourTheme = (ColourTheme)Enum.Parse(typeof(ColourTheme), colour_theme);
                }
            }
            catch (Exception)
            {
            }
            List <string> ext_to_scan = null;

            if (stream.Read("ExtToScan", ref ext_to_scan))
            {
                VSAnythingPackage.Inst.GetSettingsDialogPage().ExtList = ext_to_scan.ToArray();
            }
            if (stream.StartElement("ColourThemes"))
            {
                for (int i = 0; i < stream.Count; i++)
                {
                    stream.StartElement(i);
                    string name = null;
                    stream.Read("Name", ref name);
                    if (name == "Custom")
                    {
                        new ColourSettings();
                        Color back_colour = Color.Black;
                        if (stream.Read("BackColour", ref back_colour))
                        {
                            VSAnythingPackage.Inst.GetAppearanceDialogPage().BackColour = back_colour;
                        }
                        Color fore_colour = Color.Black;
                        if (stream.Read("ForeColour", ref fore_colour))
                        {
                            VSAnythingPackage.Inst.GetAppearanceDialogPage().ForeColour = fore_colour;
                        }
                        Color control_colour = Color.Black;
                        if (stream.Read("ControlColour", ref control_colour))
                        {
                            VSAnythingPackage.Inst.GetAppearanceDialogPage().ControlColour = control_colour;
                        }
                        Color select_colour = Color.Black;
                        if (stream.Read("SelectColour", ref select_colour))
                        {
                            VSAnythingPackage.Inst.GetAppearanceDialogPage().SelectColour = select_colour;
                        }
                        Color highlight_colour = Color.Black;
                        if (stream.Read("HighlightColour", ref highlight_colour))
                        {
                            VSAnythingPackage.Inst.GetAppearanceDialogPage().HighlightColour = highlight_colour;
                        }
                        Color highlight_text_colour = Color.Black;
                        if (stream.Read("HighlightTextColour", ref highlight_text_colour))
                        {
                            VSAnythingPackage.Inst.GetAppearanceDialogPage().HighlightTextColour = highlight_text_colour;
                        }
                        Color selected_highlight_text_colour = Color.Black;
                        if (stream.Read("SelectedHighlightTextColour", ref selected_highlight_text_colour))
                        {
                            VSAnythingPackage.Inst.GetAppearanceDialogPage().SelectedHighlightTextColour = selected_highlight_text_colour;
                        }
                        Color code_colour = Color.Black;
                        if (stream.Read("CodeColour", ref code_colour))
                        {
                            VSAnythingPackage.Inst.GetAppearanceDialogPage().CodeColour = code_colour;
                        }
                        Color code_filename_colour = Color.Black;
                        if (stream.Read("CodeFilenameColour", ref code_filename_colour))
                        {
                            VSAnythingPackage.Inst.GetAppearanceDialogPage().CodeFilenameColour = code_filename_colour;
                        }
                    }
                    stream.EndElement();
                }
                stream.EndElement();
            }
            VSAnythingPackage.Inst.GetAppearanceDialogPage().SaveSettingsToStorage();
        }