Example #1
0
 private void InitializeFonts()
 {
     //Load Fonts
     _titleFont    = new Killer1.Font(_textureManager.Get("title_font"), FontParser.Parse("Assets/title_font.fnt"));
     _generalFont  = new Killer1.Font(_textureManager.Get("general_font"), FontParser.Parse("Assets/general_font.fnt"));
     _computerFont = new Killer1.Font(_textureManager.Get("computer_font2"), FontParser.Parse("Assets/computer_font2.fnt"));
 }
Example #2
0
        private void InitializeFonts()
        {
            // Fonts are loaded here.

            _titleFont   = FontParser.CreateFont("title_font.fnt", _textureManager);
            _generalFont = FontParser.CreateFont("general_font.fnt", _textureManager);
        }
Example #3
0
        private void InitializeFonts()
        {
            // Fonts are loaded here.
            _titleFont = new Engine.Font(_textureManager.Get("title_font"),
                                         FontParser.Parse("title_font.fnt"));

            _generalFont = new Engine.Font(_textureManager.Get("general_font"),
                                           FontParser.Parse("general_font.fnt"));
        }
Example #4
0
 private void InitializeFonts()
 {
     // Fonts are loaded here
     _font = new PotatoEngine.Font(_textureManager.Get("font"),
                                   FontParser.Parse("Assets/Textures/Fonts/font.fnt"));
     _titleFont = new PotatoEngine.Font(_textureManager.Get("title_font"),
                                        FontParser.Parse("Assets/Textures/Fonts/title_font.fnt"));
     _generalFont = new PotatoEngine.Font(_textureManager.Get("general_font"),
                                          FontParser.Parse("Assets/Textures/Fonts/general_font.fnt"));
 }
Example #5
0
        private void FontButton_Click(object sender, EventArgs e)
        {
            this.fontDialog1.Font = FontParser.FromString(this.FontTextbox.Text);
            DialogResult result = this.fontDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                this.FontTextbox.Text = FontParser.ToString(this.fontDialog1.Font);
            }
        }
Example #6
0
        private void InitializeFonts()
        {
            //Fonts are loaded here
            _fontManager.LoadFont("general_font",
                                  new ValueEngine.Font(_textureManager.Get("general_font"),
                                                       FontParser.Parse("Assets/Fonts/general_font.fnt")));


            _fontManager.LoadFont("title_font",
                                  new ValueEngine.Font(_textureManager.Get("title_font"),
                                                       FontParser.Parse("Assets/Fonts/title_font.fnt")));
        }
Example #7
0
        public override Boolean Connect()
        {
            String protocol = "unknown";

            try
            {
                Logging.Info(String.Format("Connecting to a {0} Connection", Favorite.Protocol));
                term = new TerminalEmulator();

                Controls.Add(term);
                term.BringToFront();
                this.BringToFront();

                term.Parent = this.Parent;
                term.Dock   = System.Windows.Forms.DockStyle.Fill;

                ConsoleOptions consoleOptions = this.GetConsoleOptionsFromFavorite();
                AssignTerminalCollors(consoleOptions);
                term.Font    = FontParser.FromString(consoleOptions.Font);
                term.Rows    = consoleOptions.Rows;
                term.Columns = consoleOptions.Columns;

                this.client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                this.client.Connect(Favorite.ServerName, Favorite.Port);

                IGuardedSecurity security = this.ResolveFavoriteCredentials();
                switch (Favorite.Protocol)
                {
                case TelnetConnectionPlugin.TELNET:
                {
                    protocol = ConfigureTelnetConnection(security);
                }
                break;

                case SshConnectionPlugin.SSH:
                {
                    protocol = ConfigureSshConnection(security);
                }
                break;
                }

                this.term.Focus();
                return(true);
            }
            catch (Exception exc)
            {
                Logging.Fatal(String.Format("Connecting to {0} Connection", protocol), exc);
                LastError = exc.Message;
                return(false);
            }
        }
