From fa7ca994e9ddcaf6aee566ea32312d867404651c Mon Sep 17 00:00:00 2001 From: David Sparer Date: Mon, 26 Sep 2016 15:10:32 -0600 Subject: [PATCH] ConnectionList served no purpose and was removed --- mRemoteV1/App/Runtime.cs | 12 ---- .../Config/Connections/ConnectionsSaver.cs | 2 - .../ActiveDirectoryDeserializer.cs | 1 - .../Serializers/XmlConnectionsDeserializer.cs | 3 - .../Serializers/XmlConnectionsSerializer.cs | 1 - mRemoteV1/Connection/ConnectionList.cs | 68 ------------------- mRemoteV1/UI/Window/ConnectionTreeWindow.cs | 1 - mRemoteV1/mRemoteV1.csproj | 1 - 8 files changed, 89 deletions(-) delete mode 100644 mRemoteV1/Connection/ConnectionList.cs diff --git a/mRemoteV1/App/Runtime.cs b/mRemoteV1/App/Runtime.cs index 0dbc29373..77842392d 100644 --- a/mRemoteV1/App/Runtime.cs +++ b/mRemoteV1/App/Runtime.cs @@ -32,8 +32,6 @@ namespace mRemoteNG.App public static class Runtime { #region Public Properties - public static ConnectionList ConnectionList { get; set; } - private static ConnectionList PreviousConnectionList { get; set; } public static CredentialList CredentialList { get; set; } public static CredentialList PreviousCredentialList { get; set; } public static WindowList WindowList { get; set; } @@ -201,7 +199,6 @@ namespace mRemoteNG.App { try { - ConnectionList = new ConnectionList(); ConnectionsLoader connectionsLoader = new ConnectionsLoader(); if (filename == GetDefaultStartupConnectionFileName()) @@ -276,13 +273,6 @@ namespace mRemoteNG.App // disable sql update checking while we are loading updates SQLConnProvider?.Disable(); - if (ConnectionList != null) - { - PreviousConnectionList = ConnectionList.Copy(); - } - - ConnectionList = new ConnectionList(); - if (!Settings.Default.UseSQLServer) { if (withDialog) @@ -472,7 +462,6 @@ namespace mRemoteNG.App if (!Settings.Default.UseSQLServer) connectionsSaver.ConnectionFileName = GetStartupConnectionFileName(); - connectionsSaver.ConnectionList = ConnectionList; connectionsSaver.Export = false; connectionsSaver.SaveSecurity = new Security.Save(false); connectionsSaver.ConnectionTreeModel = ConnectionTreeModel; @@ -530,7 +519,6 @@ namespace mRemoteNG.App connectionsSave.ConnectionFileName = saveFileDialog.FileName; connectionsSave.Export = false; connectionsSave.SaveSecurity = new Security.Save(); - connectionsSave.ConnectionList = ConnectionList; connectionsSave.ConnectionTreeModel = ConnectionTreeModel; connectionsSave.SaveConnections(); diff --git a/mRemoteV1/Config/Connections/ConnectionsSaver.cs b/mRemoteV1/Config/Connections/ConnectionsSaver.cs index 44c5c8bae..8cfe3cca7 100644 --- a/mRemoteV1/Config/Connections/ConnectionsSaver.cs +++ b/mRemoteV1/Config/Connections/ConnectionsSaver.cs @@ -59,7 +59,6 @@ namespace mRemoteNG.Config.Connections public bool Export {get; set;} public Format SaveFormat {get; set;} public Save SaveSecurity {get; set;} - public ConnectionList ConnectionList {get; set;} public ConnectionTreeModel ConnectionTreeModel { get; set; } #endregion @@ -258,7 +257,6 @@ namespace mRemoteNG.Config.Connections { var xmlConnectionsSerializer = new XmlConnectionsSerializer() { - ConnectionList = ConnectionList, Export = Export, SaveSecurity = SaveSecurity }; diff --git a/mRemoteV1/Config/Serializers/ActiveDirectoryDeserializer.cs b/mRemoteV1/Config/Serializers/ActiveDirectoryDeserializer.cs index f97dd5d0e..417eed3e0 100644 --- a/mRemoteV1/Config/Serializers/ActiveDirectoryDeserializer.cs +++ b/mRemoteV1/Config/Serializers/ActiveDirectoryDeserializer.cs @@ -83,7 +83,6 @@ namespace mRemoteNG.Config.Serializers newConnectionInfo.Inheritance.Description = false; parentContainer.AddChild(newConnectionInfo); - Runtime.ConnectionList.Add(newConnectionInfo); } } } \ No newline at end of file diff --git a/mRemoteV1/Config/Serializers/XmlConnectionsDeserializer.cs b/mRemoteV1/Config/Serializers/XmlConnectionsDeserializer.cs index c21f66a46..9a80fd5a6 100644 --- a/mRemoteV1/Config/Serializers/XmlConnectionsDeserializer.cs +++ b/mRemoteV1/Config/Serializers/XmlConnectionsDeserializer.cs @@ -31,13 +31,11 @@ namespace mRemoteNG.Config.Serializers //TODO find way to inject data source info private string ConnectionFileName = ""; - public ConnectionList ConnectionList { get; set; } public XmlConnectionsDeserializer(string xml) { LoadXmlConnectionData(xml); ValidateConnectionFileVersion(); - ConnectionList = new ConnectionList(); } private void LoadXmlConnectionData(string connections) @@ -140,7 +138,6 @@ namespace mRemoteNG.Config.Serializers { var connectionInfo = GetConnectionInfoFromXml(xmlNode); parentContainer.AddChild(connectionInfo); - ConnectionList.Add(connectionInfo); } else if (nodeType == TreeNodeType.Container) { diff --git a/mRemoteV1/Config/Serializers/XmlConnectionsSerializer.cs b/mRemoteV1/Config/Serializers/XmlConnectionsSerializer.cs index 61303696c..e4483bd11 100644 --- a/mRemoteV1/Config/Serializers/XmlConnectionsSerializer.cs +++ b/mRemoteV1/Config/Serializers/XmlConnectionsSerializer.cs @@ -24,7 +24,6 @@ namespace mRemoteNG.Config.Serializers public bool Export { get; set; } public Save SaveSecurity { get; set; } - public ConnectionList ConnectionList { get; set; } public string Serialize(ConnectionTreeModel connectionTreeModel) diff --git a/mRemoteV1/Connection/ConnectionList.cs b/mRemoteV1/Connection/ConnectionList.cs deleted file mode 100644 index fb8329d4b..000000000 --- a/mRemoteV1/Connection/ConnectionList.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections; - - -namespace mRemoteNG.Connection -{ - public class ConnectionList : CollectionBase - { - public ConnectionInfo this[object Index] - { - get - { - if (Index is ConnectionInfo) - return (ConnectionInfo)Index; - else - return ((ConnectionInfo) (List[Convert.ToInt32(Index)])); - } - } - - public new int Count - { - get { return List.Count; } - } - - public ConnectionInfo Add(ConnectionInfo connectionInfo) - { - List.Add(connectionInfo); - return connectionInfo; - } - - public void AddRange(ConnectionInfo[] connectionInfoArray) - { - foreach (ConnectionInfo connectionInfo in connectionInfoArray) - { - List.Add(connectionInfo); - } - } - - public ConnectionInfo FindByConstantID(string id) - { - foreach (ConnectionInfo connectionInfo in List) - { - if (connectionInfo.ConstantID == id) - return connectionInfo; - } - - return null; - } - - public ConnectionList Copy() - { - try - { - return (ConnectionList)MemberwiseClone(); - } - catch (Exception) - { - } - - return null; - } - - public new void Clear() - { - List.Clear(); - } - } -} \ No newline at end of file diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs index d23265a8c..c8544385e 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs @@ -506,7 +506,6 @@ namespace mRemoteNG.UI.Window var newConnectionInfo = new ConnectionInfo(); var selectedContainer = SelectedNode as ContainerInfo; newConnectionInfo.SetParent(selectedContainer ?? SelectedNode.Parent); - Runtime.ConnectionList.Add(newConnectionInfo); } catch (Exception ex) { diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 0ab7545e6..82afbe5cc 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -304,7 +304,6 @@ Component -