示例#1
0
 void IDisposable.Dispose()
 {
     FullScreenHandle.StopFullScreen(this);
     GC.SuppressFinalize(this);
 }
示例#2
0
        static void Main(string[] args)
        {
            frmUpdate tempUpdate = null;

            try
            {
                //Application.Run(new frmLockDown());
                using (frmUpdate fUpdate = new frmUpdate())
                {
                    GC.ReRegisterForFinalize(fUpdate);

                    tempUpdate = fUpdate;

                    fUpdate.UpdateFileName = args[1];
                    Application.Run(fUpdate);
                    //------This section will work after program finish update------
                    //test by jack
                    if (File.Exists(args[2]))
                    {
                        Process proc = new Process();
                        proc.StartInfo.FileName  = args[2];
                        proc.StartInfo.Arguments = "Updated";
                        proc.Start();
                    }
                    else
                    {
                        MessageBox.Show("Can't Start Application");
                    }

                    tempUpdate = null;
                    GC.SuppressFinalize(fUpdate);

                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                }

                if (tempUpdate != null)
                {
                    FullScreenHandle.StopFullScreen(tempUpdate);
                    GC.SuppressFinalize(tempUpdate);

                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                }

                Application.Exit();
            }
            catch (Exception ex)
            {
                if (tempUpdate != null)
                {
                    FullScreenHandle.StopFullScreen(tempUpdate);
                    GC.SuppressFinalize(tempUpdate);
                }

                GC.Collect();
                GC.WaitForPendingFinalizers();

                Application.Exit();
            }
        }
示例#3
0
 public frmUpdate()
 {
     InitializeComponent();
     cusResult = new System.ComponentModel.ComponentResourceManager(typeof(frmUpdate));
     FullScreenHandle.StartFullScreen(this);
 }