コード例 #1
0
        public ServerBrowserForm()
        {
            InitializeComponent();

              this.InitGameInfoExtenders();
              this.queryLogic = new ServerQueryLogic(this.extenders);

              if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
            return;

              base.Text += " " + Version;

              this.iniFile = Path.Combine(Application.LocalUserAppDataPath, "ServerBrowser.ini");

              this.queryLogic.UpdateStatus += (s, e) => this.BeginInvoke((Action)(() => queryLogic_SetStatusMessage(s, e)));
              this.queryLogic.ServerListReceived += (s, e) => this.BeginInvoke((Action) queryLogic_ServerListReceived);
              this.queryLogic.ReloadServerListComplete += (s, e) => this.BeginInvoke((Action)(() => { queryLogic_ReloadServerListComplete(e.Rows); }));
              this.queryLogic.RefreshSingleServerComplete += (s, e) => this.BeginInvoke((Action)(() => { queryLogic_RefreshSingleServerComplete(e); }));

              // make the server list panel fill the remaining space (this can't be done in the Forms Designer)
              this.panelServerList.Parent.Controls.Remove(this.panelServerList);
              this.panelServerList.Dock = DockingStyle.Fill;
              this.Controls.Add(this.panelServerList);
              this.panelStaticList.Height = this.panelQuery.Height;
              UserLookAndFeel.Default.StyleChanged += LookAndFeel_StyleChanged;

              var vm = new TabViewModel();
              vm.Source = TabViewModel.SourceType.Favorites;
              this.tabFavorites.Tag = vm;
        }
コード例 #2
0
        public ServerBrowserForm()
        {
            // change font before InitializeComponent() for correct auto-scaling
              if (Properties.Settings.Default.FontSizeDelta != 0)
              {
            AppearanceObject.DefaultFont = new Font(
              Properties.Settings.Default.FontName,
              AppearanceObject.DefaultFont.Size + Properties.Settings.Default.FontSizeDelta);
              }

              InitializeComponent();
              this.favGameRadioButtons = new[] {rbFavGame1, rbFavGame2, rbFavGame3};
              // ReSharper disable AssignNullToNotNullAttribute
              this.Icon = new Icon(this.GetType().Assembly.GetManifestResourceStream("ServerBrowser.rocket.ico"));
              // ReSharper restore AssignNullToNotNullAttribute

              // make the server list panel fill the remaining space (this can't be done in the Forms Designer)
              this.panelServerList.Parent.Controls.Remove(this.panelServerList);
              this.panelServerList.Dock = DockingStyle.Fill;
              this.Controls.Add(this.panelServerList);

              UserLookAndFeel.Default.StyleChanged += LookAndFeel_StyleChanged;

              base.Text += " " + Version;

              this.queryLogic = new ServerQueryLogic();
              this.queryLogic.UpdateStatus += (s, e) => this.BeginInvoke((Action)(() => { this.txtStatus.Text = e.Text; }));
              this.queryLogic.ReloadServerListComplete += (s,e) => this.BeginInvoke((Action)(() => { queryLogic_ReloadServerListComplete(e.Rows); }));
              this.queryLogic.RefreshSingleServerComplete += (s, e) => this.BeginInvoke((Action) (() => { queryLogic_RefreshSingleServerComplete(e); }));
        }