Beispiel #1
0
        private void NavOnFormAdded(object sender, NavigationController.NavigationEntry entry)
        {
            try
            {
                GameFiber.StartNew(() =>
                {
                    try
                    {
                        entry.form.Show();
                        do
                        {
                            GameFiber.Yield();
                        }while (!Globals.CloseRequested && entry.form.IsOpen());

                        Globals.Navigation.RemoveEntry(entry, false);
                    }
                    catch (Exception e)
                    {
                        if (e.GetType() != typeof(ThreadAbortException))
                        {
                            Function.LogCatch(e.ToString());
                        }
                    }
                    //NavOnFormRemoved(sender, entry);
                });
            }
            catch (Exception e)
            {
                Function.LogCatch(e.ToString());
            }
        }
Beispiel #2
0
 private void NavOnFormRemoved(object sender, NavigationController.NavigationEntry entry)
 {
     try
     {
         if (entry.form.Window == null || !entry.form.IsOpen())
         {
             return;
         }
         GameFiber.StartNew(() =>
         {
             entry.form.Window.Close();
         });
     }
     catch (Exception e)
     {
         Function.Log(e.ToString());
     }
 }
Beispiel #3
0
 private void NavOnFormRemoved(object sender, NavigationController.NavigationEntry entry)
 {
     try
     {
         if (entry.form.Window == null || !entry.form.IsOpen())
         {
             return;
         }
         GameFiber.StartNew(() =>
         {
             entry.form.Window.Close();
             // I know close() supposed to dispose the form. but just in case to make sure the memory is freed
             entry.form.Window.Dispose();
         });
     }
     catch (Exception e)
     {
         if (e.GetType() != typeof(ThreadAbortException))
         {
             Function.LogCatch(e.ToString());
         }
     }
 }