Exemple #1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            this.m_paProcon = this.WindowLoaded(false);

            string licenseAgreementRevision = "October 20, 2011";

            if (this.m_paProcon.LicenseAgreements.Contains(licenseAgreementRevision) == false)
            {
                new LicenseAgreement(this.m_paProcon, licenseAgreementRevision).ShowDialog();
            }

            this.SetupStartPage();

            this.m_paProcon.Connections.ConnectionAdded   += new ConnectionDictionary.ConnectionAlteredHandler(Connections_ConnectionAdded);
            this.m_paProcon.Connections.ConnectionRemoved += new ConnectionDictionary.ConnectionAlteredHandler(Connections_ConnectionRemoved);
            this.m_paProcon.ShowNotification       += new PRoConApplication.ShowNotificationHandler(m_paProcon_ShowNotification);
            this.m_paProcon.CurrentLanguageChanged += new PRoConApplication.CurrentLanguageHandler(m_paProcon_CurrentLanguageChanged);
            this.m_paProcon.OptionsSettings.ShowTrayIconChanged += new PRoCon.Core.Options.OptionsSettings.OptionsEnabledHandler(OptionsSettings_ShowTrayIconChanged);

            this.m_paProcon.AutoUpdater.CustomDownloadError          += new AutoUpdater.CustomDownloadErrorHandler(AutoUpdater_CustomDownloadError);
            this.m_paProcon.AutoUpdater.DownloadUnzipComplete        += new AutoUpdater.DownloadUnzipCompleteHandler(AutoUpdater_DownloadUnzipComplete);
            this.m_paProcon.AutoUpdater.CheckingUpdates              += new AutoUpdater.CheckingUpdatesHandler(m_paProcon_CheckingUpdates);
            this.m_paProcon.AutoUpdater.NoVersionAvailable           += new AutoUpdater.CheckingUpdatesHandler(m_paProcon_NoVersionAvailable);
            this.m_paProcon.AutoUpdater.VersionChecker.DownloadError += new CDownloadFile.DownloadFileEventDelegate(VersionChecker_DownloadError);
            this.m_paProcon.AutoUpdater.UpdateDownloading            += new AutoUpdater.UpdateDownloadingHandler(m_paProcon_UpdateDownloading);

            this.m_paProcon.AutoUpdater.GameConfigUpdated += new AutoUpdater.CheckingUpdatesHandler(m_paProcon_GameConfigUpdated);

            this.m_paProcon.Execute();

            if (this.m_paProcon.CustomTitle.Length > 0)
            {
                this.Text = this.m_paProcon.CustomTitle;
            }

            this.m_frmManageAccounts = new frmManageAccounts(this.m_paProcon, this);
            this.m_frmOptions        = new frmOptions(this.m_paProcon, this);

            this.WindowState = this.m_paProcon.SavedWindowState;
            this.Bounds      = this.m_paProcon.SavedWindowBounds;
            this.Refresh();

            //foreach (PRoConClient prcClient in this.m_paProcon.Connections) {
            //    this.Connections_ConnectionAdded(prcClient);
            //}

            this.m_paProcon.CurrentLanguage = this.m_paProcon.CurrentLanguage;
        }
