Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StartPausSim_CommandEventHandler(object sender, ExecutedRoutedEventArgs e)
        {
            switch (currentSimulationState)
            {

                case Simulation_State.Stop:

                    // Try to exit the Edit Mode of the Cell
                    JobsDataGrid.CommitEdit();
                    JobsDataGrid.SelectedIndex = -1;
                    JobsDataGrid.CommitEdit();

                    simulationInterface.RequestStateChange(Simulation_State.Run, Jobs);
                    break;

                case Simulation_State.Pause:
                    simulationInterface.RequestStateChange(Simulation_State.Run);
                    break;

                case Simulation_State.Run:
                    simulationInterface.RequestStateChange(Simulation_State.Pause);
                    break;

            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveSim_CommandEventHandler(object sender, ExecutedRoutedEventArgs e)
        {
            // Try to exit the Edit Mode of the Cell
            JobsDataGrid.CommitEdit();
            JobsDataGrid.SelectedIndex = -1;
            JobsDataGrid.CommitEdit();

            LinkedList<Simulation_Job> simulationJobs = new LinkedList<Simulation_Job>();
            foreach (Simulation_Job jobItem in Jobs)
            {
                simulationJobs.AddLast(jobItem);
            }

            Simulation_ImportExport mySimulationExporter = new Simulation_ImportExport();
            mySimulationExporter.ExportSimulationDataToFileSystem(simulationJobs);
        }