Exemple #1
0
        internal static void ImportSettingsFile(string settings, string pubRoot)
        {
            string        oldroot       = PublishManager.settings.RepoRoot; //save this always
            XmlSerializer pubSerializer = new XmlSerializer(typeof(PublishSettings));

            if (File.Exists(settings) == false)
            {
                return;
            }
            TextReader      r = new StreamReader(settings);
            PublishSettings s = (PublishSettings)pubSerializer.Deserialize(r);

            r.Close();
            s.RepoRoot = oldroot;
            PublishManager.settings = s;
            s.Save(pubRoot);
        }
Exemple #2
0
 public static PublishSettings Load(string pubRoot)
 {
     Trace.WriteLine("Loading " + pubSettingFile);
     if (File.Exists(pubRoot + "\\" + pubSettingFile) == false)
     {
         if (pubRoot != "" && Directory.Exists(pubRoot) == false)
         {
             Directory.CreateDirectory(pubRoot);
         }
         Trace.WriteLine("Finished Loading Settings----------------------------------------");
         return(new PublishSettings());
     }
     else
     {
         TextReader      r = new StreamReader(pubRoot + "\\" + pubSettingFile);
         PublishSettings s = (PublishSettings)pubSerializer.Deserialize(r);
         r.Close();
         Trace.WriteLine("Finished Loading Settings----------------------------------------");
         return(s);
     }
 }
Exemple #3
0
 public static void Initialize(string pubRoot)
 {
     settings = PublishSettings.Load(pubRoot);
 }