Example #1
0
        static void RestoreDefault(string file)
        {
            var prop = new GlobalProperties();

            prop.AutoCompleteBrackets = true;
            prop.EnableVirtualSpace   = false;
            prop.FontFamily           = "Consolas";
            prop.FontSize             = 9f;
            prop.DefaultEncoding      = 1251;
            prop.DocumentStyle        = DocumentStyle.DockingMdi;
            prop.TabLocation          = DocumentTabStripLocation.Top;
            prop.FoldingStrategy      = FindEndOfFoldingBlockStrategy.Strategy1;
            prop.BracketsStrategy     = BracketsHighlightStrategy.Strategy2;
            prop.MinimizeToTray       = false;
            prop.ShowChangedLine      = false;
            prop.BlockCaret           = false;
            prop.ImeMode          = false;
            prop.HiddenChars      = false;
            prop.LineInterval     = 0;
            prop.ShowToolBar      = false;
            prop.ShowStatusBar    = true;
            prop.ShowMenuBar      = true;
            prop.ThemeFile        = SettingsDir + "User\\Themes\\Default.ynotetheme";
            prop.HighlightFolding = true;
            prop.ShowFoldingLines = true;
            prop.ShowCaret        = true;
            prop.LoadLayout       = true;
            prop.UseTabs          = false;
            prop.Zoom             = 100;
            prop.WordWrap         = false;
            prop.ShowRuler        = false;
            prop.ShowDocumentMap  = true;
            prop.PaddingWidth     = 17;
            prop.RecentFileNumber = 15;
            prop.ScrollBars       = true;
            prop.ShowLineNumbers  = true;
            prop.TabSize          = 4;
            File.WriteAllText(file, SerializeProperties(prop));
        }
Example #2
0
        public static void Save(GlobalProperties properties, string file)
        {
            string serialized = SerializeProperties(properties);

            File.WriteAllText(file, serialized);
        }
Example #3
0
 private static string SerializeProperties(GlobalProperties properties)
 {
     return(JsonConvert.SerializeObject(properties, Formatting.Indented));
 }