Example #8
0
        public FavoritesTreeView()
        {
            // This prevents SharpDevelop and Visual Studio from both an exception in design mode for controls using this HistoryTreeView and from crashing when opening the
            // designer for this class.
            if (LicenseManager.UsageMode == LicenseUsageMode.Runtime)
            {
                this.ImageList          = ConnectionImageHandler.GetProtocolImageList();
                this.ImageIndex         = 0;
                this.LineColor          = Color.Black;
                this.SelectedImageIndex = 0;
                this.ShowNodeToolTips   = true;
                this.AfterExpand       += this.OnTreeViewExpand;

                this.ImageList.ImageSize = new Size(Settings.FavoritesImageWidth, Settings.FavoritesImageHeight);
                this.ImageList           = ConnectionImageHandler.GetProtocolImageList();
                this.ImageList.ImageSize = new Size(Settings.FavoritesImageWidth, Settings.FavoritesImageHeight);
                this.Font      = FontParser.FromString(Settings.FavoritesFont);
                this.BackColor = ColorParser.FromString(Settings.FavoritesFontBackColor);
                this.ForeColor = ColorParser.FromString(Settings.FavoritesFontForeColor);

                this.loader = new TreeListLoader(this);
            }
        }
Example #9
0
        public DBTreeView()
        {
            this.ImageList = new ImageList();

            if (LicenseManager.UsageMode == LicenseUsageMode.Runtime)
            {
                this.ImageList          = ConnectionImageHandler.GetProtocolImageList();
                this.ImageIndex         = 0;
                this.LineColor          = Color.Black;
                this.SelectedImageIndex = 0;
                this.ShowNodeToolTips   = true;
                this.AfterExpand       += this.OnTreeViewExpand;

                this.ImageList.ImageSize = new Size(Settings.FavoritesImageWidth, Settings.FavoritesImageHeight);
                this.ImageList           = ConnectionImageHandler.GetProtocolImageList();
                this.ImageList.ImageSize = new Size(Settings.FavoritesImageWidth, Settings.FavoritesImageHeight);
                this.Font      = FontParser.FromString(Settings.FavoritesFont);
                this.BackColor = ColorParser.FromString(Settings.FavoritesFontBackColor);
                this.ForeColor = ColorParser.FromString(Settings.FavoritesFontForeColor);

                this.loader = new TreeListLoader(this);
            }
        }
 public TextTestState(TextureManager textureManager)
 {
     _textureManager = textureManager;
     _font           = new Font(textureManager.Get("font"), FontParser.Parse("Fonts/Arial/font.fnt"));
     _hellowWorld    = new Text("Hello", _font);
 }
Example #11
0
        /// <summary>
        /// 初始化字体
        /// </summary>
        private void InitializeFonts()
        {
            _titleFont = new Engine.Font(_textureManager.Get("chinese_font"), FontParser.Parse("chinese_font.fnt", 2));

            _generalFont = new Engine.Font(_textureManager.Get("chinese_yy"), FontParser.Parse("chinese_yy.fnt", 1));
        }
Example #12
0
        public override Boolean Connect()
        {
            this.connected = false;

            String protocol = "unknown";

            try
            {
                if (typeof(TerminalConnection).IsEqual(this.Favorite.Protocol))
                {
                    protocol = typeof(TerminalConnection).GetProtocolName();
                }
                else
                {
                    protocol = (this.Favorite.Ssh1) ? "SSH1" : "SSH2";
                }

                this.InvokeIfNecessary(delegate { this.term = new TerminalEmulator(); });

                this.Embed(this.term);

                this.term.BackColor  = FavoriteConfigurationElement.TranslateColor(this.Favorite.ConsoleBackColor);
                this.term.ForeColor  = FavoriteConfigurationElement.TranslateColor(this.Favorite.ConsoleTextColor);
                this.term.BlinkColor = this.term.CursorColor = FavoriteConfigurationElement.TranslateColor(this.Favorite.ConsoleCursorColor);

                if (this.term.InvokeRequired)
                {
                    this.term.Invoke(new MethodInvoker(delegate { this.term.Font = FontParser.FromString(this.Favorite.ConsoleFont); }));
                }
                else
                {
                    this.term.Font = FontParser.FromString(this.Favorite.ConsoleFont);
                }

                this.term.Rows    = this.Favorite.ConsoleRows;
                this.term.Columns = this.Favorite.ConsoleCols;

                this.client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                this.client.Connect(this.Favorite.ServerName, this.Favorite.Port);

                if (!this.Favorite.Credential.IsSetUserName || !this.Favorite.Credential.IsSetPassword)
                {
                    Log.Fatal(string.Format("Please set user name and password in your {0} connection properties.", this.Favorite.Protocol.ToLower()));
                    return(false);
                }

                if (typeof(TerminalConnection).IsEqual(this.Favorite.Protocol))
                {
                    this.ConfigureTelnetConnection(this.Favorite.Credential.UserName, this.Favorite.Credential.Password);
                }
                else
                {
                    this.ConfigureSshConnection(this.Favorite.Credential.UserName, this.Favorite.Credential.Password);
                }

                if (this.term.InvokeRequired)
                {
                    this.term.Invoke(new MethodInvoker(delegate { this.term.Focus(); }));
                }
                else
                {
                    this.term.Focus();
                }

                return(this.connected = true);
            }
            catch (Exception exc)
            {
                Log.Fatal(string.Format("Terminals was unable to create the {0} connection.", protocol), exc);
                return(this.connected = false);
            }
        }
 public SwirlEffectState(TextureManager manager)
 {
     _font = new Font(manager.Get("font"), FontParser.Parse("font.fnt"));
     _text = new Text("Hello", _font);
 }
