Example #1
0
        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();
            }
        }
Example #2
0
 private static void AppendDefaultAuth()
 {
     _history["."] = new SqlServerAuth
     {
         Server   = ".",
         AuthType = SqlServerAuthType.Windows,
     };
     _history["(local)"] = new SqlServerAuth
     {
         Server   = "(local)",
         AuthType = SqlServerAuthType.Windows,
     };
 }
Example #3
0
 private static void AppendDefaultAuth()
 {
     _history["."] = new SqlServerAuth
     {
         Server = ".",
         AuthType = SqlServerAuthType.Windows,
     };
     _history["(local)"] = new SqlServerAuth
     {
         Server = "(local)",
         AuthType = SqlServerAuthType.Windows,
     };
 }
Example #4
0
        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();
            }
        }