示例#1
0
        private void Scenariogrid_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (!IsDragging || IsEditing)
            {
                return;
            }

            ScenarioQueueList targetItem = (ScenarioQueueList)ScenarioDataGrid.SelectedItem;

            if (targetItem == null || !ReferenceEquals(DraggedItem, targetItem))
            {
                //remove the source from the list
                _scenarioList.Remove(DraggedItem);

                //get target index
                var targetIndex = _scenarioList.IndexOf(targetItem);

                //move source at the target's location
                _scenarioList.Insert(targetIndex, DraggedItem);

                //select the dropped item
                ScenarioDataGrid.SelectedItem = DraggedItem;
            }

            //reset
            ResetDragDrop();
        }
示例#2
0
        private void buttonAdd_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(STFLoginManager.SystemDatabase))
            {
                if (STFLoginManager.Login())
                {
                    _currentDatabase = STFLoginManager.SystemDatabase;
                }
                else
                {
                    return;
                }
            }

            ScenarioSelection scenarios = new ScenarioSelection();
            {
                scenarios.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                if (scenarios.ShowDialog() == true)
                {
                    ScenarioQueueList temp = new ScenarioQueueList
                    {
                        ScenarioId   = scenarios.ScenarioId,
                        ScenarioName = scenarios.ScenarioName,
                        Status       = "Yet to Start"
                    };
                    _scenarioList.Add(temp);
                    buttonRemove.IsEnabled = true;
                }
            }
        }
示例#3
0
 private void ExecuteScenario(ScenarioQueueList scenario)
 {
     if (!string.IsNullOrEmpty(scenario.ScenarioName))
     {
         if (GlobalSettings.IsDistributedSystem)
         {
             ExecuteSTF(scenario.ScenarioName, scenario.HoldId);
         }
         else
         {
             ExecuteSTB(scenario.ScenarioName);
         }
     }
 }