当前位置: 首页>>代码示例>>C#>>正文


C# FavoriteConfigurationElement类代码示例

本文整理汇总了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;
        }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:26,代码来源:PuttyFavoritePanel.cs

示例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;
        }
开发者ID:gabrewer,项目名称:Terminals,代码行数:27,代码来源:CredentialPanel.cs

示例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;
        }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:28,代码来源:PuttyFavoritePanel.cs

示例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;
 }
开发者ID:oo00spy00oo,项目名称:SharedTerminals,代码行数:7,代码来源:SshOptions.cs

示例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;
 }
开发者ID:DefStevo,项目名称:defstevo-collection,代码行数:35,代码来源:ConnectionManager.cs

示例6: CheckForTerminalServer

 public void CheckForTerminalServer(FavoriteConfigurationElement Fav)
 {
     if(Fav.Protocol == "RDP") {
         System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(CheckForTS), (object)Fav);
     }
     isTerminalServer = false;
 }
开发者ID:DefStevo,项目名称:defstevo-collection,代码行数:7,代码来源:Connection.cs

示例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;
 }
开发者ID:oo00spy00oo,项目名称:SharedTerminals,代码行数:7,代码来源:SshOptions.cs

示例8: SaveDefaultFavorite

 internal void SaveDefaultFavorite(FavoriteConfigurationElement favorite)
 {
     FavoriteConfigurationElementCollection defaultFav = GetSection().DefaultFavorite;
     defaultFav.Clear();
     defaultFav.Add(favorite);
     SaveImmediatelyIfRequested();
 }
开发者ID:oo00spy00oo,项目名称:SharedTerminals,代码行数:7,代码来源:Settings_Favorites.cs

示例9: AddImportSuffixToFavorite

 private void AddImportSuffixToFavorite(FavoriteConfigurationElement favoriteToRename,
                                        FavoriteConfigurationElementCollection savedFavorites)
 {
     favoriteToRename.Name += importSuffix;
     if (savedFavorites[favoriteToRename.Name] != null)
         this.AddImportSuffixToFavorite(favoriteToRename, savedFavorites);
 }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:7,代码来源:ImportWithDialogs.cs

示例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); }
        }
开发者ID:DefStevo,项目名称:defstevo-collection,代码行数:33,代码来源:AddExistingRDPConnections.cs

示例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;
        }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:26,代码来源:FavoritesFactory.cs

示例12: FillControls

 public override void FillControls(FavoriteConfigurationElement favorite)
 {
     tinyMce.Text = favorite.TinyMceText();
     chkShowTinyMceInConnectionMode.Checked = favorite.ShowTinyMceInConnectionMode();
     tinyMce.IsTextEditable = chkShowTinyMceInEditMode.Checked = favorite.ShowTinyMceInEditMode();
     tinyMce.Render();
 }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:7,代码来源:TextFavoritePanel.cs

示例13: FillFavorite

        public override void FillFavorite(FavoriteConfigurationElement favorite)
        {
            favorite.GenericArguments = this.txtGenericArguments.Text;
            favorite.GenericProgramPath = this.txtGenericExecutablePath.Text;
            favorite.GenericWorkingDirectory = this.txtGenericWorkingDirectory.Text;

            //SetIcon();
        }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:8,代码来源:GenericFavoritePanel.cs

示例14: FillControls

        public override void FillControls(FavoriteConfigurationElement favorite)
        {
            this.txtGenericArguments.Text = favorite.GenericArguments;
            this.txtGenericExecutablePath.Text = favorite.GenericProgramPath;
            this.txtGenericWorkingDirectory.Text = favorite.GenericWorkingDirectory;

            //SetIcon();
        }
开发者ID:RSchwoerer,项目名称:Terminals,代码行数:8,代码来源:GenericFavoritePanel.cs

示例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;
 }
开发者ID:oo00spy00oo,项目名称:SharedTerminals,代码行数:8,代码来源:ModelConverterV1ToV2.cs


注:本文中的FavoriteConfigurationElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。