Exemple #2
0
        private void frmMain_Load(object sender, EventArgs e) {
            
            this.m_paProcon = this.WindowLoaded(false);

            string licenseAgreementRevision = "October 20, 2011";
            if (this.m_paProcon.LicenseAgreements.Contains(licenseAgreementRevision) == false) {
                new LicenseAgreement(this.m_paProcon, licenseAgreementRevision).ShowDialog();
            }

            this.SetupStartPage();

            this.m_paProcon.Connections.ConnectionAdded += new ConnectionDictionary.ConnectionAlteredHandler(Connections_ConnectionAdded);
            this.m_paProcon.Connections.ConnectionRemoved += new ConnectionDictionary.ConnectionAlteredHandler(Connections_ConnectionRemoved);
            this.m_paProcon.ShowNotification += new PRoConApplication.ShowNotificationHandler(m_paProcon_ShowNotification);
            this.m_paProcon.CurrentLanguageChanged += new PRoConApplication.CurrentLanguageHandler(m_paProcon_CurrentLanguageChanged);
            this.m_paProcon.OptionsSettings.ShowTrayIconChanged += new PRoCon.Core.Options.OptionsSettings.OptionsEnabledHandler(OptionsSettings_ShowTrayIconChanged);

            this.m_paProcon.AutoUpdater.CustomDownloadError += new AutoUpdater.CustomDownloadErrorHandler(AutoUpdater_CustomDownloadError);
            this.m_paProcon.AutoUpdater.DownloadUnzipComplete += new AutoUpdater.DownloadUnzipCompleteHandler(AutoUpdater_DownloadUnzipComplete);
            this.m_paProcon.AutoUpdater.CheckingUpdates += new AutoUpdater.CheckingUpdatesHandler(m_paProcon_CheckingUpdates);
            this.m_paProcon.AutoUpdater.NoVersionAvailable += new AutoUpdater.CheckingUpdatesHandler(m_paProcon_NoVersionAvailable);
            this.m_paProcon.AutoUpdater.VersionChecker.DownloadError += new CDownloadFile.DownloadFileEventDelegate(VersionChecker_DownloadError);
            this.m_paProcon.AutoUpdater.UpdateDownloading += new AutoUpdater.UpdateDownloadingHandler(m_paProcon_UpdateDownloading);

            this.m_paProcon.AutoUpdater.GameConfigUpdated += new AutoUpdater.CheckingUpdatesHandler(m_paProcon_GameConfigUpdated);

            this.m_paProcon.Execute();

            if (this.m_paProcon.CustomTitle.Length > 0) {
                this.Text = this.m_paProcon.CustomTitle;
            }

            this.m_frmManageAccounts = new frmManageAccounts(this.m_paProcon, this);
            this.m_frmOptions = new frmOptions(this.m_paProcon, this);

            this.WindowState = this.m_paProcon.SavedWindowState;
            this.Bounds = this.m_paProcon.SavedWindowBounds;
            this.Refresh();

            //foreach (PRoConClient prcClient in this.m_paProcon.Connections) {
            //    this.Connections_ConnectionAdded(prcClient);
            //}

            this.m_paProcon.CurrentLanguage = this.m_paProcon.CurrentLanguage;
        }
        public uscServerConnection(PRoConApplication paProcon, PRoConClient prcConnection, frmMain frmParent, frmManageAccounts frmAccounts) {
        //public uscServerConnection(PRoConApplication paProcon, ProConClient prcConnection, frmMain frmParent, frmManageAccounts frmAccounts, uscServerPlayerTreeview uscServerPlayerTree, string strHost, UInt16 iu16Port, string strUsername, string strPassword) {

            InitializeComponent();

            this.m_praApplication = paProcon;
            this.m_prcConnection = prcConnection;
            this.m_prcConnection.GameTypeDiscovered += new PRoConClient.EmptyParamterHandler(m_prcConnection_GameTypeDiscovered);

            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.DoubleBuffer, true);

            this.m_cpPrivileges = new CPrivileges(CPrivileges.FullPrivilegesFlags);

            this.m_frmParent = frmParent;
            this.m_frmAccounts = frmAccounts;

            this.tbcClientTabs.ImageList = this.m_frmParent.iglIcons;

            this.uscLogin.BackgroundHostPort = prcConnection.HostNamePort;

            if (prcConnection.State != ConnectionState.Connected) {
                this.uscLogin.Dock = DockStyle.Fill;
                this.uscLogin.Show();
            }
            else {
                this.uscLogin.Hide();
            }

            this.uscLists.OnTabChange += new OnTabChangeDelegate(uscLists_OnTabChange);

            this.tabPlayerList.ImageKey = "mouse.png";
            this.tabLists.ImageKey = "table.png";
            this.tabChat.ImageKey = "comments.png";
            this.tabEvents.ImageKey = "flag_blue.png";
            this.tabMapView.ImageKey = "map-pin.png";
            this.tabServerSettings.ImageKey = "server_edit.png";
            this.tabPlugins.ImageKey = "plugin.png";
            this.tabAccounts.ImageKey = "vcard.png";
            this.tabConsole.ImageKey = "application_xp_terminal.png";

            #region Map Controls

            this.SettingLoading = this.m_frmParent.picAjaxStyleLoading.Image;
            this.SettingSuccess = this.m_frmParent.picAjaxStyleSuccess.Image;
            this.SettingFail = this.m_frmParent.picAjaxStyleFail.Image;

            this.btnRestartRound.Image = this.m_frmParent.iglIcons.Images["arrow-retweet.png"];
            this.btnNextRound.Image = this.m_frmParent.iglIcons.Images["arrow-step-over.png"];

            this.AsyncSettingControls.Add("admin.runNextRound", new AsyncStyleSetting(this.picNextRound, null, new Control[] { this.btnNextRound }, true));
            this.AsyncSettingControls.Add("admin.restartRound", new AsyncStyleSetting(this.picRestartRound, null, new Control[] { this.btnRestartRound }, true));

            #endregion

            this.uscPlugins.GetPluginDetails += new uscPluginPanel.GetPluginDetailsDelegate(uscPlugins_GetPluginDetails);
            this.uscPlugins.SetPluginVariable += new uscPluginPanel.SetPluginVariableDelegate(uscPlugins_SetPluginVariable);
            this.uscPlugins.PluginEnabled += new uscPluginPanel.PluginEnabledDelegate(uscPlugins_PluginEnabled);
            this.uscPlugins.PluginLoaded += new uscPluginPanel.PluginEventDelegate(uscPlugins_PluginLoaded);
            this.uscPlugins.PluginVariablesAltered += new uscPluginPanel.PluginEventDelegate(uscPlugins_PluginVariablesAltered);
            this.uscPlugins.ReloadPlugins += new uscPluginPanel.EventDelegate(uscPlugins_ReloadPlugins);
            this.uscPlugins.OnTabChange += new OnTabChangeDelegate(uscPlugins_OnTabChange);

            this.uscAccounts.ManageAccountsRequest += new uscAccountsPanel.ManageAccountsRequestDelegate(uscAccounts_ManageAccountsRequest);

            this.uscServerConsole.SendCommand += new uscConsolePanel.SendCommandDelegate(uscServerConsole_SendCommand);
            this.uscServerConsole.SendListCommand += new uscConsolePanel.SendListCommandDelegate(uscServerConsole_SendListCommand);
            this.uscServerConsole.OnTabChange += new OnTabChangeDelegate(uscServerConsole_OnTabChange);

            this.m_tabParentLayerControl = new TabPage("Parent Layer Control");
            this.m_tabParentLayerControl.Name = "tabLayerControl";
            this.m_tabParentLayerControl.Padding = new Padding(8);
            this.m_tabParentLayerControl.UseVisualStyleBackColor = true;

            this.m_uscParentLayerControl = new uscParentLayerControl();
            this.m_uscParentLayerControl.Dock = DockStyle.Fill;
            this.m_uscParentLayerControl.BackColor = Color.Transparent;
            //this.m_uscParentLayerControl.SendCommand += new uscParentLayerControl.SendCommandDelegate(m_uscParentLayerControl_SendCommand);
            this.m_uscParentLayerControl.Initialize(this.m_frmParent, this);
            this.m_tabParentLayerControl.Controls.Add(m_uscParentLayerControl);
            this.m_uscParentLayerControl.OnTabChange += new OnTabChangeDelegate(m_uscParentLayerControl_OnTabChange);

            this.uscPlugins.Initialize(this.m_frmParent, this);
            this.uscPlugins.SetConnection(this.m_prcConnection);
            this.uscLogin.Initalize(this.m_frmParent, this);
            this.uscLogin.SetConnection(this.m_prcConnection);
            this.uscLogin.SetLocalization(this.m_prcConnection.Language);

            this.uscMap.SetConnection(this.m_prcConnection);
            this.uscEvents.SetConnection(this.m_prcConnection);
            this.uscLists.SetConnection(this.m_prcConnection);
            this.uscSettings.SetConnection(this.m_prcConnection);
            this.uscServerConsole.SetConnection(this.m_prcConnection);
            this.uscChat.SetConnection(this.m_prcConnection);
            this.uscPlayers.SetConnection(this.m_prcConnection);
            this.m_uscParentLayerControl.SetConnection(this.m_prcConnection);

            this.uscAccounts.SetConnection(this.m_praApplication, this.m_prcConnection);
        }