Esempio n. 1
0
 public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
 {
     _pluginConfigurationData = configuration;
     _activityData            = configuration.GetMetadata <RebootDeviceActivityData>();
     AssetSelectionControl.Initialize(configuration.Assets, AssetAttributes.None);
     Initialize(_activityData);
 }
Esempio n. 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (STFLoginManager.Login())
            {
                _currentDatabase = STFLoginManager.SystemDatabase;
                //Set whether STF or STB based on the worker type in the database.
                GlobalSettings.IsDistributedSystem = false;
                //string officeWorkerType = VirtualResourceType.OfficeWorker.ToString();
                //using (EnterpriseTestContext dataContext = new EnterpriseTestContext(_currentDatabase))
                //{
                //    GlobalSettings.IsDistributedSystem = dataContext.VirtualResources.Any(r => r.ResourceType == officeWorkerType);
                //}
                LoggedInTextBlock.Text = $"Logged in as: {UserManager.CurrentUserName} to {STFLoginManager.SystemDatabase}";
            }
            else
            {
                Environment.Exit(1);
            }

            _edtAssetSelectionControl?.Initialize(AssetAttributes.None);
            GlobalSettings.Load(_currentDatabase);
            FrameworkServicesInitializer.InitializeConfiguration();


            BuildComboBox.DataContext    = _accessDds.GetBuilds();
            ProductComboBox.DataContext  = _accessDds.GetProducts();
            ScenarioDataGrid.DataContext = _scenarioList;
            GroupComboBox.DataContext    = _groupCollection;
        }
Esempio n. 3
0
 public void Initialize(PluginEnvironment environment)
 {
     _activityData = new RebootDeviceActivityData();
     AssetSelectionControl.Initialize(AssetAttributes.None);
     Initialize(_activityData);
 }
Esempio n. 4
0
        private void MenuOpen_OnClick(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog
            {
                DefaultExt      = "xml",
                Filter          = "EDT AutoTestHelper Save (*.xml)|*.xml",
                CheckFileExists = true
            };

            var result = ofd.ShowDialog();

            if (result.HasValue && result.Value == false)
            {
                return;
            }

            XElement rootElement = XElement.Load(ofd.FileName);

            if (rootElement.Element("Database") == null)
            {
                MessageBox.Show("Invalid EDT AutoTestHelper Save file, Please select a valid file", ApplicationName, MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            if (STFLoginManager.SystemDatabase.Equals(rootElement.Element("Database").Value))
            {
                _currentDatabase = rootElement.Element("Database")?.Value;
                _edtAssetSelectionControl.Initialize(new AssetSelectionData(ConfigurationServices.AssetInventory.GetAsset(rootElement.Element("AssetId")?.Value)), AssetAttributes.Printer);

                var fimElement = rootElement.Element("FIM");
                if (fimElement != null)
                {
                    BaseFirmwareTextBox.Text   = fimElement.Element("Base").Value;
                    TargetFirmwareTextBox.Text = fimElement.Element("Target").Value;
                }

                var ddsElement = rootElement.Element("DDS");
                if (ddsElement != null)
                {
                    var buildId   = Guid.Parse(ddsElement.Element("BuildId").Value);
                    var productId = Guid.Parse(ddsElement.Element("Product").Value);
                    var runId     = Guid.Parse(ddsElement.Element("RunId").Value);

                    var buildList = BuildComboBox.ItemsSource as List <Build>;
                    BuildComboBox.SelectedIndex = buildList.FindIndex(x => x.BuildId == buildId);
                    var productList = ProductComboBox.ItemsSource as List <Product>;
                    ProductComboBox.SelectedIndex = productList.FindIndex(x => x.ProductId == productId);
                    var runList = RunComboBox.ItemsSource as List <Run>;
                    RunComboBox.SelectedIndex = runList.FindIndex(x => x.RunId == runId);
                }

                if (!string.IsNullOrEmpty(rootElement.Element("BashLogCollectorHost").Value))
                {
                    BashCollectorCheckBox.IsChecked = true;
                    _addressControl.Text            = rootElement.Element("BashLogCollectorHost").Value;
                }
            }
            else
            {
                MessageBox.Show("Please connect to the correct environment and try loading again", ApplicationName, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }