public void PersistHistory(SqlServerAuth auth) { if (string.IsNullOrEmpty(auth?.Server)) return; _history[auth.Server] = auth; using (var sw = new StreamWriter(File.Open(FILENAME, FileMode.Create))) { var content = JsonConvert.SerializeObject(_history.Values); sw.Write(content); sw.Flush(); } }
private static void AppendDefaultAuth() { _history["."] = new SqlServerAuth { Server = ".", AuthType = SqlServerAuthType.Windows, }; _history["(local)"] = new SqlServerAuth { Server = "(local)", AuthType = SqlServerAuthType.Windows, }; }
public void PersistHistory(SqlServerAuth auth) { if (string.IsNullOrEmpty(auth?.Server)) { return; } _history[auth.Server] = auth; using (var sw = new StreamWriter(File.Open(FILENAME, FileMode.Create))) { var content = JsonConvert.SerializeObject(_history.Values); sw.Write(content); sw.Flush(); } }