コード例 #1
0
 private void ButtonNext_Click(object sender, RoutedEventArgs e)
 {
     if (m_dataContext.StepOneExpanded)
     {
         m_dataContext.StepTwoExpanded = true;
     }
     else if (m_dataContext.StepTwoExpanded)
     {
         m_dataContext.StepThreeExpanded = true;
     }
     else if (m_dataContext.StepThreeExpanded)
     {
         if (m_dataContext.ItemsSource.Any(inputDevice => inputDevice.PhasorList.Any(phasor => !phasor.IsValid)))
         {
             ButtonAccept.Visibility = HasPhaseErrors ? Visibility.Visible : Visibility.Hidden;
             m_dataContext.Popup("Fix all validation errors before device can be saved.", "Validation Error", MessageBoxImage.Error);
         }
         else
         {
             if (!m_dataContext.ConnectToConcentrator || ValidatePMUNames())
             {
                 m_dataContext.SavePDC();
                 m_dataContext.SaveConfiguration();
             }
             else
             {
                 m_dataContext.Popup($"One of the device acronyms is set to the PDC acronym \"{m_dataContext.PdcAcronym}\", device cannot be saved.", "Validation Error", MessageBoxImage.Error);
             }
         }
     }
 }
コード例 #2
0
 private void ButtonNext_Click(object sender, RoutedEventArgs e)
 {
     if (m_dataContext.StepOneExpanded)
     {
         m_dataContext.StepTwoExpanded = true;
     }
     else if (m_dataContext.StepTwoExpanded)
     {
         m_dataContext.StepThreeExpanded = true;
     }
     else if (m_dataContext.StepThreeExpanded)
     {
         if (!m_dataContext.ConnectToConcentrator || ValidatePMUNames())
         {
             m_dataContext.SavePDC();
             m_dataContext.SaveConfiguration();
         }
         else
         {
             m_dataContext.Popup($"One of the device acronyms is set to the PDC acronym \"{m_dataContext.PdcAcronym}\", device cannot be saved.", "Validation Error", MessageBoxImage.Error);
         }
     }
 }