From 53c8b3b66d22328889b13af9774a884eaaaaa59c Mon Sep 17 00:00:00 2001 From: Sean Kaim Date: Wed, 12 Apr 2017 13:40:36 -0400 Subject: [PATCH] use statement bodys to allow building with VS2015 --- mRemoteV1/App/Logger.cs | 6 ++- mRemoteV1/App/Shutdown.cs | 6 ++- mRemoteV1/App/SupportedCultures.cs | 7 +++- mRemoteV1/App/Update/AppUpdater.cs | 16 ++++++-- .../Multiuser/RemoteConnectionsSyncronizer.cs | 29 +++++++++++--- .../SqlDatabaseConnector.cs | 6 ++- .../Putty/AbstractPuttySessionsProvider.cs | 9 +++-- .../Config/Putty/PuttySessionsManager.cs | 13 ++++-- mRemoteV1/Connection/Protocol/ProtocolList.cs | 11 +++-- mRemoteV1/Connection/Protocol/PuttyBase.cs | 25 +++++++----- .../Protocol/VNC/Connection.Protocol.VNC.cs | 22 +++++----- .../Credential/CredentialProviderCatalog.cs | 7 +++- mRemoteV1/Messages/MessageCollector.cs | 7 +++- mRemoteV1/Security/EncryptedSecureString.cs | 6 ++- .../AeadCryptographyProvider.cs | 6 ++- .../Tools/Cmdline/CmdArgumentsInterpreter.cs | 6 ++- mRemoteV1/Tools/ExternalTool.cs | 11 ++++- mRemoteV1/Tools/PropertyGridCommandSite.cs | 40 +++++++++++-------- mRemoteV1/Tools/Tools.LocalizedAttributes.cs | 7 +++- .../Controls/ConnectionTree/ConnectionTree.cs | 7 +++- mRemoteV1/UI/Forms/CredentialManagerForm.cs | 7 +++- mRemoteV1/UI/Forms/PasswordForm.cs | 7 +++- mRemoteV1/UI/Window/ConnectionTreeWindow.cs | 7 +++- 23 files changed, 190 insertions(+), 78 deletions(-) diff --git a/mRemoteV1/App/Logger.cs b/mRemoteV1/App/Logger.cs index 3413ddd5..4c7990df 100644 --- a/mRemoteV1/App/Logger.cs +++ b/mRemoteV1/App/Logger.cs @@ -6,6 +6,7 @@ using System; #endif using System.IO; using System.Windows.Forms; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.App { @@ -15,7 +16,10 @@ namespace mRemoteNG.App public ILog Log { get; private set; } - public static string DefaultLogPath => BuildLogFilePath(); + public static string DefaultLogPath + { + get { return BuildLogFilePath(); } + } private Logger() { diff --git a/mRemoteV1/App/Shutdown.cs b/mRemoteV1/App/Shutdown.cs index 3d47709f..391960e1 100644 --- a/mRemoteV1/App/Shutdown.cs +++ b/mRemoteV1/App/Shutdown.cs @@ -5,6 +5,7 @@ using System.Windows.Forms; using mRemoteNG.Config.Putty; using mRemoteNG.UI.Controls; using mRemoteNG.UI.Forms; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.App { @@ -12,7 +13,10 @@ namespace mRemoteNG.App { private static string _updateFilePath; - private static bool UpdatePending => !string.IsNullOrEmpty(_updateFilePath); + private static bool UpdatePending + { + get { return !string.IsNullOrEmpty(_updateFilePath); } + } public static void Quit(string updateFilePath = null) { diff --git a/mRemoteV1/App/SupportedCultures.cs b/mRemoteV1/App/SupportedCultures.cs index a4ae7533..142c53af 100644 --- a/mRemoteV1/App/SupportedCultures.cs +++ b/mRemoteV1/App/SupportedCultures.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.App { @@ -11,7 +11,10 @@ namespace mRemoteNG.App { private static SupportedCultures _Instance; - private static SupportedCultures SingletonInstance => _Instance ?? (_Instance = new SupportedCultures()); + private static SupportedCultures SingletonInstance + { + get { return _Instance ?? (_Instance = new SupportedCultures()); } + } private SupportedCultures() diff --git a/mRemoteV1/App/Update/AppUpdater.cs b/mRemoteV1/App/Update/AppUpdater.cs index 38515ad8..798f448f 100644 --- a/mRemoteV1/App/Update/AppUpdater.cs +++ b/mRemoteV1/App/Update/AppUpdater.cs @@ -13,6 +13,7 @@ using mRemoteNG.Tools; #else using System.Windows.Forms; #endif +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.App.Update { @@ -28,11 +29,20 @@ namespace mRemoteNG.App.Update public string ChangeLog { get; private set; } - public bool IsGetUpdateInfoRunning => _getUpdateInfoThread != null && _getUpdateInfoThread.IsAlive; + public bool IsGetUpdateInfoRunning + { + get { return _getUpdateInfoThread != null && _getUpdateInfoThread.IsAlive; } + } - private bool IsGetChangeLogRunning => _getChangeLogThread != null && _getChangeLogThread.IsAlive; + private bool IsGetChangeLogRunning + { + get { return _getChangeLogThread != null && _getChangeLogThread.IsAlive; } + } - public bool IsDownloadUpdateRunning => _downloadUpdateWebClient != null; + public bool IsDownloadUpdateRunning + { + get { return _downloadUpdateWebClient != null; } + } #endregion diff --git a/mRemoteV1/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs b/mRemoteV1/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs index 372378c0..62765900 100644 --- a/mRemoteV1/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs +++ b/mRemoteV1/Config/Connections/Multiuser/RemoteConnectionsSyncronizer.cs @@ -1,6 +1,7 @@ using System; using System.Timers; using mRemoteNG.App; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Config.Connections.Multiuser { @@ -11,7 +12,10 @@ namespace mRemoteNG.Config.Connections.Multiuser private readonly ConnectionsLoader _connectionsLoader; private readonly ConnectionsSaver _connectionsSaver; - public double TimerIntervalInMilliseconds => _updateTimer.Interval; + public double TimerIntervalInMilliseconds + { + get { return _updateTimer.Interval; } + } public RemoteConnectionsSyncronizer(IConnectionsUpdateChecker updateChecker) { @@ -47,10 +51,25 @@ namespace mRemoteNG.Config.Connections.Multiuser _connectionsSaver.SaveConnections(); } - public void Enable() => _updateTimer.Start(); - public void Disable() => _updateTimer.Stop(); - public bool IsUpdateAvailable() => _updateChecker.IsUpdateAvailable(); - public void IsUpdateAvailableAsync() => _updateChecker.IsUpdateAvailableAsync(); + public void Enable() + { + _updateTimer.Start(); + } + + public void Disable() + { + _updateTimer.Stop(); + } + + public bool IsUpdateAvailable() + { + return _updateChecker.IsUpdateAvailable(); + } + + public void IsUpdateAvailableAsync() + { + _updateChecker.IsUpdateAvailableAsync(); + } private void OnUpdateCheckStarted(object sender, EventArgs eventArgs) diff --git a/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnector.cs b/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnector.cs index 75d2e4d0..c36c9753 100644 --- a/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnector.cs +++ b/mRemoteV1/Config/DatabaseConnectors/SqlDatabaseConnector.cs @@ -2,6 +2,7 @@ using System.Data.SqlClient; using mRemoteNG.App; using mRemoteNG.Security.SymmetricEncryption; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Config.DatabaseConnectors { @@ -14,7 +15,10 @@ namespace mRemoteNG.Config.DatabaseConnectors private string _sqlUsername; private string _sqlPassword; - public bool IsConnected => (SqlConnection.State == ConnectionState.Open); + public bool IsConnected + { + get { return (SqlConnection.State == ConnectionState.Open); } + } public SqlDatabaseConnector() { diff --git a/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs b/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs index cbd5d443..e4f84c45 100644 --- a/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs +++ b/mRemoteV1/Config/Putty/AbstractPuttySessionsProvider.cs @@ -3,16 +3,19 @@ using System.Collections.Specialized; using System.Linq; using mRemoteNG.Connection; using mRemoteNG.Tree.Root; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Config.Putty { public abstract class AbstractPuttySessionsProvider { public virtual RootPuttySessionsNodeInfo RootInfo { get; } = new RootPuttySessionsNodeInfo(); - protected virtual List Sessions => RootInfo.Children.OfType().ToList(); + protected virtual List Sessions + { + get { return RootInfo.Children.OfType().ToList(); } + } - #region Public Methods + #region Public Methods public abstract string[] GetSessionNames(bool raw = false); public abstract PuttySessionInfo GetSession(string sessionName); diff --git a/mRemoteV1/Config/Putty/PuttySessionsManager.cs b/mRemoteV1/Config/Putty/PuttySessionsManager.cs index 3a457632..42eab567 100644 --- a/mRemoteV1/Config/Putty/PuttySessionsManager.cs +++ b/mRemoteV1/Config/Putty/PuttySessionsManager.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using mRemoteNG.Tree.Root; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Config.Putty { @@ -12,7 +12,11 @@ namespace mRemoteNG.Config.Putty public static PuttySessionsManager Instance { get; } = new PuttySessionsManager(); private readonly List _providers = new List(); - public IEnumerable Providers => _providers; + public IEnumerable Providers + { + get { return _providers; } + } + public List RootPuttySessionsNodes { get; } = new List(); private PuttySessionsManager() @@ -122,7 +126,10 @@ namespace mRemoteNG.Config.Putty #region Public Classes public class SessionList : StringConverter { - public static string[] Names => Instance.GetSessionNames(); + public static string[] Names + { + get { return Instance.GetSessionNames(); } + } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { diff --git a/mRemoteV1/Connection/Protocol/ProtocolList.cs b/mRemoteV1/Connection/Protocol/ProtocolList.cs index 87497b15..9eee86eb 100644 --- a/mRemoteV1/Connection/Protocol/ProtocolList.cs +++ b/mRemoteV1/Connection/Protocol/ProtocolList.cs @@ -1,7 +1,7 @@ using System; using System.Collections; using System.Collections.Specialized; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Connection.Protocol { @@ -20,10 +20,13 @@ namespace mRemoteNG.Connection.Protocol } } - public new int Count => List.Count; + public new int Count + { + get { return List.Count; } + } - - public void Add(ProtocolBase cProt) + + public void Add(ProtocolBase cProt) { List.Add(cProt); RaiseCollectionChangedEvent(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, cProt)); diff --git a/mRemoteV1/Connection/Protocol/PuttyBase.cs b/mRemoteV1/Connection/Protocol/PuttyBase.cs index 37f19cf5..0d090f69 100644 --- a/mRemoteV1/Connection/Protocol/PuttyBase.cs +++ b/mRemoteV1/Connection/Protocol/PuttyBase.cs @@ -9,7 +9,7 @@ using System.Windows.Forms; using mRemoteNG.Security; using mRemoteNG.Security.SymmetricEncryption; using mRemoteNG.Tools.Cmdline; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Connection.Protocol { @@ -30,7 +30,10 @@ namespace mRemoteNG.Connection.Protocol public static string PuttyPath { get; set; } - public bool Focused => NativeMethods.GetForegroundWindow() == PuttyHandle; + public bool Focused + { + get { return NativeMethods.GetForegroundWindow() == PuttyHandle; } + } #endregion @@ -76,14 +79,16 @@ namespace mRemoteNG.Connection.Protocol } else { - if (Settings.Default.EmptyCredentials == "windows") - { - username = Environment.UserName; - } - else if (Settings.Default.EmptyCredentials == "custom") - { - username = Settings.Default.DefaultUsername; - } + // ReSharper disable once SwitchStatementMissingSomeCases + switch (Settings.Default.EmptyCredentials) + { + case "windows": + username = Environment.UserName; + break; + case "custom": + username = Settings.Default.DefaultUsername; + break; + } } if (!string.IsNullOrEmpty(InterfaceControl.Info.CredentialRecord?.Password.ConvertToUnsecureString())) diff --git a/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs b/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs index 47ba0cc7..f9b73bf9 100644 --- a/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs +++ b/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using mRemoteNG.Security; using mRemoteNG.Tools; using mRemoteNG.UI.Forms; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Connection.Protocol.VNC @@ -12,17 +13,18 @@ namespace mRemoteNG.Connection.Protocol.VNC { #region Properties public bool SmartSize - { - get => _VNC.Scaled; - set => _VNC.Scaled = value; + { + get { return _VNC.Scaled; } + set { _VNC.Scaled = value; } } - - public bool ViewOnly - { - get => _VNC.ViewOnly; - set => _VNC.ViewOnly = value; - } - #endregion + + public bool ViewOnly + { + get { return _VNC.ViewOnly; } + set { _VNC.ViewOnly = value; } + } + + #endregion #region Private Declarations private VncSharp.RemoteDesktop _VNC; diff --git a/mRemoteV1/Credential/CredentialProviderCatalog.cs b/mRemoteV1/Credential/CredentialProviderCatalog.cs index 2160b1fe..d604599a 100644 --- a/mRemoteV1/Credential/CredentialProviderCatalog.cs +++ b/mRemoteV1/Credential/CredentialProviderCatalog.cs @@ -1,6 +1,6 @@ using System.Collections; using System.Collections.Generic; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Credential { @@ -8,7 +8,10 @@ namespace mRemoteNG.Credential { private readonly List _credentialProviders = new List(); - public IEnumerable CredentialProviders => _credentialProviders; + public IEnumerable CredentialProviders + { + get { return _credentialProviders; } + } public void AddProvider(ICredentialProvider credentialProvider) diff --git a/mRemoteV1/Messages/MessageCollector.cs b/mRemoteV1/Messages/MessageCollector.cs index 944a60ab..fdef0a0f 100644 --- a/mRemoteV1/Messages/MessageCollector.cs +++ b/mRemoteV1/Messages/MessageCollector.cs @@ -3,7 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Messages { @@ -11,7 +11,10 @@ namespace mRemoteNG.Messages { private readonly IList _messageList; - public IEnumerable Messages => _messageList; + public IEnumerable Messages + { + get { return _messageList; } + } public MessageCollector() { diff --git a/mRemoteV1/Security/EncryptedSecureString.cs b/mRemoteV1/Security/EncryptedSecureString.cs index 936534a0..9b66713d 100644 --- a/mRemoteV1/Security/EncryptedSecureString.cs +++ b/mRemoteV1/Security/EncryptedSecureString.cs @@ -1,6 +1,7 @@ using System.Security; using mRemoteNG.Security.SymmetricEncryption; using Org.BouncyCastle.Security; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Security { @@ -10,7 +11,10 @@ namespace mRemoteNG.Security private SecureString _secureString; private readonly ICryptographyProvider _cryptographyProvider; - private static SecureString MachineKey => _machineKey ?? (_machineKey = GenerateNewMachineKey(32)); + private static SecureString MachineKey + { + get { return _machineKey ?? (_machineKey = GenerateNewMachineKey(32)); } + } public EncryptedSecureString() { diff --git a/mRemoteV1/Security/SymmetricEncryption/AeadCryptographyProvider.cs b/mRemoteV1/Security/SymmetricEncryption/AeadCryptographyProvider.cs index a75aec47..850da78d 100644 --- a/mRemoteV1/Security/SymmetricEncryption/AeadCryptographyProvider.cs +++ b/mRemoteV1/Security/SymmetricEncryption/AeadCryptographyProvider.cs @@ -16,6 +16,7 @@ using Org.BouncyCastle.Crypto.Engines; using Org.BouncyCastle.Crypto.Modes; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Security; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Security.SymmetricEncryption { @@ -36,7 +37,10 @@ namespace mRemoteNG.Security.SymmetricEncryption protected virtual int MinPasswordLength { get; set; } = 1; - public int BlockSizeInBytes => _aeadBlockCipher.GetBlockSize(); + public int BlockSizeInBytes + { + get { return _aeadBlockCipher.GetBlockSize(); } + } public BlockCipherEngines CipherEngine { diff --git a/mRemoteV1/Tools/Cmdline/CmdArgumentsInterpreter.cs b/mRemoteV1/Tools/Cmdline/CmdArgumentsInterpreter.cs index 4004929f..20f23b51 100644 --- a/mRemoteV1/Tools/Cmdline/CmdArgumentsInterpreter.cs +++ b/mRemoteV1/Tools/Cmdline/CmdArgumentsInterpreter.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.Text.RegularExpressions; using mRemoteNG.App; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Tools.Cmdline { @@ -21,7 +22,10 @@ namespace mRemoteNG.Tools.Cmdline private readonly StringDictionary _parameters; // Retrieve a parameter value if it exists - public string this[string param] => (_parameters[param]); + public string this[string param] + { + get { return (_parameters[param]); } + } public CmdArgumentsInterpreter(IEnumerable args) { diff --git a/mRemoteV1/Tools/ExternalTool.cs b/mRemoteV1/Tools/ExternalTool.cs index 279e31de..d38bf809 100644 --- a/mRemoteV1/Tools/ExternalTool.cs +++ b/mRemoteV1/Tools/ExternalTool.cs @@ -6,6 +6,7 @@ using mRemoteNG.App; using mRemoteNG.Connection; using mRemoteNG.Connection.Protocol; using mRemoteNG.Messages; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Tools { @@ -20,9 +21,15 @@ namespace mRemoteNG.Tools public bool TryIntegrate { get; set; } public ConnectionInfo ConnectionInfo { get; set; } - public Icon Icon => File.Exists(FileName) ? MiscTools.GetIconFromFile(FileName) : Resources.mRemote_Icon; + public Icon Icon + { + get { return File.Exists(FileName) ? MiscTools.GetIconFromFile(FileName) : Resources.mRemote_Icon; } + } - public Image Image => Icon?.ToBitmap() ?? Resources.mRemote_Icon.ToBitmap(); + public Image Image + { + get { return Icon?.ToBitmap() ?? Resources.mRemote_Icon.ToBitmap(); } + } #endregion diff --git a/mRemoteV1/Tools/PropertyGridCommandSite.cs b/mRemoteV1/Tools/PropertyGridCommandSite.cs index 9428db66..828e1ac2 100644 --- a/mRemoteV1/Tools/PropertyGridCommandSite.cs +++ b/mRemoteV1/Tools/PropertyGridCommandSite.cs @@ -2,7 +2,7 @@ using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Reflection; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Tools { @@ -30,7 +30,7 @@ namespace mRemoteNG.Tools continue; } - var commandAttribute = (CommandAttribute) (commandAttributes[0]); + var commandAttribute = (CommandAttribute) commandAttributes[0]; if (!commandAttribute.Command) { continue; @@ -40,7 +40,7 @@ namespace mRemoteNG.Tools var displayNameAttributes = method.GetCustomAttributes(typeof(DisplayNameAttribute), true); if (displayNameAttributes.Length != 0) { - var displayNameAttribute = (DisplayNameAttribute) (displayNameAttributes[0]); + var displayNameAttribute = (DisplayNameAttribute) displayNameAttributes[0]; if (!string.IsNullOrEmpty(displayNameAttribute.DisplayName)) { displayName = displayNameAttribute.DisplayName; @@ -71,7 +71,7 @@ namespace mRemoteNG.Tools continue; } - var commandAttribute = (CommandAttribute) (commandAttributes[0]); + var commandAttribute = (CommandAttribute) commandAttributes[0]; if (!commandAttribute.Command) { continue; @@ -81,7 +81,7 @@ namespace mRemoteNG.Tools var displayNameAttributes = method.GetCustomAttributes(typeof(DisplayNameAttribute), true); if (displayNameAttributes.Length != 0) { - var displayNameAttribute = (DisplayNameAttribute) (displayNameAttributes[0]); + var displayNameAttribute = (DisplayNameAttribute) displayNameAttributes[0]; if (!string.IsNullOrEmpty(displayNameAttribute.DisplayName)) { displayName = displayNameAttribute.DisplayName; @@ -101,52 +101,58 @@ namespace mRemoteNG.Tools public IComponent Component { - get { throw (new NotSupportedException()); } + get { throw new NotSupportedException(); } } - public IContainer Container => null; + public IContainer Container + { + get { return null; } + } - public bool DesignMode => true; + public bool DesignMode + { + get { return true; } + } public string Name { - get { throw (new NotSupportedException()); } - set { throw (new NotSupportedException()); } + get { throw new NotSupportedException(); } + set { throw new NotSupportedException(); } } public void AddCommand(MenuCommand command) { - throw (new NotSupportedException()); + throw new NotSupportedException(); } public void AddVerb(DesignerVerb verb) { - throw (new NotSupportedException()); + throw new NotSupportedException(); } public MenuCommand FindCommand(CommandID commandId) { - throw (new NotSupportedException()); + throw new NotSupportedException(); } public bool GlobalInvoke(CommandID commandId) { - throw (new NotSupportedException()); + throw new NotSupportedException(); } public void RemoveCommand(MenuCommand command) { - throw (new NotSupportedException()); + throw new NotSupportedException(); } public void RemoveVerb(DesignerVerb verb) { - throw (new NotSupportedException()); + throw new NotSupportedException(); } public void ShowContextMenu(CommandID menuId, int x, int y) { - throw (new NotSupportedException()); + throw new NotSupportedException(); } } diff --git a/mRemoteV1/Tools/Tools.LocalizedAttributes.cs b/mRemoteV1/Tools/Tools.LocalizedAttributes.cs index 539a14e6..f2838c9e 100644 --- a/mRemoteV1/Tools/Tools.LocalizedAttributes.cs +++ b/mRemoteV1/Tools/Tools.LocalizedAttributes.cs @@ -1,6 +1,6 @@ using System; using System.ComponentModel; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.Tools { @@ -88,7 +88,10 @@ namespace mRemoteNG.Tools // This allows localized attributes in a derived class to override a matching // non-localized attribute inherited from its base class - public override object TypeId => typeof(DefaultValueAttribute); + public override object TypeId + { + get { return typeof(DefaultValueAttribute); } + } } #region Special localization - with String.Format diff --git a/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.cs b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.cs index 245d8a66..2eec364b 100644 --- a/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.cs +++ b/mRemoteV1/UI/Controls/ConnectionTree/ConnectionTree.cs @@ -11,7 +11,7 @@ using mRemoteNG.Connection; using mRemoteNG.Container; using mRemoteNG.Tree; using mRemoteNG.Tree.Root; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.UI.Controls { @@ -21,7 +21,10 @@ namespace mRemoteNG.UI.Controls private readonly ConnectionTreeDragAndDropHandler _dragAndDropHandler = new ConnectionTreeDragAndDropHandler(); private readonly PuttySessionsManager _puttySessionsManager = PuttySessionsManager.Instance; - public ConnectionInfo SelectedNode => (ConnectionInfo) SelectedObject; + public ConnectionInfo SelectedNode + { + get { return (ConnectionInfo) SelectedObject; } + } public NodeSearcher NodeSearcher { get; private set; } diff --git a/mRemoteV1/UI/Forms/CredentialManagerForm.cs b/mRemoteV1/UI/Forms/CredentialManagerForm.cs index 50e905bd..c75c166a 100644 --- a/mRemoteV1/UI/Forms/CredentialManagerForm.cs +++ b/mRemoteV1/UI/Forms/CredentialManagerForm.cs @@ -3,6 +3,7 @@ using System.Windows.Forms; using BrightIdeasSoftware; using mRemoteNG.Credential; using mRemoteNG.Tree; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.UI.Forms @@ -11,7 +12,11 @@ namespace mRemoteNG.UI.Forms { private readonly CredentialManager _credentialManager; - public ICredentialRecord SelectedRecord => objectListView1.SelectedObject as ICredentialRecord; + public ICredentialRecord SelectedRecord + { + get { return objectListView1.SelectedObject as ICredentialRecord; } + } + public IConfirm DeletionConfirmer { get; set; } = new AlwaysConfirmYes(); public CredentialManagerForm(CredentialManager credentialManager) diff --git a/mRemoteV1/UI/Forms/PasswordForm.cs b/mRemoteV1/UI/Forms/PasswordForm.cs index 24e97f69..58c2a116 100644 --- a/mRemoteV1/UI/Forms/PasswordForm.cs +++ b/mRemoteV1/UI/Forms/PasswordForm.cs @@ -1,6 +1,6 @@ using System; using System.Windows.Forms; -using mRemoteNG.UI.Controls; +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.UI.Forms { @@ -12,7 +12,10 @@ namespace mRemoteNG.UI.Forms private bool Verify { get; set; } - public string Password => Verify ? txtVerify.Text : txtPassword.Text; + public string Password + { + get { return Verify ? txtVerify.Text : txtPassword.Text; } + } #endregion diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs index 260839fe..3e8c0b09 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs @@ -9,7 +9,7 @@ using System.Drawing; using System.Windows.Forms; using mRemoteNG.UI.Controls; using WeifenLuo.WinFormsUI.Docking; - +// ReSharper disable ArrangeAccessorOwnerBody namespace mRemoteNG.UI.Window { @@ -19,7 +19,10 @@ namespace mRemoteNG.UI.Window private readonly IConnectionInitiator _connectionInitiator = new ConnectionInitiator(); - public ConnectionInfo SelectedNode => olvConnections.SelectedNode; + public ConnectionInfo SelectedNode + { + get { return olvConnections.SelectedNode; } + } public ConnectionTree ConnectionTree {