private void buttonExe_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DataGridRow row = DataGridUtils.FindVisualParent <DataGridRow>(e.OriginalSource as UIElement);
                if (null != row)
                {
                    SolibriProperties sp = row.Item as SolibriProperties;
                    if (null != sp)
                    {
                        OpenFileDialog openDialog = new OpenFileDialog();
                        openDialog.Title            = "Specify an excutable of Solibri";
                        openDialog.Multiselect      = false;
                        openDialog.RestoreDirectory = true;
                        openDialog.Filter           = "Application (*.exe)|*.exe";
                        if ((bool)openDialog.ShowDialog())
                        {
                            string exeFile = openDialog.FileName;

                            int index = settings.Options.SolibriOptions.IndexOf(sp);
                            this.Settings.Options.SolibriOptions[index].ExeFile = exeFile;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
 private void buttonAddSolibri_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         SolibriProperties sp = new SolibriProperties("New Version", "");
         this.Settings.Options.SolibriOptions.Add(sp);
     }
     catch (Exception ex)
     {
         string message = ex.Message;
     }
 }
 private void buttonDeleteSolibri_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (null != dataGridSolibri.SelectedItems && dataGridSolibri.SelectedItems.Count > 0)
         {
             for (int i = dataGridSolibri.SelectedItems.Count - 1; i > -1; i--)
             {
                 SolibriProperties sp = dataGridSolibri.SelectedItems[i] as SolibriProperties;
                 this.Settings.Options.SolibriOptions.Remove(sp);
             }
         }
     }
     catch (Exception ex)
     {
         string message = ex.Message;
     }
 }
        private void StoreOriginalSettings()
        {
            try
            {
                foreach (SolibriProperties sp in settings.Options.SolibriOptions)
                {
                    SolibriProperties sProperties = new SolibriProperties(sp.VersionNumber, sp.ExeFile);
                    tempSolibriOptions.Add(sProperties);
                }
                selectedSolibri = new SolibriProperties(settings.SolibriSetup.VersionNumber, settings.SolibriSetup.ExeFile);

                foreach (RemoteMachine rm in settings.Options.RemoteOptions)
                {
                    RemoteMachine rMachine = new RemoteMachine(rm.Location, rm.ComputerName, rm.DirectoryName);
                    tempRemoteMachines.Add(rMachine);
                }
                selectedRemoteMachine = new RemoteMachine(settings.RemoteSetup.Location, settings.RemoteSetup.ComputerName, settings.RemoteSetup.DirectoryName);
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }
Esempio n. 5
0
        private void CollectDefaultSettings()
        {
            try
            {
                //solibri versions
                SolibriProperties sp = new SolibriProperties("Solibri Model Checker v9.5", @"C:\Program Files\Solibri\SMCv9.5\Solibri Model Checker v9.5.exe");
                solibries.Add(sp);
                sp = new SolibriProperties("Solibri Model Checker v9.6", @"C:\Program Files\Solibri\SMCv9.6\Solibri Model Checker v9.6.exe");
                solibries.Add(sp);
                sp = new SolibriProperties("Solibri Model Checker v9.7", @"C:\Program Files\Solibri\SMCv9.7\Solibri Model Checker v9.7.exe");
                solibries.Add(sp);
                solibries = solibries.OrderBy(o => o.VersionNumber).ToList();

                comboBoxSolibri.ItemsSource = null;
                comboBoxSolibri.ItemsSource = solibries;

                comboBoxSolibri.DisplayMemberPath = "VersionNumber";

                //remote machines
                RempoteMachine rm = new RempoteMachine("NY", "NY-BAT-D001", @"\\NY-BAT-D001\SolibriBatch");
                remoteComputers.Add(rm);
                RempoteMachine rm2 = new RempoteMachine("PHI", "PHI-BAT-D001", @"\\PHI-BAT-D001\SolibriBatch");
                remoteComputers.Add(rm2);
                RempoteMachine rm3 = new RempoteMachine("HOU", "HOU-BAT-D001", @"\\HOU-BAT-D001\SolibriBatch");
                remoteComputers.Add(rm3);

                remoteComputers = remoteComputers.OrderBy(o => o.ComputerName).ToList();

                comboBoxComputer.ItemsSource       = null;
                comboBoxComputer.ItemsSource       = remoteComputers;
                comboBoxComputer.DisplayMemberPath = "DirectoryName";
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to collect default settings.\n" + ex.Message, "Collect Default Settings", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
Esempio n. 6
0
 public AutorunSettings(SolibriProperties solibri, RempoteMachine remote)
 {
     solibriSetup = solibri;
     remoteSetup  = remote;
 }
Esempio n. 7
0
 public AutorunSettings()
 {
     solibriSetup = new SolibriProperties("Solibri Model Checker v9.6", @"C:\Program Files\Solibri\SMCv9.6\Solibri Model Checker v9.6.exe");
     remoteSetup  = new RempoteMachine("NY", "NY-BAT-D001", @"\\NY-BAT-D001\SolibriBatch");
 }