コード例 #1
0
ファイル: Program.cs プロジェクト: joyjones/fire-terminator
        static void Main(string[] args)
        {
            try
            {
                DevExpress.UserSkins.BonusSkins.Register();
                DevExpress.Skins.SkinManager.EnableFormSkins();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                if (!SecurityGrandDog.Instance.StartupCheck())
                {
                    return;
                }
                ProjectDoc.Instance.Option = Option;

                using (Graphic = new GraphicPainter())
                {
                    Graphic.IsFixedTimeStep   = false;
                    Graphic.TargetElapsedTime = new System.TimeSpan(0, 0, 0, 0, 30);
                    Graphic.Run();
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
            finally
            {
                IsAppRunning = false;
                SecurityGrandDog.Instance.Close();
            }
        }
コード例 #2
0
        private void chkRecord_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                bnQuit.Enabled = !chkRecord.Checked;
                if (chkRecord.Checked)
                {
                    if (!chkPlay.Checked)
                    {
                        chkPlay.Checked = true;
                    }
                    chkRecord.BackColor = Color.Red;
                    if (GraphicPainter.StartSinkWriter() != 0)
                    {
                        MessageBox.Show("Failed to StartSinkWriter!");
                    }
                }
                else
                {
                    chkRecord.BackColor = Color.WhiteSmoke;
                    GraphicPainter.FinishSinkWriter();
                    string sourceFile = Options.AppRootPath + "output.wmv";
                    if (!File.Exists(sourceFile))
                    {
                        var di = new DirectoryInfo(Options.AppRootPath);
                        sourceFile = di.Parent.FullName.TrimEnd('\\') + "\\output.wmv";
                    }
                    if (File.Exists(sourceFile))
                    {
                        string targetName = String.Format("FireTerminator {0}.wmv", DateTime.Now.ToString()).Replace(':', '-').Replace('\\', '-').Replace('/', '-');
                        string targetFile = Options.RecordMovieTargetPath + targetName;
                        try
                        {
                            CommonMethods.InheritCreateFolder(targetFile, true);
                            File.Move(sourceFile, targetFile);
                        }
                        catch { }
                    }
                }

                //System.Windows.Forms.SendKeys.Send("^%p");
                //System.Windows.Forms.SendKeys.Flush();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }