mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
392 lines
22 KiB
C#
392 lines
22 KiB
C#
using mRemoteNG.Tools;
|
|
using System;
|
|
using System.ComponentModel;
|
|
|
|
namespace mRemoteNG.Connection
|
|
{
|
|
public class ConnectionInfoInheritance
|
|
{
|
|
private ConnectionInfoInheritance _tempInheritanceStorage = null;
|
|
|
|
#region Public Properties
|
|
#region General
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryGeneral", 1),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAll"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAll"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]
|
|
public bool EverythingInherited
|
|
{
|
|
get
|
|
{
|
|
if (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)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
set
|
|
{
|
|
SetAllValues(value);
|
|
}
|
|
}
|
|
#endregion
|
|
#region Display
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDescription"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDescription"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Description {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameIcon"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionIcon"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Icon {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryDisplay", 2),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePanel"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPanel"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Panel {get; set;}
|
|
#endregion
|
|
#region Connection
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUsername"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUsername"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Username {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePassword"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPassword"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Password {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 3),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDomain"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDomain"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Domain {get; set;}
|
|
#endregion
|
|
#region Protocol
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameProtocol"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionProtocol"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Protocol {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalTool"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionExternalTool"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool ExtApp {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePort"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPort"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Port {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNamePuttySession"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionPuttySession"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool PuttySession {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEncryptionStrength"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEncryptionStrength"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool ICAEncryption {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAuthenticationLevel"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAuthenticationLevel"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool RDPAuthenticationLevel {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameLoadBalanceInfo"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionLoadBalanceInfo"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool LoadBalanceInfo {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRenderingEngine"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRenderingEngine"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool RenderingEngine {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUseConsoleSession"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUseConsoleSession"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool UseConsoleSession {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUseCredSsp"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUseCredSsp"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool UseCredSsp {get; set;}
|
|
#endregion
|
|
#region RD Gateway
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayUsageMethod"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayUsageMethod"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]
|
|
public bool RDGatewayUsageMethod {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayHostname"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayHostname"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]
|
|
public bool RDGatewayHostname {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayUseConnectionCredentials"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayUseConnectionCredentials"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]
|
|
public bool RDGatewayUseConnectionCredentials {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayUsername"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayUsername"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]
|
|
public bool RDGatewayUsername {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayPassword"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayPassword"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]
|
|
public bool RDGatewayPassword {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryGateway", 5),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRDGatewayDomain"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRDGatewayDomain"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]
|
|
public bool RDGatewayDomain {get; set;}
|
|
#endregion
|
|
#region Appearance
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameResolution"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionResolution"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Resolution {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAutomaticResize"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAutomaticResize"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool AutomaticResize {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameColors"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionColors"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool Colors {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameCacheBitmaps"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionCacheBitmaps"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool CacheBitmaps {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDisplayWallpaper"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDisplayWallpaper"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool DisplayWallpaper {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameDisplayThemes"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionDisplayThemes"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool DisplayThemes {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEnableFontSmoothing"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEnableFontSmoothing"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool EnableFontSmoothing {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 6),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEnableDesktopComposition"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEnableEnableDesktopComposition"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool EnableDesktopComposition {get; set;}
|
|
#endregion
|
|
#region Redirect
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectKeys"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectKeys"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool RedirectKeys {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectDrives"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectDrives"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool RedirectDiskDrives {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectPrinters"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectPrinters"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool RedirectPrinters {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectPorts"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectPorts"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool RedirectPorts {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectSmartCards"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectSmartCards"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool RedirectSmartCards {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryRedirect", 7),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameRedirectSounds"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionRedirectSounds"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool RedirectSound {get; set;}
|
|
#endregion
|
|
#region Misc
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalToolBefore"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionExternalToolBefore"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool PreExtApp {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameExternalToolAfter"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionExternalToolAfter"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool PostExtApp {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameMACAddress"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionMACAddress"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool MacAddress {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 8),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameUser1"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionUser1"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool UserField {get; set;}
|
|
#endregion
|
|
#region VNC
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameCompression"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionCompression"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCCompression {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameEncoding"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionEncoding"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCEncoding {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameAuthenticationMode"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionAuthenticationMode"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCAuthMode {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyType"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyType"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCProxyType {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyAddress"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyAddress"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCProxyIP {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyPort"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyPort"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCProxyPort {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyUsername"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyUsername"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCProxyUsername {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryMiscellaneous", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameVNCProxyPassword"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionVNCProxyPassword"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCProxyPassword {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameColors"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionColors"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCColors {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameSmartSizeMode"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionSmartSizeMode"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCSmartSizeMode {get; set;}
|
|
|
|
[LocalizedAttributes.LocalizedCategory("strCategoryAppearance", 9),
|
|
LocalizedAttributes.LocalizedDisplayNameInheritAttribute("strPropertyNameViewOnly"),
|
|
LocalizedAttributes.LocalizedDescriptionInheritAttribute("strPropertyDescriptionViewOnly"),
|
|
TypeConverter(typeof(Tools.MiscTools.YesNoTypeConverter))]public bool VNCViewOnly {get; set;}
|
|
#endregion
|
|
|
|
[Browsable(false)]
|
|
public object Parent {get; set;}
|
|
|
|
[Browsable(false)]
|
|
public bool IsDefault {get; set;}
|
|
#endregion
|
|
|
|
|
|
public ConnectionInfoInheritance(object parent, bool inheritEverything = false)
|
|
{
|
|
Parent = parent;
|
|
if (inheritEverything)
|
|
TurnOnInheritanceCompletely();
|
|
}
|
|
|
|
|
|
|
|
public ConnectionInfoInheritance Copy()
|
|
{
|
|
return (ConnectionInfoInheritance)MemberwiseClone();
|
|
}
|
|
|
|
public void EnableInheritance()
|
|
{
|
|
if (_tempInheritanceStorage != null)
|
|
UnstashInheritanceData();
|
|
}
|
|
|
|
private void UnstashInheritanceData()
|
|
{
|
|
SetAllValues(_tempInheritanceStorage);
|
|
_tempInheritanceStorage = null;
|
|
}
|
|
|
|
public void DisableInheritance()
|
|
{
|
|
StashInheritanceData();
|
|
TurnOffInheritanceCompletely();
|
|
}
|
|
|
|
private void StashInheritanceData()
|
|
{
|
|
_tempInheritanceStorage = Copy();
|
|
}
|
|
|
|
public void TurnOnInheritanceCompletely()
|
|
{
|
|
SetAllValues(true);
|
|
}
|
|
|
|
public void TurnOffInheritanceCompletely()
|
|
{
|
|
SetAllValues(false);
|
|
}
|
|
|
|
private void SetAllValues(bool value)
|
|
{
|
|
var properties = typeof(ConnectionInfoInheritance).GetProperties();
|
|
foreach (var property in properties)
|
|
{
|
|
if (property.PropertyType.Name == typeof(Boolean).Name && property.Name != "EverythingInherited" && property.Name != "IsDefault")
|
|
property.SetValue(this, value, null);
|
|
}
|
|
}
|
|
|
|
private void SetAllValues(ConnectionInfoInheritance otherInheritanceObject)
|
|
{
|
|
var properties = typeof(ConnectionInfoInheritance).GetProperties();
|
|
foreach (var property in properties)
|
|
{
|
|
if (property.Name != "EverythingInherited")
|
|
{
|
|
var newPropertyValue = property.GetValue(otherInheritanceObject, null);
|
|
property.SetValue(this, newPropertyValue, null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |