/// <summary>
        /// Initializes a new instance of the <see cref="SessionConfigurationWizard"/> class.
        /// </summary>
        public SessionConfigurationWizard(List <Guid> scenarioIds)
        {
            InitializeComponent();

            UserInterfaceStyler.Configure(this, FormStyle.FixedDialog);
            main_RadWizard.HelpButton.Visibility = ElementVisibility.Hidden;
            main_RadWizard.FinishButton.Text     = "Start Session";

            // Add controls to the wizard pages
            if (scenarioIds.Count > 1)
            {
                AddPage <WizardScenarioBatchPage>(scenarioSelection_WizardPage);
            }
            else
            {
                AddPage <WizardScenarioSelectionPage>(scenarioSelection_WizardPage);
            }
            AddPage <WizardAssetReservationPage>(assetReservation_WizardPage);
            AddPage <WizardDeviceSetupPage>(deviceSetup_WizardPage);
            AddPage <WizardSessionInitializationPage>(summary_WizardPage);

            // Initialize the configuration
            _configuration = new WizardConfiguration();
            _configuration.Ticket.ScenarioIds = scenarioIds;
        }
        /// <summary>
        /// Initializes the wizard page with the specified <see cref="WizardConfiguration"/>.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        public virtual bool Initialize(WizardConfiguration configuration)
        {
            Ticket = configuration.Ticket;
            Guid scenarioId = Ticket.ScenarioIds.FirstOrDefault();

            if (STFDispatcherManager.Dispatcher == null && STFDispatcherManager.ConnectToDispatcher() == false)
            {
                //The user canceled the connect dialog
                return(false);
            }

            using (EnterpriseTestContext context = new EnterpriseTestContext())
            {
                // Load the specified scenario (if there is one)
                if (scenarioId != Guid.Empty)
                {
                    LoadScenario(scenarioId, context);
                    LoadComboBoxes(context);
                }
            }

            // If this is not the first time we have entered this step, the user
            // must have come back from some point later in the wizard.
            // Make sure the dispatcher doesn't hang onto configuration from the previous try.
            if (!_initial)
            {
                SessionClient.Instance.Close(Ticket.SessionId);
            }

            if (_scenario != null && Ticket.SessionId != null && Ticket.AssociatedProductList.Count != 0)
            {
                foreach (var item in Ticket.AssociatedProductList)
                {
                    _scenarioProducts.Where(n => n.ProductId == item.AssociatedProductId && n.Vendor == item.Vendor && n.Version == item.Version).FirstOrDefault().Active = item.Active;
                }
                scenarioProductBindingSource.Clear();
                scenarioProductBindingSource.DataSource = _scenarioProducts;
                scenarioProductBindingSource.ResetBindings(true);
            }
            deviceOffline_CheckBox.Checked = Ticket.RemoveUnresponsiveDevices;

            environment_Label.Text = "{0} {1} Environment".FormatWith(GlobalSettings.Items[Setting.Organization], GlobalSettings.Items[Setting.Environment]);

            if (string.IsNullOrEmpty(logLocation_TextBox.Text))
            {
                logLocation_TextBox.Text = GlobalSettings.WcfHosts[WcfService.DataLog];
            }
            _initial = false;

            dispatcher_Label.Text = STFDispatcherManager.Dispatcher.HostName;

            if (!GlobalSettings.IsDistributedSystem)
            {
                this.settings_TabControl.TabPages.Remove(this.virtualMachineSelection_TabPage);
            }

            return(true);
        }
