Beispiel #1
0
 public static void WriteToFile(TemplateMap map, string path)
 {
     try
     {
         Directory.CreateDirectory(Path.GetDirectoryName(path));
         using (var fileStream = File.OpenWrite(path))
         {
             var serizlier = new DataContractJsonSerializer(
                 typeof(TemplateMap),
                 new DataContractJsonSerializerSettings()
             {
                 UseSimpleDictionaryFormat = true
             });
             serizlier.WriteObject(fileStream, map);
         }
     }
     catch (System.Exception e)
     {
         AddAnyFilePackage.LogToOutputPane(string.Concat(
                                               "Could not save the mapping file to: ",
                                               path,
                                               "\r\n",
                                               e.Message));
     }
 }
 public ProjectItemManager(DTE2 dte, TemplateMap templateMap)
 {
     _templateMap = templateMap;
     _dte         = dte;
 }