mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Minor refactoring
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
using mRemoteNG.Tools;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace mRemoteNG.Connection
|
||||
{
|
||||
public class ConnectionInfoInheritance
|
||||
{
|
||||
private ConnectionInfoInheritance _tempInheritanceStorage = null;
|
||||
private ConnectionInfoInheritance _tempInheritanceStorage;
|
||||
|
||||
#region Public Properties
|
||||
#region General
|
||||
@@ -16,18 +15,7 @@ namespace mRemoteNG.Connection
|
||||
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
|
||||
public bool EverythingInherited
|
||||
{
|
||||
get
|
||||
{
|
||||
return CacheBitmaps && Colors && Description && DisplayThemes && DisplayWallpaper
|
||||
&& EnableFontSmoothing && EnableDesktopComposition && Domain && Icon && Password
|
||||
&& Port && Protocol && PuttySession && RedirectDiskDrives && RedirectKeys
|
||||
&& RedirectPorts && RedirectPrinters && RedirectSmartCards && RedirectSound && Resolution
|
||||
&& AutomaticResize && UseConsoleSession && UseCredSsp && RenderingEngine && UserField
|
||||
&& ExtApp && Username && Panel && ICAEncryption && RDPAuthenticationLevel
|
||||
&& LoadBalanceInfo && PreExtApp && PostExtApp && MacAddress && VNCAuthMode
|
||||
&& VNCColors && VNCCompression && VNCEncoding && VNCProxyIP && VNCProxyPassword
|
||||
&& VNCProxyPort && VNCProxyType && VNCProxyUsername;
|
||||
}
|
||||
get { return EverythingIsInherited(); }
|
||||
set
|
||||
{
|
||||
SetAllValues(value);
|
||||
@@ -359,6 +347,19 @@ namespace mRemoteNG.Connection
|
||||
SetAllValues(false);
|
||||
}
|
||||
|
||||
private bool EverythingIsInherited()
|
||||
{
|
||||
var displaySettings = Description && Icon && Panel;
|
||||
var connectionSettings = Username && Password && Domain;
|
||||
var protocolSettings = Protocol && ExtApp && Port && PuttySession && ICAEncryption && RDPAuthenticationLevel && LoadBalanceInfo && RenderingEngine && UseConsoleSession && UseCredSsp;
|
||||
var appearanceSettings = Resolution && AutomaticResize && Colors && CacheBitmaps && DisplayWallpaper && DisplayThemes && EnableFontSmoothing && EnableDesktopComposition;
|
||||
var redirectSettings = RedirectDiskDrives && RedirectKeys && RedirectPorts && RedirectPrinters && RedirectSmartCards && RedirectSound;
|
||||
var miscSettings = PreExtApp && PostExtApp && MacAddress && UserField;
|
||||
var vncSettings = VNCAuthMode && VNCColors && VNCCompression && VNCEncoding && VNCProxyIP && VNCProxyPassword && VNCProxyPort && VNCProxyType && VNCProxyUsername;
|
||||
|
||||
return displaySettings && connectionSettings && protocolSettings && appearanceSettings && redirectSettings && miscSettings && vncSettings;
|
||||
}
|
||||
|
||||
private void SetAllValues(bool value)
|
||||
{
|
||||
var properties = typeof(ConnectionInfoInheritance).GetProperties();
|
||||
|
||||
Reference in New Issue
Block a user