Exemple #3
0
        /// <summary>
        /// Initializes the wizard page with the specified <see cref="WizardConfiguration"/>.
        /// </summary>
        /// <param name="configuration">The <see cref="WizardConfiguration"/>.</param>
        public bool Initialize(WizardConfiguration configuration)
        {
            Ticket     = configuration.Ticket;
            _scenarios = new BindingList <ScenarioSelectionItem>();
            scenarios_DataGridView.DataSource = null;

            if (STFDispatcherManager.Dispatcher == null && STFDispatcherManager.ConnectToDispatcher() == false)
            {
                //The user canceled the connect dialog
                return(false);
            }

            using (new BusyCursor())
            {
                using (EnterpriseTestContext context = new EnterpriseTestContext())
                {
                    foreach (EnterpriseScenario scenario in EnterpriseScenario.Select(context, Ticket.ScenarioIds))
                    {
                        _scenarios.Add(new ScenarioSelectionItem(scenario));
                    }

                    LoadComboBoxes(context);
                }

                _bindingSource = new BindingSource(_scenarios, string.Empty);
                scenarios_DataGridView.DataSource = _bindingSource;
            }

            //Set data from Ticket
            if (Ticket.SessionId != null)
            {
                SetEstimatedRunTime();
                sessionName_ComboBox.Text = string.IsNullOrEmpty(Ticket.SessionName) ? "Multiple Scenarios" : Ticket.SessionName;
            }

            if (!_initial)
            {
                SessionClient.Instance.Close(Ticket.SessionId);

                sessionType_ComboBox.SelectedText = Ticket.SessionType;

                if (!string.IsNullOrEmpty(Ticket.EmailAddresses))
                {
                    runtime_NumericUpDown.Value = Math.Min(Ticket.DurationHours, runtime_NumericUpDown.Maximum);
                }
            }

            environment_Label.Text = "{0} {1} Environment".FormatWith(GlobalSettings.Items[Setting.Organization], GlobalSettings.Items[Setting.Environment]);
            dispatcher_Label.Text  = STFDispatcherManager.Dispatcher.HostName;
            _initial = false;

            return(true);
        }
Exemple #4
0
        /// <summary>
        /// Initializes the wizard page with the specified <see cref="WizardConfiguration"/>.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        public bool Initialize(WizardConfiguration configuration)
        {
            _assets = configuration.SessionAssets;

            AvailableDeviceSet <AssetDetail> assetSet = new AvailableDeviceSet <AssetDetail>(_assets);
            var printDevices  = assetSet.Devices.OfType <PrintDeviceDetail>().ToList();
            var cameraDevices = assetSet.Devices.OfType <CameraDetail>().ToList();

            printerSetup_GridView.DataSource = printDevices;
            printerSetup_GridView.BestFitColumns();

            cameraSetup_GridView.DataSource = cameraDevices;
            cameraSetup_GridView.BestFitColumns();

            return(printDevices.Any() || cameraDevices.Any());
        }
Exemple #5
0
        /// <summary>
        /// Initializes the wizard page with the specified <see cref="WizardConfiguration"/>.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        public bool Initialize(WizardConfiguration configuration)
        {
            _configuration = configuration;

            // Make an initial reservation
            reserve_Button_Click(null, EventArgs.Empty);
            LoadReservedForComboBox();
            // Check to see if there are no assets involved
            if (!_configuration.SessionAssets.Any())
            {
                assetReservation_GridView.Visible = false;
                assetReservationKey_Label.Visible = false;
                //assetReservationKey_TextBox.Visible = false;
                assetReservationKey_ComboBox.Visible   = false;
                assetReservationRefresh_Button.Visible = false;
                header_Label.Text = "No assets are required for this session.  Press Next to continue.";
            }

            return(true);
        }
        /// <summary>
        /// Initializes the wizard page with the specified <see cref="WizardConfiguration"/>.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        public bool Initialize(WizardConfiguration configuration)
        {
            _sessionId  = configuration.Ticket.SessionId;
            _statusRows = new BindingList <AssetStatusRow>();
            assetStatus_GridView.DataSource = _statusRows;

            SessionClient.Instance.SessionStateReceived             += SessionStateReceived;
            SessionClient.Instance.SessionStartupTransitionReceived += SessionStartupTransitionReceived;
            SessionClient.Instance.SessionMapElementReceived        += SessionMapElementReceived;

            if (_finishButton != null)
            {
                _finishButton.Enabled = false;
            }

            TraceFactory.Logger.Debug("Calling Stage");
            SessionClient.Instance.Stage(_sessionId, configuration.SessionAssets);

            return(true);
        }