private void WClosed(object sender, EventArgs e)
 {
     foreach (Window Win in Application.Current.Windows)
     {
         Win.Close();
     }
 }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        private void OnTrain()
        {
            if (Files.Any())
            {
                var trainingData = ParseDYN.ParseDynData(Files);
                Model.TrainHiddenMarkovModel(trainingData);

                switch (TrainModel.TrainingMode)
                {
                case "bayes":
                    Model.TrainNaiveBayesClassifier(trainingData);
                    break;

                case "markov":
                    Model.TrainHiddenMarkovModel(trainingData);
                    break;
                }
            }
            else
            {
                // Initializes the variables to pass to the MessageBox.Show method.
                const string            message = "You did not select a folder yet, please specify";
                const string            caption = "Error Detected in Folder Selection";
                const MessageBoxButtons buttons = MessageBoxButtons.OK;

                // Displays the MessageBox.
                var result = MessageBox.Show(message, caption, buttons);

                if (result == DialogResult.Yes)
                {
                    // Closes the parent form.
                    Win?.Close();
                }
            }
        }
        public void ButtonSave_OnClick(object sender, object e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            ApplyChanges();
            Win.Close();
        }
示例#4
0
        private async void Button_Update_Click(object sender, RoutedEventArgs e)
        {
            Button_Update.ProgressValue = UI.UserControl_ProgressButton.ProgressType.Start;
            await Data.Current.SaveChangeJCRules(EditJCRules);

            Button_Update.ProgressValue = UI.UserControl_ProgressButton.ProgressType.Done;
            Win.Close(new TimeSpan(2 * 10 * 1000 * 1000));
        }
示例#5
0
        private async void Button_UpLoad_Click(object sender, RoutedEventArgs e)
        {
            EditRules.ForEach(p => p.JCRuleId = p.JCRule.Id);
            Button_UpLoad.ProgressValue       = UI.UserControl_ProgressButton.ProgressType.Start;
            await Data.Current.SaveChangeRules(EditRules);

            Button_UpLoad.ProgressValue = UI.UserControl_ProgressButton.ProgressType.Done;
            Win.Close(new TimeSpan(2 * 10 * 1000 * 1000));
        }
            public void Dispose()
            {
                _showingNotification = false;

                Win.Close();
                Application.Current.MainWindow.IsEnabled = true;
                FocusManager.SetFocusedElement(Application.Current.MainWindow, FocusedElement);
                Application.Current.MainWindow.Activate();
                FocusedElement.Focus();
            }
示例#7
0
        /// <summary>
        /// Handler for Train button. Parses selected DYN files to create train dataset.
        /// </summary>
        private void OnTrain()
        {
            if (Files.Any())
            {
                // (Aaron) Parse all the Dyns under DirectoryPath to CSV format
                var trainingData = ParseDYN.ParseDynData(Files);

                // (Konrad) Export the CSV to the %AppData%\thesaurus folder
                // That's the only location that we are sure user will have write access
                // This makes it possible for user to train his/her model on graphs
                // stored somewhere on the network where they are "read-only" for non-admins.
                ParseDYN.csvParser.ExportCSV();
                Model.TrainHiddenMarkovModel(trainingData);

                switch (TrainModel.TrainingMode)
                {
                case "bayes":
                    Model.TrainNaiveBayesClassifier(trainingData);
                    break;

                case "markov":
                    Model.TrainHiddenMarkovModel(trainingData);
                    break;
                }

                var                     message = Properties.Resources.Train_Success;
                const string            caption = "Success";
                const MessageBoxButtons buttons = MessageBoxButtons.OK;
                var                     result  = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Information);
                if (result == DialogResult.OK)
                {
                    Win?.Close();
                }
            }
            else
            {
                var                     message = Properties.Resources.Train_FolderError;
                const string            caption = "Error";
                const MessageBoxButtons buttons = MessageBoxButtons.OK;
                MessageBox.Show(message, caption, buttons, MessageBoxIcon.Error);
            }
        }
示例#8
0
 public static void Window_Closed(object sender, EventArgs e)
 => Win.Close();
示例#9
0
 public void Close()
 {
     Win.Close();
 }
示例#10
0
 private void OnExit(object sender, EventArgs e)
 {
     Cancel = false;
     Win?.Close();
 }
示例#11
0
 /// <summary>
 /// Event raised when Revit Document is closed. We need to make sure that task window is also closed.
 /// </summary>
 /// <param name="msg">Message object.</param>
 private void OnDocumentClosed(DocumentClosed msg)
 {
     Win?.Close();
 }
示例#12
0
 /// <summary>
 /// Handler for an event of Revit Document getting closed. It's best to close the
 /// </summary>
 /// <param name="obj"></param>
 private void OnDocumentClosed(DocumentClosed obj)
 {
     Win?.Close();
 }
示例#13
0
 private void btnExit_Click(object sender, RoutedEventArgs e) => Win.Close();
示例#14
0
 private void Button_JCRuleAddWin_Click(object sender, RoutedEventArgs e)
 {
     Win.Close();
     DialogHost.Show(new UserControl_JCRuleAdd());
 }