Пример #1
0
        /**
         * Persists the RecentRemoteServersList in Settings, adding the current ServerName and Username if not present, and bringing them
         * to the top of the list if they are
         */
        public void PersistRecentRemoteServers(bool addCurrentServer)
        {
            if (addCurrentServer)
            {
                var newRemoteServerInfo = new RemoteServerConnectionInfo
                {
                    ServerName = ServerName,
                    UserName   = Username
                };

                RecentRemoteServersList.Remove(newRemoteServerInfo);
                RecentRemoteServersList.Insert(0, newRemoteServerInfo);
            }

            Settings.Default.RecentRemoteServers = JsonConvert.SerializeObject(RecentRemoteServersList);
            Settings.Default.Save();
        }
Пример #2
0
 public void RemoveRemoteServer(RemoteServerConnectionInfo toRemove)
 {
     RecentRemoteServersList.Remove(toRemove);
     RecentRemoteServers.Refresh();
     PersistRecentRemoteServers(false);
 }