本文整理汇总了C#中ConnectionInfo.GetTreeNodeType方法的典型用法代码示例。如果您正苦于以下问题:C# ConnectionInfo.GetTreeNodeType方法的具体用法?C# ConnectionInfo.GetTreeNodeType怎么用?C# ConnectionInfo.GetTreeNodeType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConnectionInfo
的用法示例。
在下文中一共展示了ConnectionInfo.GetTreeNodeType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMenuItem
private ToolStripDropDownItem CreateMenuItem(ConnectionInfo node)
{
var menuItem = new ToolStripMenuItem
{
Text = node.Name,
Tag = node
};
var nodeAsContainer = node as ContainerInfo;
if (nodeAsContainer != null)
{
menuItem.Image = Resources.Folder;
menuItem.Tag = nodeAsContainer;
AddSubMenuNodes(nodeAsContainer.Children, menuItem);
}
else if (node.GetTreeNodeType() == TreeNodeType.PuttySession)
{
menuItem.Image = Resources.PuttySessions;
menuItem.Tag = node;
}
else if (node.GetTreeNodeType() == TreeNodeType.Connection)
{
menuItem.Image = Resources.Pause;
menuItem.Tag = node;
}
menuItem.MouseUp += MouseUpEventHandler;
return menuItem;
}
示例2: SetElementAttributes
private void SetElementAttributes(XContainer element, ConnectionInfo connectionInfo)
{
var nodeAsContainer = connectionInfo as ContainerInfo;
element.Add(new XAttribute("Name", connectionInfo.Name));
element.Add(new XAttribute("Type", connectionInfo.GetTreeNodeType().ToString()));
if (nodeAsContainer != null)
element.Add(new XAttribute("Expanded", nodeAsContainer.IsExpanded.ToString()));
element.Add(new XAttribute("Descr", connectionInfo.Description));
element.Add(new XAttribute("Icon", connectionInfo.Icon));
element.Add(new XAttribute("Panel", connectionInfo.Panel));
element.Add(_saveFilter.SaveUsername
? new XAttribute("Username", connectionInfo.Username)
: new XAttribute("Username", ""));
element.Add(_saveFilter.SaveDomain
? new XAttribute("Domain", connectionInfo.Domain)
: new XAttribute("Domain", ""));
if (_saveFilter.SavePassword && !connectionInfo.Inheritance.Password)
element.Add(new XAttribute("Password", _cryptographyProvider.Encrypt(connectionInfo.Password, _encryptionKey)));
else
element.Add(new XAttribute("Password", ""));
element.Add(new XAttribute("Hostname", connectionInfo.Hostname));
element.Add(new XAttribute("Protocol", connectionInfo.Protocol));
element.Add(new XAttribute("PuttySession", connectionInfo.PuttySession));
element.Add(new XAttribute("Port", connectionInfo.Port));
element.Add(new XAttribute("ConnectToConsole", connectionInfo.UseConsoleSession.ToString()));
element.Add(new XAttribute("UseCredSsp", connectionInfo.UseCredSsp.ToString()));
element.Add(new XAttribute("RenderingEngine", connectionInfo.RenderingEngine));
element.Add(new XAttribute("ICAEncryptionStrength", connectionInfo.ICAEncryptionStrength));
element.Add(new XAttribute("RDPAuthenticationLevel", connectionInfo.RDPAuthenticationLevel));
element.Add(new XAttribute("LoadBalanceInfo", connectionInfo.LoadBalanceInfo));
element.Add(new XAttribute("Colors", connectionInfo.Colors));
element.Add(new XAttribute("Resolution", connectionInfo.Resolution));
element.Add(new XAttribute("AutomaticResize", connectionInfo.AutomaticResize.ToString()));
element.Add(new XAttribute("DisplayWallpaper", connectionInfo.DisplayWallpaper.ToString()));
element.Add(new XAttribute("DisplayThemes", connectionInfo.DisplayThemes.ToString()));
element.Add(new XAttribute("EnableFontSmoothing", connectionInfo.EnableFontSmoothing.ToString()));
element.Add(new XAttribute("EnableDesktopComposition", connectionInfo.EnableDesktopComposition.ToString()));
element.Add(new XAttribute("CacheBitmaps", connectionInfo.CacheBitmaps.ToString()));
element.Add(new XAttribute("RedirectDiskDrives", connectionInfo.RedirectDiskDrives.ToString()));
element.Add(new XAttribute("RedirectPorts", connectionInfo.RedirectPorts.ToString()));
element.Add(new XAttribute("RedirectPrinters", connectionInfo.RedirectPrinters.ToString()));
element.Add(new XAttribute("RedirectSmartCards", connectionInfo.RedirectSmartCards.ToString()));
element.Add(new XAttribute("RedirectSound", connectionInfo.RedirectSound.ToString()));
element.Add(new XAttribute("SoundQuality", connectionInfo.SoundQuality.ToString()));
element.Add(new XAttribute("RedirectKeys", connectionInfo.RedirectKeys.ToString()));
element.Add(new XAttribute("Connected", (connectionInfo.OpenConnections.Count > 0).ToString()));
element.Add(new XAttribute("PreExtApp", connectionInfo.PreExtApp));
element.Add(new XAttribute("PostExtApp", connectionInfo.PostExtApp));
element.Add(new XAttribute("MacAddress", connectionInfo.MacAddress));
element.Add(new XAttribute("UserField", connectionInfo.UserField));
element.Add(new XAttribute("ExtApp", connectionInfo.ExtApp));
element.Add(new XAttribute("VNCCompression", connectionInfo.VNCCompression));
element.Add(new XAttribute("VNCEncoding", connectionInfo.VNCEncoding));
element.Add(new XAttribute("VNCAuthMode", connectionInfo.VNCAuthMode));
element.Add(new XAttribute("VNCProxyType", connectionInfo.VNCProxyType));
element.Add(new XAttribute("VNCProxyIP", connectionInfo.VNCProxyIP));
element.Add(new XAttribute("VNCProxyPort", connectionInfo.VNCProxyPort));
element.Add(_saveFilter.SaveUsername
? new XAttribute("VNCProxyUsername", connectionInfo.VNCProxyUsername)
: new XAttribute("VNCProxyUsername", ""));
element.Add(_saveFilter.SavePassword
? new XAttribute("VNCProxyPassword",
_cryptographyProvider.Encrypt(connectionInfo.VNCProxyPassword, _encryptionKey))
: new XAttribute("VNCProxyPassword", ""));
element.Add(new XAttribute("VNCColors", connectionInfo.VNCColors));
element.Add(new XAttribute("VNCSmartSizeMode", connectionInfo.VNCSmartSizeMode));
element.Add(new XAttribute("VNCViewOnly", connectionInfo.VNCViewOnly.ToString()));
element.Add(new XAttribute("RDGatewayUsageMethod", connectionInfo.RDGatewayUsageMethod));
element.Add(new XAttribute("RDGatewayHostname", connectionInfo.RDGatewayHostname));
element.Add(new XAttribute("RDGatewayUseConnectionCredentials", connectionInfo.RDGatewayUseConnectionCredentials));
element.Add(_saveFilter.SaveUsername
? new XAttribute("RDGatewayUsername", connectionInfo.RDGatewayUsername)
: new XAttribute("RDGatewayUsername", ""));
element.Add(_saveFilter.SavePassword
? new XAttribute("RDGatewayPassword",
_cryptographyProvider.Encrypt(connectionInfo.RDGatewayPassword, _encryptionKey))
: new XAttribute("RDGatewayPassword", ""));
element.Add(_saveFilter.SaveDomain
? new XAttribute("RDGatewayDomain", connectionInfo.RDGatewayDomain)
: new XAttribute("RDGatewayDomain", ""));
}