Example #14
0
 public FPSTestState(TextureManager textureManager)
 {
     _textureManager = textureManager;
     _font           = new Font(textureManager.Get("font"), FontParser.Parse("Fonts/Arial/font.fnt"));
     _fpsText        = new Text("FPS:", _font);
 }
        public override bool Connect()
        {
            try
            {
                Terminals.Logging.Log.Info("Connecting to a Telnet/SSH Connection");
                term = new WalburySoftware.TerminalEmulator();

                Controls.Add(term);
                term.BringToFront();
                this.BringToFront();

                term.Parent = base.TerminalTabPage;
                this.Parent = TerminalTabPage;
                term.Dock   = DockStyle.Fill;

                term.OnDisconnected += new WalburySoftware.TerminalEmulator.Disconnected(term_OnDisconnected);

                term.BackColor = Color.FromName(Favorite.TelnetBackColor);
                term.Font      = FontParser.ParseFontName(Favorite.TelnetFont);
                term.ForeColor = Color.FromName(Favorite.TelnetTextColor);

                string domainName = Favorite.DomainName;
                if (domainName == null || domainName == "")
                {
                    domainName = Settings.DefaultDomain;
                }
                string pass = Favorite.Password;
                if (pass == null || pass == "")
                {
                    pass = Settings.DefaultPassword;
                }
                string userName = Favorite.UserName;
                if (userName == null || userName == "")
                {
                    userName = Settings.DefaultUsername;
                }


                if (userName != null && userName != "")
                {
                    term.Username = userName;
                }
                if (pass != null && pass != "")
                {
                    term.Password = pass;
                }

                if (term.Username == null || term.Username == "" || term.Password == null || term.Password == "")
                {
                    Terminals.InputBoxResult result = Terminals.InputBox.Show("Please provide your User name", "Telnet/SSH User name");
                    if (result.ReturnCode == DialogResult.OK && result.Text != null && result.Text.Trim() != "")
                    {
                        term.Username = result.Text;
                        if (term.Password == null)
                        {
                            Terminals.InputBoxResult res = Terminals.InputBox.Show("Please provide your Password", "Telnet/SSH Password", '*');
                            if (res.ReturnCode == DialogResult.OK && res.Text != null && res.Text.Trim() != "")
                            {
                                term.Password = res.Text;
                            }
                        }
                    }
                }

                bool ForceClose = true;

                if (term.Username != null && term.Username != "" && term.Password != null && term.Password != "")
                {
                    ForceClose = false;
                }


                if (ForceClose)
                {
                    this.ParentForm.tcTerminals.ForceCloseTab(this.TerminalTabPage);
                    connected = false;
                    return(false);
                }
                else
                {
                    term.Hostname = Favorite.ServerName;
                    //term.Port = Favorite.Port;
                    term.Rows    = Favorite.TelnetRows;
                    term.Columns = Favorite.TelnetCols;

                    if (Favorite.Telnet)
                    {
                        term.ConnectionType = WalburySoftware.TerminalEmulator.ConnectionTypes.Telnet;
                    }
                    else
                    {
                        term.ConnectionType = WalburySoftware.TerminalEmulator.ConnectionTypes.SSH2;
                    }

                    Text = "Connecting to Telnet/SSH Server...";
                    term.Connect();
                    connected = true;
                    return(true);
                }
            }
            catch (Exception exc)
            {
                Terminals.Logging.Log.Fatal("Connecting to Telnet/SSH Connection", exc);
                return(false);
            }
        }