Esempio n. 1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn public static void Button_SelectSelectedAlgorithmDebugFile_Click(object sender, RoutedEventArgs e)
        ///
        /// \brief Event handler. Called by Button_SelectSelectedAlgorithmDebugFile for click events.
        ///
        /// \par Description.
        ///
        /// \par Algorithm.
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 14/11/2017
        ///
        /// \param sender  (object) - Source of the event.
        /// \param e       (RoutedEventArgs) - Routed event information.
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public static void Button_SelectSelectedAlgorithmDebugFile_Click(object sender, RoutedEventArgs e)
        {
            // Get the config and config window
            ConfigWindow configWindow = (ConfigWindow)GetWindow((Button)sender);
            Config       config       = (Config)configWindow.networkElements[0];

            // Get the data file name and path from the buttons
            Button debugfileNameButton            = (Button)configWindow.controlsAttributeLinks.Values.First(link => TypesUtility.CompareDynamics(link.key, Config.Keys.SelectedDebugFileName)).newValueControl;
            string selectedAlgorithmDebugFileName = (string)debugfileNameButton.Content;
            Button debugfilePathButton            = (Button)configWindow.controlsAttributeLinks.Values.First(link => TypesUtility.CompareDynamics(link.key, Config.Keys.SelectedDebugPath)).newValueControl;
            string selectedAlgorithmDebugPath     = (string)debugfilePathButton.Content;

            // Get the subject and the algorithm names
            ComboBox subjectComboBox   = (ComboBox)configWindow.controlsAttributeLinks.Values.First(link => TypesUtility.CompareDynamics(link.key, Config.Keys.SelectedSubject)).newValueControl;
            string   subjectName       = (string)subjectComboBox.SelectedItem;
            ComboBox algorithmComboBox = (ComboBox)configWindow.controlsAttributeLinks.Values.First(link => TypesUtility.CompareDynamics(link.key, Config.Keys.SelectedAlgorithm)).newValueControl;
            string   algorithmName     = (string)algorithmComboBox.SelectedItem;

            // Select the file
            if (FileUtilities.SelectInputFile("debug", ref selectedAlgorithmDebugFileName, ref selectedAlgorithmDebugPath))
            {
                // Update the buttons
                configWindow.UpdateNewValueChanged(debugfileNameButton, selectedAlgorithmDebugFileName);
                debugfileNameButton.Content = selectedAlgorithmDebugFileName;
                configWindow.UpdateNewValueChanged(debugfilePathButton, selectedAlgorithmDebugPath);
                debugfilePathButton.Content   = selectedAlgorithmDebugPath;
                configWindow.selectionChanged = true;
            }
        }
Esempio n. 2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// \fn protected void Button_SelectAlgorithmsPath_Click(object sender, RoutedEventArgs e)
        ///
        /// \brief Event handler. Called by Button_SelectAlgorithmsPath for click events.
        ///
        /// \par Description.
        ///      -  Change the selected Algorithm Data path.
        ///      -  This method is activated when the Algorithm Data Path attribute's button is clicked
        ///
        /// \par Algorithm.
        ///
        /// \par Usage Notes.
        ///
        /// \author Ilanh
        /// \date 01/11/2017
        ///
        /// \param sender (object) - Source of the event.
        /// \param e      (RoutedEventArgs) - Routed event information.
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public static void Button_SelectAlgorithmsPath_Click(object sender, RoutedEventArgs e)
        {
            ConfigWindow configWindow = (ConfigWindow)GetWindow((Button)sender);
            Config       config       = (Config)configWindow.networkElements[0];

            if (CustomizedMessageBox.Show("The selecting of an algorithms pass will cause save to the config \n Do you want to continue ?",
                                          "Select Algorithms Path Message",
                                          MessageBoxButton.YesNo,
                                          Icons.Question) == MessageBoxResult.Yes)
            {
                if (config.AddAlgorithmsData())
                {
                    config.CheckAndSetSelected();
                    configWindow.selectionChanged = true;
                    configWindow.ResetToExisting();
                    configWindow.InitialExpand();
                }
            }
        }