private void SetInheritanceAttributes(XContainer element, IInheritable connectionInfo) { if (_saveFilter.SaveInheritance) { element.Add(new XAttribute("InheritCacheBitmaps", connectionInfo.Inheritance.CacheBitmaps.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritColors", connectionInfo.Inheritance.Colors.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritDescription", connectionInfo.Inheritance.Description.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritDisplayThemes", connectionInfo.Inheritance.DisplayThemes.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritDisplayWallpaper", connectionInfo.Inheritance.DisplayWallpaper.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritEnableFontSmoothing", connectionInfo.Inheritance.EnableFontSmoothing.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritEnableDesktopComposition", connectionInfo.Inheritance.EnableDesktopComposition.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritDomain", connectionInfo.Inheritance.Domain.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritIcon", connectionInfo.Inheritance.Icon.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritPanel", connectionInfo.Inheritance.Panel.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritPassword", connectionInfo.Inheritance.Password.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritPort", connectionInfo.Inheritance.Port.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritProtocol", connectionInfo.Inheritance.Protocol.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritPuttySession", connectionInfo.Inheritance.PuttySession.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRedirectDiskDrives", connectionInfo.Inheritance.RedirectDiskDrives.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRedirectKeys", connectionInfo.Inheritance.RedirectKeys.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRedirectPorts", connectionInfo.Inheritance.RedirectPorts.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRedirectPrinters", connectionInfo.Inheritance.RedirectPrinters.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRedirectSmartCards", connectionInfo.Inheritance.RedirectSmartCards.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRedirectSound", connectionInfo.Inheritance.RedirectSound.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritSoundQuality", connectionInfo.Inheritance.SoundQuality.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritResolution", connectionInfo.Inheritance.Resolution.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritAutomaticResize", connectionInfo.Inheritance.AutomaticResize.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritUseConsoleSession", connectionInfo.Inheritance.UseConsoleSession.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritUseCredSsp", connectionInfo.Inheritance.UseCredSsp.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRenderingEngine", connectionInfo.Inheritance.RenderingEngine.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritUsername", connectionInfo.Inheritance.Username.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritICAEncryptionStrength", connectionInfo.Inheritance.ICAEncryptionStrength.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRDPAuthenticationLevel", connectionInfo.Inheritance.RDPAuthenticationLevel.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRDPMinutesToIdleTimeout", connectionInfo.Inheritance.RDPMinutesToIdleTimeout.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRDPAlertIdleTimeout", connectionInfo.Inheritance.RDPAlertIdleTimeout.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritLoadBalanceInfo", connectionInfo.Inheritance.LoadBalanceInfo.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritPreExtApp", connectionInfo.Inheritance.PreExtApp.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritPostExtApp", connectionInfo.Inheritance.PostExtApp.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritMacAddress", connectionInfo.Inheritance.MacAddress.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritUserField", connectionInfo.Inheritance.UserField.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritExtApp", connectionInfo.Inheritance.ExtApp.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCCompression", connectionInfo.Inheritance.VNCCompression.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCEncoding", connectionInfo.Inheritance.VNCEncoding.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCAuthMode", connectionInfo.Inheritance.VNCAuthMode.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCProxyType", connectionInfo.Inheritance.VNCProxyType.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCProxyIP", connectionInfo.Inheritance.VNCProxyIP.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCProxyPort", connectionInfo.Inheritance.VNCProxyPort.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCProxyUsername", connectionInfo.Inheritance.VNCProxyUsername.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCProxyPassword", connectionInfo.Inheritance.VNCProxyPassword.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCColors", connectionInfo.Inheritance.VNCColors.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCSmartSizeMode", connectionInfo.Inheritance.VNCSmartSizeMode.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritVNCViewOnly", connectionInfo.Inheritance.VNCViewOnly.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRDGatewayUsageMethod", connectionInfo.Inheritance.RDGatewayUsageMethod.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRDGatewayHostname", connectionInfo.Inheritance.RDGatewayHostname.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRDGatewayUseConnectionCredentials", connectionInfo.Inheritance.RDGatewayUseConnectionCredentials.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRDGatewayUsername", connectionInfo.Inheritance.RDGatewayUsername.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRDGatewayPassword", connectionInfo.Inheritance.RDGatewayPassword.ToString().ToLowerInvariant())); element.Add(new XAttribute("InheritRDGatewayDomain", connectionInfo.Inheritance.RDGatewayDomain.ToString().ToLowerInvariant())); } else { var falseString = false.ToString().ToLowerInvariant(); element.Add(new XAttribute("InheritCacheBitmaps", falseString)); element.Add(new XAttribute("InheritColors", falseString)); element.Add(new XAttribute("InheritDescription", falseString)); element.Add(new XAttribute("InheritDisplayThemes", falseString)); element.Add(new XAttribute("InheritDisplayWallpaper", falseString)); element.Add(new XAttribute("InheritEnableFontSmoothing", falseString)); element.Add(new XAttribute("InheritEnableDesktopComposition", falseString)); element.Add(new XAttribute("InheritDomain", falseString)); element.Add(new XAttribute("InheritIcon", falseString)); element.Add(new XAttribute("InheritPanel", falseString)); element.Add(new XAttribute("InheritPassword", falseString)); element.Add(new XAttribute("InheritPort", falseString)); element.Add(new XAttribute("InheritProtocol", falseString)); element.Add(new XAttribute("InheritPuttySession", falseString)); element.Add(new XAttribute("InheritRedirectDiskDrives", falseString)); element.Add(new XAttribute("InheritRedirectKeys", falseString)); element.Add(new XAttribute("InheritRedirectPorts", falseString)); element.Add(new XAttribute("InheritRedirectPrinters", falseString)); element.Add(new XAttribute("InheritRedirectSmartCards", falseString)); element.Add(new XAttribute("InheritRedirectSound", falseString)); element.Add(new XAttribute("InheritSoundQuality", falseString)); element.Add(new XAttribute("InheritResolution", falseString)); element.Add(new XAttribute("InheritAutomaticResize", falseString)); element.Add(new XAttribute("InheritUseConsoleSession", falseString)); element.Add(new XAttribute("InheritUseCredSsp", falseString)); element.Add(new XAttribute("InheritRenderingEngine", falseString)); element.Add(new XAttribute("InheritUsername", falseString)); element.Add(new XAttribute("InheritICAEncryptionStrength", falseString)); element.Add(new XAttribute("InheritRDPAuthenticationLevel", falseString)); element.Add(new XAttribute("InheritRDPMinutesToIdleTimeout", falseString)); element.Add(new XAttribute("InheritRDPAlertIdleTimeout", falseString)); element.Add(new XAttribute("InheritLoadBalanceInfo", falseString)); element.Add(new XAttribute("InheritPreExtApp", falseString)); element.Add(new XAttribute("InheritPostExtApp", falseString)); element.Add(new XAttribute("InheritMacAddress", falseString)); element.Add(new XAttribute("InheritUserField", falseString)); element.Add(new XAttribute("InheritExtApp", falseString)); element.Add(new XAttribute("InheritVNCCompression", falseString)); element.Add(new XAttribute("InheritVNCEncoding", falseString)); element.Add(new XAttribute("InheritVNCAuthMode", falseString)); element.Add(new XAttribute("InheritVNCProxyType", falseString)); element.Add(new XAttribute("InheritVNCProxyIP", falseString)); element.Add(new XAttribute("InheritVNCProxyPort", falseString)); element.Add(new XAttribute("InheritVNCProxyUsername", falseString)); element.Add(new XAttribute("InheritVNCProxyPassword", falseString)); element.Add(new XAttribute("InheritVNCColors", falseString)); element.Add(new XAttribute("InheritVNCSmartSizeMode", falseString)); element.Add(new XAttribute("InheritVNCViewOnly", falseString)); element.Add(new XAttribute("InheritRDGatewayUsageMethod", falseString)); element.Add(new XAttribute("InheritRDGatewayHostname", falseString)); element.Add(new XAttribute("InheritRDGatewayUseConnectionCredentials", falseString)); element.Add(new XAttribute("InheritRDGatewayUsername", falseString)); element.Add(new XAttribute("InheritRDGatewayPassword", falseString)); element.Add(new XAttribute("InheritRDGatewayDomain", falseString)); } }
private void SetInheritanceAttributes(XContainer element, IInheritable connectionInfo) { if (_saveFilter.SaveInheritance) { element.Add(new XAttribute("InheritCacheBitmaps", connectionInfo.Inheritance.CacheBitmaps.ToString())); element.Add(new XAttribute("InheritColors", connectionInfo.Inheritance.Colors.ToString())); element.Add(new XAttribute("InheritDescription", connectionInfo.Inheritance.Description.ToString())); element.Add(new XAttribute("InheritDisplayThemes", connectionInfo.Inheritance.DisplayThemes.ToString())); element.Add(new XAttribute("InheritDisplayWallpaper", connectionInfo.Inheritance.DisplayWallpaper.ToString())); element.Add(new XAttribute("InheritEnableFontSmoothing", connectionInfo.Inheritance.EnableFontSmoothing.ToString())); element.Add(new XAttribute("InheritEnableDesktopComposition", connectionInfo.Inheritance.EnableDesktopComposition.ToString())); element.Add(new XAttribute("InheritDomain", connectionInfo.Inheritance.Domain.ToString())); element.Add(new XAttribute("InheritIcon", connectionInfo.Inheritance.Icon.ToString())); element.Add(new XAttribute("InheritPanel", connectionInfo.Inheritance.Panel.ToString())); element.Add(new XAttribute("InheritPassword", connectionInfo.Inheritance.Password.ToString())); element.Add(new XAttribute("InheritPort", connectionInfo.Inheritance.Port.ToString())); element.Add(new XAttribute("InheritProtocol", connectionInfo.Inheritance.Protocol.ToString())); element.Add(new XAttribute("InheritPuttySession", connectionInfo.Inheritance.PuttySession.ToString())); element.Add(new XAttribute("InheritRedirectDiskDrives", connectionInfo.Inheritance.RedirectDiskDrives.ToString())); element.Add(new XAttribute("InheritRedirectKeys", connectionInfo.Inheritance.RedirectKeys.ToString())); element.Add(new XAttribute("InheritRedirectPorts", connectionInfo.Inheritance.RedirectPorts.ToString())); element.Add(new XAttribute("InheritRedirectPrinters", connectionInfo.Inheritance.RedirectPrinters.ToString())); element.Add(new XAttribute("InheritRedirectSmartCards", connectionInfo.Inheritance.RedirectSmartCards.ToString())); element.Add(new XAttribute("InheritRedirectSound", connectionInfo.Inheritance.RedirectSound.ToString())); element.Add(new XAttribute("InheritSoundQuality", connectionInfo.Inheritance.SoundQuality.ToString())); element.Add(new XAttribute("InheritResolution", connectionInfo.Inheritance.Resolution.ToString())); element.Add(new XAttribute("InheritAutomaticResize", connectionInfo.Inheritance.AutomaticResize.ToString())); element.Add(new XAttribute("InheritUseConsoleSession", connectionInfo.Inheritance.UseConsoleSession.ToString())); element.Add(new XAttribute("InheritUseCredSsp", connectionInfo.Inheritance.UseCredSsp.ToString())); element.Add(new XAttribute("InheritRenderingEngine", connectionInfo.Inheritance.RenderingEngine.ToString())); element.Add(new XAttribute("InheritUsername", connectionInfo.Inheritance.Username.ToString())); element.Add(new XAttribute("InheritICAEncryptionStrength", connectionInfo.Inheritance.ICAEncryptionStrength.ToString())); element.Add(new XAttribute("InheritRDPAuthenticationLevel", connectionInfo.Inheritance.RDPAuthenticationLevel.ToString())); element.Add(new XAttribute("InheritLoadBalanceInfo", connectionInfo.Inheritance.LoadBalanceInfo.ToString())); element.Add(new XAttribute("InheritPreExtApp", connectionInfo.Inheritance.PreExtApp.ToString())); element.Add(new XAttribute("InheritPostExtApp", connectionInfo.Inheritance.PostExtApp.ToString())); element.Add(new XAttribute("InheritMacAddress", connectionInfo.Inheritance.MacAddress.ToString())); element.Add(new XAttribute("InheritUserField", connectionInfo.Inheritance.UserField.ToString())); element.Add(new XAttribute("InheritExtApp", connectionInfo.Inheritance.ExtApp.ToString())); element.Add(new XAttribute("InheritVNCCompression", connectionInfo.Inheritance.VNCCompression.ToString())); element.Add(new XAttribute("InheritVNCEncoding", connectionInfo.Inheritance.VNCEncoding.ToString())); element.Add(new XAttribute("InheritVNCAuthMode", connectionInfo.Inheritance.VNCAuthMode.ToString())); element.Add(new XAttribute("InheritVNCProxyType", connectionInfo.Inheritance.VNCProxyType.ToString())); element.Add(new XAttribute("InheritVNCProxyIP", connectionInfo.Inheritance.VNCProxyIP.ToString())); element.Add(new XAttribute("InheritVNCProxyPort", connectionInfo.Inheritance.VNCProxyPort.ToString())); element.Add(new XAttribute("InheritVNCProxyUsername", connectionInfo.Inheritance.VNCProxyUsername.ToString())); element.Add(new XAttribute("InheritVNCProxyPassword", connectionInfo.Inheritance.VNCProxyPassword.ToString())); element.Add(new XAttribute("InheritVNCColors", connectionInfo.Inheritance.VNCColors.ToString())); element.Add(new XAttribute("InheritVNCSmartSizeMode", connectionInfo.Inheritance.VNCSmartSizeMode.ToString())); element.Add(new XAttribute("InheritVNCViewOnly", connectionInfo.Inheritance.VNCViewOnly.ToString())); element.Add(new XAttribute("InheritRDGatewayUsageMethod", connectionInfo.Inheritance.RDGatewayUsageMethod.ToString())); element.Add(new XAttribute("InheritRDGatewayHostname", connectionInfo.Inheritance.RDGatewayHostname.ToString())); element.Add(new XAttribute("InheritRDGatewayUseConnectionCredentials", connectionInfo.Inheritance.RDGatewayUseConnectionCredentials.ToString())); element.Add(new XAttribute("InheritRDGatewayUsername", connectionInfo.Inheritance.RDGatewayUsername.ToString())); element.Add(new XAttribute("InheritRDGatewayPassword", connectionInfo.Inheritance.RDGatewayPassword.ToString())); element.Add(new XAttribute("InheritRDGatewayDomain", connectionInfo.Inheritance.RDGatewayDomain.ToString())); } else { element.Add(new XAttribute("InheritCacheBitmaps", false.ToString())); element.Add(new XAttribute("InheritColors", false.ToString())); element.Add(new XAttribute("InheritDescription", false.ToString())); element.Add(new XAttribute("InheritDisplayThemes", false.ToString())); element.Add(new XAttribute("InheritDisplayWallpaper", false.ToString())); element.Add(new XAttribute("InheritEnableFontSmoothing", false.ToString())); element.Add(new XAttribute("InheritEnableDesktopComposition", false.ToString())); element.Add(new XAttribute("InheritDomain", false.ToString())); element.Add(new XAttribute("InheritIcon", false.ToString())); element.Add(new XAttribute("InheritPanel", false.ToString())); element.Add(new XAttribute("InheritPassword", false.ToString())); element.Add(new XAttribute("InheritPort", false.ToString())); element.Add(new XAttribute("InheritProtocol", false.ToString())); element.Add(new XAttribute("InheritPuttySession", false.ToString())); element.Add(new XAttribute("InheritRedirectDiskDrives", false.ToString())); element.Add(new XAttribute("InheritRedirectKeys", false.ToString())); element.Add(new XAttribute("InheritRedirectPorts", false.ToString())); element.Add(new XAttribute("InheritRedirectPrinters", false.ToString())); element.Add(new XAttribute("InheritRedirectSmartCards", false.ToString())); element.Add(new XAttribute("InheritRedirectSound", false.ToString())); element.Add(new XAttribute("InheritSoundQuality", false.ToString())); element.Add(new XAttribute("InheritResolution", false.ToString())); element.Add(new XAttribute("InheritAutomaticResize", false.ToString())); element.Add(new XAttribute("InheritUseConsoleSession", false.ToString())); element.Add(new XAttribute("InheritUseCredSsp", false.ToString())); element.Add(new XAttribute("InheritRenderingEngine", false.ToString())); element.Add(new XAttribute("InheritUsername", false.ToString())); element.Add(new XAttribute("InheritICAEncryptionStrength", false.ToString())); element.Add(new XAttribute("InheritRDPAuthenticationLevel", false.ToString())); element.Add(new XAttribute("InheritLoadBalanceInfo", false.ToString())); element.Add(new XAttribute("InheritPreExtApp", false.ToString())); element.Add(new XAttribute("InheritPostExtApp", false.ToString())); element.Add(new XAttribute("InheritMacAddress", false.ToString())); element.Add(new XAttribute("InheritUserField", false.ToString())); element.Add(new XAttribute("InheritExtApp", false.ToString())); element.Add(new XAttribute("InheritVNCCompression", false.ToString())); element.Add(new XAttribute("InheritVNCEncoding", false.ToString())); element.Add(new XAttribute("InheritVNCAuthMode", false.ToString())); element.Add(new XAttribute("InheritVNCProxyType", false.ToString())); element.Add(new XAttribute("InheritVNCProxyIP", false.ToString())); element.Add(new XAttribute("InheritVNCProxyPort", false.ToString())); element.Add(new XAttribute("InheritVNCProxyUsername", false.ToString())); element.Add(new XAttribute("InheritVNCProxyPassword", false.ToString())); element.Add(new XAttribute("InheritVNCColors", false.ToString())); element.Add(new XAttribute("InheritVNCSmartSizeMode", false.ToString())); element.Add(new XAttribute("InheritVNCViewOnly", false.ToString())); element.Add(new XAttribute("InheritRDGatewayUsageMethod", false.ToString())); element.Add(new XAttribute("InheritRDGatewayHostname", false.ToString())); element.Add(new XAttribute("InheritRDGatewayUseConnectionCredentials", false.ToString())); element.Add(new XAttribute("InheritRDGatewayUsername", false.ToString())); element.Add(new XAttribute("InheritRDGatewayPassword", false.ToString())); element.Add(new XAttribute("InheritRDGatewayDomain", false.ToString())); } }