Exemple #1
0
        public MainForm()
        {
            InitializeComponent();
            AdjustTabs();
            SetTooltips();
            // hide tabs at start
            tabMC.TabPages.Remove( tabMCServers );
            tabCC.TabPages.Remove( tabCCServers );
            Shown += DisplayResourcesDialog;

            mc = new GameState() { Progress = prgMCStatus, Status = lblMCStatus,
                Username = txtMCUser, Password = txtMCPassword, HostServer = "minecraft.net",
                Session = new MinecraftSession(), SignInButton = btnMCSignIn, Tab = tabMC,
                ServersTab = tabMCServers, ServersTable = tblMCServers, Hash = txtMCHash,
                form = this };
            cc = new GameState() { Progress = prgCCStatus, Status = lblCCStatus,
                Username = txtCCUser, Password = txtCCPassword, HostServer = "classicube.net",
                Session = new ClassicubeSession(), SignInButton = btnCCSignIn, Tab = tabCC,
                ServersTab = tabCCServers, ServersTable = tblCCServers, Hash = txtCCHash,
                form = this };

            mc.Filter = e =>
                // NOTE: using ToLower().Contains() allocates too many unecessary strings.
                e.Name.IndexOf( txtMCSearch.Text, StringComparison.OrdinalIgnoreCase ) >= 0
                && ( cbMCHideEmpty.Checked ? e.Players[0] != '0' : true )
                && ( cbMCHideInvalid.Checked ? Int32.Parse( e.Players ) < 600 : true );
            cc.Filter = e =>
                e.Name.IndexOf( txtCCSearch.Text, StringComparison.OrdinalIgnoreCase ) >= 0
                && ( cbCCHideEmpty.Checked ? e.Players[0] != '0' : true );
            KeyPreview = true;
            KeyDown += KeyDownHandler;
        }
Exemple #2
0
        public MainForm()
        {
            InitializeComponent();
            AdjustTabs();
            // hide tabs at start
            tabCC.TabPages.Remove( tabCCServers );
            Shown += DisplayResourcesDialog;

            cc = new GameState() { Progress = prgCCStatus, Status = lblCCStatus,
                Username = txtCCUser, Password = txtCCPassword, HostServer = "classicube.net",
                Session = new ClassicubeSession(), SignInButton = btnCCSignIn, Tab = tabCC,
                ServersTab = tabCCServers, ServersTable = tblCCServers, Hash = txtCCHash,
                form = this };

            cc.Filter = e =>
                e.Name.IndexOf( txtCCSearch.Text, StringComparison.OrdinalIgnoreCase ) >= 0
                && ( cbCCHideEmpty.Checked ? e.Players[0] != '0' : true );
            KeyPreview = true;
            KeyDown += KeyDownHandler;
            LoadResumeInfo();
        }