public static SQLViewLastRunClass Instance() { if (instance == null) { instance = new SQLViewLastRunClass(); } return(instance); }
public bool Deserialize(string FileName) { bool ok = false; XmlReader reader; FileInfo fi = new FileInfo(FileName); if (fi.Exists) { try { XmlSerializer serializer = new XmlSerializer(typeof(SQLViewLastRunClass)); Stream fs = new FileStream(FileName, FileMode.Open); reader = new XmlTextReader(fs); SQLViewLastRunClass PF = (SQLViewLastRunClass)serializer.Deserialize(reader); reader.Close(); this.XMLName = FileName; this.ServerDatabasePfad = PF.ServerDatabasePfad; this.Version = PF.Version; this.AppType = PF.AppType; this.ServerName = PF.ServerName; this.ClientName = PF.ClientName; this.ScriptPath = PF.ScriptPath; TestParams(); ok = true; } catch (Exception ex) { ok = false; MessageBox.Show(ex.Message + "\r\nFile:" + FileName, "Grundparameter für SQLView konnten nicht geladen werden.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(ok); } finally { } } else { MessageBox.Show(fi.FullName + " existier nicht.", "Grundparameter für SQLView konnten nicht geladen werden.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } return(ok); }