コード例 #1
0
ファイル: ThemeGen2.cs プロジェクト: tfwio/sd-ext
        public static void SaveTheme(this MsDev2013_Theme theme, string fileName)
        {
            var serializer = new YamlDotNet.Serialization.Serializer();

              using (var writer = new System.IO.StringWriter())
              {
            var themeSettings = Wrap(theme.ToSetting());
            serializer.Serialize(writer, themeSettings, typeof(MsDev2013SettingsCollection));
            var stringdata = writer.ToString();
            System.IO.File.WriteAllText(fileName, stringdata);
              }
              serializer = null;
        }
コード例 #2
0
ファイル: ExportMsDev2013Theme.cs プロジェクト: tfwio/sd-ext
        public override void Run()
        {
            var serializer = new YamlDotNet.Serialization.Serializer();
              using (var writer = new System.IO.StringWriter())
              {
            using (var sfd = new System.Windows.Forms.SaveFileDialog() { Filter = "YAML File|*.yml" })
            {
              var themeSettings = new MsDev2013SettingsCollection()
              {
            Theme =new System.Collections.Generic.List<MsDev2013Settings>
            { { MsDev2013_Theme.Instance.ToSetting() } }
              };

              serializer.Serialize(writer, themeSettings, typeof(MsDev2013SettingsCollection));
              var stringdata = writer.ToString();

              if (sfd.ShowDialog() != DialogResult.OK) return;

              System.IO.File.WriteAllText(sfd.FileName, stringdata);
            }
              }
              serializer = null;
        }
コード例 #3
0
ファイル: ThemeSetting.cs プロジェクト: tfwio/sd-ext
 public static string Save(ThemeSetting input)
 {
     using (var writer = new System.IO.StringWriter()) {
     var serializer = new YamlDotNet.Serialization.Serializer();
     serializer.Serialize(writer, input);
     var result = writer.ToString();
     serializer = null;
     return result;
       }
 }