示例#1
0
        private void BtnSettings_Click(object sender, EventArgs e)
        {
            //open dialog for settings form
            FrmSettings options = new FrmSettings();

            options.ShowDialog();
        }
示例#2
0
        /// <summary>
        /// Settings Dialog를 표시한다.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void settingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmSettings frmSettings = new FrmSettings();

            frmSettings.StartPosition = FormStartPosition.CenterParent;
            frmSettings.ShowDialog();
        }
示例#3
0
        public static int Game(bool windowed)
        {
            _bhdPath = Config.Actions.Get("GamePath").ToLower().Replace("dfbhd.exe", "");

            //MessageBox.Show(_bhdPath);
            if (string.IsNullOrEmpty(_bhdPath))
            {
                MessageBox.Show(@"Please set the game path in the settings dialog!", @"Game Path Not Found",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                var frmSettings = new FrmSettings();
                Log.Line("_bhdPath was empty, asking for location now.");
                frmSettings.ShowDialog();
                return(0);
            }

            //Get recent Cheat Information Database
            Data.GetCheatData();

            if (windowed)
            {
                _args = "/w";
            }
            try
            {
                Directory.SetCurrentDirectory(@_bhdPath);
            }
            catch (Exception ex)
            {
                Log.Line(ex.Message);
            }
            TheGame = new Process
            {
                StartInfo =
                {
                    FileName  = _bhdPath + "dfbhd.exe",
                    Arguments = _args
                },
                EnableRaisingEvents = true
            };
            //Setup our Process exited event handler
            TheGame.Exited += GameDied;

            //Start the game
            TheGame.Start();
            ReadProcMems.MProcess = TheGame;
            //Here I will start the cheat detection
            CheckMemoryCheats = new Thread(GameThreads.ScanMem);
            CheckMemoryCheats.Start();
            Log.Line("Game with id: " + TheGame.Id + " has started");
            //Monitor server changes
            CheckServerEvents = new Thread(GameThreads.ServerChangeEvent);
            CheckServerEvents.Start();
            return(0);

            //Just incase I decide to use this for something else.
        }
 private void btnSetting_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         FrmSettings frm = new FrmSettings();
         frm.Title = "Settings";
         frm.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, this.Title, MessageBoxButton.OK);
     }
 }
示例#5
0
        /// <summary>
        /// Open settings window, only allow one instance.
        /// </summary>
        public void OpenFrmSettings()
        {
            if (this.AllowCreateForm(this.frmsettings))
            {
                this.frmsettings = new FrmSettings(this.notes);
                this.frmsettings.Show();
            }
            else
            {
                this.frmsettings.WindowState = FormWindowState.Normal;
            }

            this.frmsettings.Activate();
        }
示例#6
0
        private void MenBtnSettings_Click(object sender, EventArgs e)
        {
            //Display the settings form to the user.
            this.Enabled = false;

            using (FrmSettings settingsWindow = new FrmSettings())
            {
                settingsWindow.ShowDialog();
            }

            LoadPaths();
            MnuStpMain.Select();
            this.Enabled = true;
        }
        // File ToolStrip Buttons
        private void SettingsStripMenuItem_Click(object sender, EventArgs e)
        {
            if (LstForms[0].IsDisposed)
            {
                LstForms[0] = new FrmSettings(this);
            }
            FrmSettings frm = (FrmSettings)LstForms[0];

            if (frm == null)
            {
                return;
            }

            frm.Show();
            frm.BringToFront();
        }
示例#8
0
        static void Main(string[] args)
        {
            // 初始化log4net
            log4net.Config.XmlConfigurator.Configure(new FileInfo(Path.Combine(Application.StartupPath, "Config", "log4net.config")));
            FrmSettings frmSettings = new FrmSettings();

            if (frmSettings.ShowDialog() == DialogResult.OK)
            {
                var settings = frmSettings.Settings;
                var logger   = Log4netFactory.CreateLogger();
                //var unhandledLinks = WebPageDao.GetUnhandledLinks();

                Spider spider = new Spider(settings, logger, null);

                spider.AddUrlEvent += addUrlArgs =>
                {
                    //if (WebPageDao.IsIdExisted(MD5Helper.GetMD5HashCode(addUrlArgs.Url)))
                    //    return false;
                    //WebPageDao.SaveOrUpdateWebPage(addUrlArgs.Url, addUrlArgs.Depth);
                    Console.WriteLine(addUrlArgs.Title + " - " + addUrlArgs.Url);
                    return(true);
                };

                spider.DataReceivedEvent += receivedArgs =>
                {
                    //WebPage webPage = ArticleParse.GetArticleWebPage(receivedArgs.Html);
                    //webPage.Id = MD5Helper.GetMD5HashCode(receivedArgs.Url);
                    //webPage.Url = receivedArgs.Url;
                    //webPage.Depth = receivedArgs.Depth;
                    //webPage.InsertDate = DateTime.Now;
                    //webPage.Status = 1;
                    //WebPageDao.SaveOrUpdateWebPage(webPage);
                    MessageBox.Show(Html2Article.GetArticle(receivedArgs.Html));
                };

                spider.Crawl();
            }
        }
示例#9
0
        private void MnuFileSettings_Click(object sender, EventArgs e)
        {
            FrmSettings frmSettings = new FrmSettings();
            var         result      = frmSettings.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                Properties.Settings.Default.ComPort    = frmSettings.cmbComPort.Text;
                Properties.Settings.Default.Baudrate   = int.Parse(frmSettings.cmbBaudrate.Text);
                Properties.Settings.Default.DataBits   = int.Parse(frmSettings.cmbDataBits.Text);
                Properties.Settings.Default.ParityBits = frmSettings.cmbParityBits.SelectedIndex;
                Properties.Settings.Default.StopBits   = frmSettings.cmbStopBits.SelectedIndex;
                Properties.Settings.Default.Refresh    = int.Parse(frmSettings.NumRefresh.Value.ToString());
                Properties.Settings.Default.Address    = byte.Parse(frmSettings.NumAddress.Value.ToString());
                slaveAddress = Properties.Settings.Default.Address;
                tmr.Interval = Properties.Settings.Default.Refresh;

                Properties.Settings.Default.Save();
                UpdateStatus();
            }

            frmSettings.Dispose();
        }
示例#10
0
        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            {
                frmSettings = new FrmSettings();
            }

            frmSettings.Show();    
        }
示例#11
0
        private void settingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //if (frmSettings == null)
            {
                frmSettings = new FrmSettings();
            }

            frmSettings.Show();        
        }
示例#12
0
        private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmSettings frmSettings = new FrmSettings();

            frmSettings.Show();
        }
        private void btnSettings_Click(object sender, EventArgs e)
        {
            FrmSettings f = new FrmSettings();

            f.ShowDialog();
        }