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); }
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); } }
public static void Initialize(string pubRoot) { settings = PublishSettings.Load(pubRoot); }