本文整理汇总了C#中FavoriteConfigurationElement类的典型用法代码示例。如果您正苦于以下问题:C# FavoriteConfigurationElement类的具体用法?C# FavoriteConfigurationElement怎么用?C# FavoriteConfigurationElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FavoriteConfigurationElement类属于命名空间,在下文中一共展示了FavoriteConfigurationElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillFavorite
public override void FillFavorite(FavoriteConfigurationElement favorite)
{
favorite.PuttyConnectionType =
(PuttyConnectionType) Enum.Parse(typeof (PuttyConnectionType), this.cmbPuttyProtocol.Text, true);
favorite.PuttySession = this.cmbPuttySession.Text;
favorite.PuttyCloseWindowOnExit =
(PuttyCloseWindowOnExit)
Enum.Parse(typeof (PuttyCloseWindowOnExit), this.cmbPuttyCloseWindowOnExit.Text, true);
favorite.PuttyCompression = this.chkPuttyCompress.Checked;
favorite.PuttyVerbose = this.chkPuttyVerbose.Checked;
favorite.PuttyShowOptions = this.chkPuttyShowOptions.Checked;
favorite.PuttyPasswordTimeout = (int) this.nudPuttyPasswordTimeout.Value;
favorite.PuttyProxyType =
(PuttyProxyType)
Enum.Parse(typeof (PuttyProxyType), this.cmbProxyType.Text, true);
favorite.PuttyProxyHost = txtProxyHost.Text;
favorite.PuttyProxyPort = (int)nudProxyPort.Value;
favorite.PuttyEnableX11 = this.chkPuttyEnableX11.Checked;
favorite.PuttyDontAddDomainToUserName = this.chkPuttyDontAddDomainToUserName.Checked;
}
示例2: FillControls
public override void FillControls(FavoriteConfigurationElement favorite)
{
this.cmbDomains.Text = favorite.Credential.DomainName;
this.cmbUsers.Text = favorite.Credential.UserName;
if (!favorite.Credential.IsSetPassword && favorite.Credential.IsSetEncryptedPassword)
{
MessageBox.Show("There was an issue decrypting your password.\n\nPlease provide a new password and save the favorite.", AssemblyInfo.Title, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.txtPassword.Text = "";
this.FavoritePassword = "";
this.txtPassword.Focus();
favorite.Password = "";
}
if (favorite.Credential.IsSetPassword)
{
this.txtPassword.Text = HIDDEN_PASSWORD;
this.chkSavePassword.Checked = true;
}
else
{
this.txtPassword.Text = String.Empty;
this.chkSavePassword.Checked = false;
}
this.FavoritePassword = favorite.Credential.Password;
}
示例3: FillControls
public override void FillControls(FavoriteConfigurationElement favorite)
{
this.cmbPuttyProtocol.Text = Enum.GetName(typeof (PuttyConnectionType), favorite.PuttyConnectionType);
if (!string.IsNullOrEmpty(favorite.PuttySession))
{
if (this.cmbPuttySession.Items.Contains(favorite.PuttySession))
{
this.cmbPuttySession.SelectedText = favorite.PuttySession;
}
}
this.cmbPuttyCloseWindowOnExit.Text = Enum.GetName(typeof (PuttyCloseWindowOnExit),
favorite.PuttyCloseWindowOnExit);
this.chkPuttyCompress.Checked = favorite.PuttyCompression;
this.chkPuttyVerbose.Checked = favorite.PuttyVerbose;
this.chkPuttyShowOptions.Checked = favorite.PuttyShowOptions;
this.nudPuttyPasswordTimeout.Value = favorite.PuttyPasswordTimeout;
this.cmbProxyType.Text = Enum.GetName(typeof (PuttyProxyType), favorite.PuttyProxyType);
this.txtProxyHost.Text = favorite.PuttyProxyHost;
this.nudProxyPort.Value = favorite.PuttyProxyPort;
this.chkPuttyEnableX11.Checked = favorite.PuttyEnableX11;
this.chkPuttyDontAddDomainToUserName.Checked = favorite.PuttyDontAddDomainToUserName;
}
示例4: ToConfigFavorite
internal override void ToConfigFavorite(IFavorite source, FavoriteConfigurationElement destination)
{
destination.SSH1 = this.SSH1;
destination.AuthMethod = this.AuthMethod;
destination.KeyTag = this.CertificateKey;
destination.SSHKeyFile = this.SSHKeyFile;
}
示例5: CreateConnection
public static IConnection CreateConnection(FavoriteConfigurationElement Favorite, TerminalTabControlItem TerminalTabPage, MainForm parentForm)
{
IConnection conn = null; ;
switch (Favorite.Protocol) {
case "VNC":
conn = new VNCConnection();
break;
case "VMRC":
conn = new VMRCConnection();
break;
case "RAS":
conn = new RASConnection();
break;
case "Telnet":
conn = new TerminalConnection();
break;
case "ICA Citrix":
conn = new ICAConnection();
break;
case "HTTP":
conn = new HTTPConnection();
break;
case "HTTPS":
conn = new HTTPConnection();
break;
default:
conn = new RDPConnection();
break;
}
conn.Favorite = Favorite;
TerminalTabPage.Connection = conn;
conn.TerminalTabPage = TerminalTabPage;
conn.ParentForm = parentForm;
return conn;
}
示例6: CheckForTerminalServer
public void CheckForTerminalServer(FavoriteConfigurationElement Fav)
{
if(Fav.Protocol == "RDP") {
System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(CheckForTS), (object)Fav);
}
isTerminalServer = false;
}
示例7: FromCofigFavorite
internal override void FromCofigFavorite(IFavorite destination, FavoriteConfigurationElement source)
{
this.SSH1 = source.SSH1;
this.AuthMethod = source.AuthMethod;
this.CertificateKey = source.KeyTag;
this.SSHKeyFile = source.SSHKeyFile;
}
示例8: SaveDefaultFavorite
internal void SaveDefaultFavorite(FavoriteConfigurationElement favorite)
{
FavoriteConfigurationElementCollection defaultFav = GetSection().DefaultFavorite;
defaultFav.Clear();
defaultFav.Add(favorite);
SaveImmediatelyIfRequested();
}
示例9: AddImportSuffixToFavorite
private void AddImportSuffixToFavorite(FavoriteConfigurationElement favoriteToRename,
FavoriteConfigurationElementCollection savedFavorites)
{
favoriteToRename.Name += importSuffix;
if (savedFavorites[favoriteToRename.Name] != null)
this.AddImportSuffixToFavorite(favoriteToRename, savedFavorites);
}
示例10: AddFavorite
public void AddFavorite(string server, string name, int Port)
{
try {
FavoriteConfigurationElement elm = new FavoriteConfigurationElement();
try {
System.Net.IPAddress address;
if(System.Net.IPAddress.TryParse(server, out address)) {
name = System.Net.Dns.GetHostByAddress(address).HostName;
}
name = string.Format("{0}_{1}", name, Terminals.Connections.ConnectionManager.GetPortName(Port, true));
} catch(Exception exc) {
//lets not log dns lookups!
//Terminals.Logging.Log.Info("", exc);
}
elm.Name = name;
elm.ServerName = server;
elm.UserName = System.Environment.UserName;
if(System.Environment.UserDomainName != System.Environment.MachineName) {
elm.DomainName = System.Environment.UserDomainName;
} else {
elm.DomainName = server;
}
elm.Tags = "Discovered Connections";
elm.Port = Port;
elm.Protocol = Terminals.Connections.ConnectionManager.GetPortName(Port, true);
lock(DiscoFavs) {
DiscoFavs.Add(elm);
}
//if(this.IsHandleCreated) this.Invoke(miv);
} catch(Exception e) { Terminals.Logging.Log.Info("", e); }
}
示例11: GetOrCreateQuickConnectFavorite
public static FavoriteConfigurationElement GetOrCreateQuickConnectFavorite(String server,
Boolean ConnectToConsole, Int32 port,
string protocol, string url, bool isDatabaseFavorite)
{
FavoriteConfigurationElementCollection favorites = Settings.GetFavorites(isDatabaseFavorite);
FavoriteConfigurationElement favorite = favorites[server];
if (favorite != null)
{
favorite.ConnectToConsole = ConnectToConsole;
}
else //create a temporaty favorite and connect to it
{
favorite = new FavoriteConfigurationElement();
favorite.ConnectToConsole = ConnectToConsole;
favorite.ServerName = server;
favorite.Name = server;
favorite.Protocol = protocol;
if (!string.IsNullOrEmpty(url))
favorite.Url = url;
if (port != 0)
favorite.Port = port;
}
return favorite;
}
示例12: FillControls
public override void FillControls(FavoriteConfigurationElement favorite)
{
tinyMce.Text = favorite.TinyMceText();
chkShowTinyMceInConnectionMode.Checked = favorite.ShowTinyMceInConnectionMode();
tinyMce.IsTextEditable = chkShowTinyMceInEditMode.Checked = favorite.ShowTinyMceInEditMode();
tinyMce.Render();
}
示例13: FillFavorite
public override void FillFavorite(FavoriteConfigurationElement favorite)
{
favorite.GenericArguments = this.txtGenericArguments.Text;
favorite.GenericProgramPath = this.txtGenericExecutablePath.Text;
favorite.GenericWorkingDirectory = this.txtGenericWorkingDirectory.Text;
//SetIcon();
}
示例14: FillControls
public override void FillControls(FavoriteConfigurationElement favorite)
{
this.txtGenericArguments.Text = favorite.GenericArguments;
this.txtGenericExecutablePath.Text = favorite.GenericProgramPath;
this.txtGenericWorkingDirectory.Text = favorite.GenericWorkingDirectory;
//SetIcon();
}
示例15: ConvertDisplay
private static void ConvertDisplay(IFavorite result, FavoriteConfigurationElement sourceFavorite)
{
IDisplayOptions display = result.Display;
display.Colors = sourceFavorite.Colors;
display.DesktopSize = sourceFavorite.DesktopSize;
display.Width = sourceFavorite.DesktopSizeWidth;
display.Height = sourceFavorite.DesktopSizeHeight;
}