예제 #1
0
        internal void displayMails()
        {
            int id = 0;

            LoadingDialog md = new LoadingDialog();
            md.Buttons = null;
            md.Show();
            loadInboxAndSent();
            md.Close();

            foreach (Mail m in this.mm.Inbox)
            {
                ListBoxItem newMail = new ListBoxItem();
                StackPanel mailContainer = new StackPanel();
                Label subject = new Label();

                mailContainer.Width = 450;

                subject.Tag = id;
                subject.Content = m.Title;

                mailContainer.Children.Add(subject);

                newMail.Content = mailContainer;

                this.EmailList.Items.Add(newMail);
                id++;
            }
        }
예제 #2
0
    public static void CloseDialog()
    {
        LoadingDialog dialog = DialogManager.Instance.transform.GetComponentInChildren <LoadingDialog>();

        if (dialog != null)
        {
            dialog.Close();
        }
    }
예제 #3
0
 public Single()
 {
     InitializeComponent();
     LoadingDialog md = new LoadingDialog();
     md.Buttons = null;
     md.Show();
     initializeMap();
     md.Close();
 }
예제 #4
0
 private async void initializeMap()
 {
     LoadingDialog md = new LoadingDialog();
     md.Buttons = null;
     md.Show();         
     await Task.Delay(1000);
     this.map = new Map(gmap);
     initializeMarkers();
     md.Close();
 }
예제 #5
0
        private async Task AddAssemblies(IEnumerable <AssemblyAndConfigFile> assemblies)
        {
            var loadingDialog = new LoadingDialog {
                Owner = MainWindow.Instance
            };

            try
            {
                using (AssemblyHelper.SubscribeResolve())
                {
                    loadingDialog.Show();
                    foreach (var assembly in assemblies)
                    {
                        loadingDialog.AssemblyFileName = assembly.AssemblyFileName;

                        using (var xunit = new XunitFrontController(
                                   useAppDomain: true,
                                   assemblyFileName: assembly.AssemblyFileName,
                                   configFileName: assembly.ConfigFileName,
                                   diagnosticMessageSink: new DiagnosticMessageVisitor(),
                                   shadowCopy: false))
                            using (var testDiscoveryVisitor = new TestDiscoveryVisitor(xunit))
                            {
                                await Task.Run(() =>
                                {
                                    xunit.Find(includeSourceInformation: false, messageSink: testDiscoveryVisitor, discoveryOptions: TestFrameworkOptions.ForDiscovery());
                                    testDiscoveryVisitor.Finished.WaitOne();
                                });

                                allTestCases.AddRange(testDiscoveryVisitor.TestCases);
                                Assemblies.Add(new TestAssemblyViewModel(assembly));
                            }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Application.Current.MainWindow, ex.ToString());
            }
            finally
            {
                loadingDialog.Close();
            }
        }
        private async void btnLoadSavegame_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new OpenFileDialog {
                Filter = "Savegames (*.A7S)|*.A7S|All files (*.*)|*.*"
            };

            if (dialog.ShowDialog() == true)
            {
                var loadingDialog = new LoadingDialog()
                {
                    Owner = this
                };
                loadingDialog.Show();
                await FileReader.ReadFileAsync(dialog.FileName);

                SaveGameChanged?.Invoke();
                loadingDialog.Close();
            }
        }
예제 #7
0
파일: Program.cs 프로젝트: abraxas93/cdx
        static void Main()
        {
            var loading = new LoadingDialog();

            loading.Show();

            Directory.SetCurrentDirectory(Path.GetDirectoryName(
                                              System.Reflection.Assembly.GetExecutingAssembly().Location ?? string.Empty) ?? string.Empty);

            var start = new ProcessStartInfo
            {
                FileName        = "waggonerdx.exe",
                UseShellExecute = true
            };
            var process = Process.Start(start);

            var mainForm = new Form
            {
                Visible         = false,
                FormBorderStyle = FormBorderStyle.None,
                Width           = 0,
                Height          = 0,
                WindowState     = FormWindowState.Minimized,
                ShowInTaskbar   = false
            };

            mainForm.Load += (o, e) =>
            {
                var    loops            = 0;
                Action dispatcherAction = () => { };
                dispatcherAction = () =>
                {
                    mainForm.Invoke((MethodInvoker) delegate
                    {
                        if (!process.HasExited && loops < 30)
                        {
                            System.Threading.Thread.Sleep(100);
                            loops++;
                            dispatcherAction();
                        }
                        else
                        {
                            if (process.HasExited)
                            {
                                Application.Exit();
                            }
                            else
                            {
                                if (loading != null)
                                {
                                    loading.Close();
                                    loading = null;
                                }
                                else
                                {
                                    System.Threading.Thread.Sleep(100);
                                }
                                dispatcherAction();
                            }
                        }
                    }, DispatcherPriority.Background);
                };
                dispatcherAction();
            };

            Application.Run(mainForm);
        }