Exemplo n.º 1
0
        protected void CreateBaseWorkerDetail(OfficeWorker resource, OfficeWorkerDetail detail)
        {
            detail.ResourceId    = resource.VirtualResourceId;
            detail.ResourceType  = EnumUtil.Parse <VirtualResourceType>(resource.ResourceType);
            detail.Name          = resource.Name;
            detail.Description   = resource.Description;
            detail.InstanceCount = resource.InstanceCount;
            detail.Platform      = resource.Platform;
            detail.Enabled       = resource.Enabled;

            detail.RandomizeActivities    = resource.RandomizeActivities;
            detail.RandomizeStartupDelay  = resource.RandomizeStartupDelay;
            detail.MinStartupDelay        = resource.MinStartupDelay;
            detail.MaxStartupDelay        = resource.MaxStartupDelay;
            detail.RandomizeActivityDelay = resource.RandomizeActivityDelay;
            detail.MinActivityDelay       = resource.MinActivityDelay;
            detail.MaxActivityDelay       = resource.MaxActivityDelay;
            detail.RepeatCount            = resource.RepeatCount;
            detail.ExecutionMode          = resource.ExecutionMode;
            detail.DurationTime           = resource.DurationTime;
            detail.SecurityGroups         = resource.SecurityGroups;
            detail.ResourcesPerVM         = resource.ResourcesPerVM ?? 1;

            if (resource.ExecutionMode == ExecutionMode.Scheduled)
            {
                detail.ExecutionSchedule = resource.ExecutionSchedule;
            }
        }
Exemplo n.º 2
0
 public void Work(OfficeWorker obj)
 {
     //obj.Anger();//Error
     obj.Friendly();
     //obj.Quiet();//Error
     obj.Matured();
     obj.Professional();
 }
Exemplo n.º 3
0
        public static void Add(this Collection <VirtualResource> resources, string platform, int resourcesPerVM, int instanceCount)
        {
            OfficeWorker ow = new OfficeWorker(Guid.NewGuid(), scenarioId, folderId);

            ow.Name           = string.Format("OfficeWorker #{0}", resources.Count + 1);
            ow.Platform       = platform;
            ow.ResourcesPerVM = resourcesPerVM;
            ow.InstanceCount  = instanceCount;
            resources.Add(ow);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sets up any child controls.
        /// </summary>
        /// <param name="officeWorker">The office worker.</param>
        protected override void SetupChildControls(OfficeWorker officeWorker)
        {
            var yOffset = 120;

            var location = workflow_GroupBox.Location;

            workflow_GroupBox.Location = new Point(location.X, location.Y - yOffset);

            location = workerQuantity_GroupBox.Location;
            workerQuantity_GroupBox.Location = new Point(location.X, location.Y - yOffset);

            location = startup_TimeDelayControl.Location;
            startup_TimeDelayControl.Location = new Point(location.X, location.Y - yOffset);

            virtualMachinePlatform_ComboBox.Visible = false;
            platform_Label.Visible = false;

            instanceCount_Label.Text     = "Total Testers";
            workerQuantity_GroupBox.Text = "Solution Testers Count";

            workersPerVM_Label.Visible = workersPerVM_UpDown.Visible = false;

            using (AssetInventoryContext context = DbConnect.AssetInventoryContext())
            {
                bool enablePools = context.DomainAccountPools.Count() > 0;
                poolCredentialRadioButton.Enabled = enablePools;
                userPool_ComboBox.Enabled         = enablePools;
                userPool_Label.Enabled            = enablePools;
            }

            configuration_TabControl.TabPages.Remove(userGroups_TabPage);

            Worker.Platform = "LOCAL";

            userPool_ComboBox.Location = new Point(127, 132);
            userPool_ComboBox.Visible  = true;
            solutionTesterActivityAccountsGroupBox.Controls.Add(userPool_ComboBox);
            userPool_Label.Location = new Point(40, 135);
            userPool_Label.Visible  = true;
            solutionTesterActivityAccountsGroupBox.Controls.Add(userPool_Label);

            manualCredentialRadioButton.CheckedChanged          += manualCredentialRadioButton_CheckedChanged;
            desktopCredentialRadioButton.CheckedChanged         += desktopCredentialRadioButton_CheckedChanged;
            poolCredentialRadioButton.CheckedChanged            += poolCredentialRadioButton_CheckedChanged;
            solutionTesterUseDesktopRadioButton.CheckedChanged  += solutionTesterUseDesktopRadioButton_CheckedChanged;
            solutionTesterUseSelectedRadioButton.CheckedChanged += solutionTesterUseSelectedRadioButton_CheckedChanged;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Sets up any child controls.
        /// </summary>
        /// <param name="officeWorker">The office worker.</param>
        protected override void SetupChildControls(OfficeWorker officeWorker)
        {
            if (officeWorker == null)
            {
                throw new ArgumentNullException("officeWorker");
            }

            CitrixWorker worker = officeWorker as CitrixWorker;

            citrixServer_ComboBox.Visible = citrixServer_Label.Visible = true;
            appOptions_GroupBox.Visible   = true;
            workersPerVM_Label.Visible    = workersPerVM_UpDown.Visible = false;

            if (worker.RunMode != CitrixWorkerRunMode.None)
            {
                citrixWorker_CheckBox.Checked = true;
                pubApp_RadioButton.Checked    = (worker.RunMode == CitrixWorkerRunMode.PublishedApp);
                desktop_RadioButton.Checked   = (worker.RunMode == CitrixWorkerRunMode.Desktop);
            }
            else
            {
                pubApp_RadioButton.Checked  = true;
                pubApp_RadioButton.Enabled  = false;
                desktop_RadioButton.Enabled = false;
            }

            pubApp_CheckBox.Checked = !string.IsNullOrEmpty(worker.PublishedApp);

            citrixWorker_CheckBox.CheckedChanged += runWorkerOrApp_CheckedChanged;
            pubApp_CheckBox.CheckedChanged       += runWorkerOrApp_CheckedChanged;

            desktop_RadioButton.CheckedChanged += desktop_RadioButton_CheckedChanged;
            pubApp_RadioButton.CheckedChanged  += pubApp_RadioButton_CheckedChanged;

            pubApp_ComboBox.Text = worker.PublishedApp;

            using (AssetInventoryContext context = DbConnect.AssetInventoryContext())
            {
                string serverType = ServerType.Citrix.ToString();
                var    servers    = context.FrameworkServers.Where(n => n.ServerTypes.Any(m => m.Name == serverType) && n.Active).OrderBy(n => n.HostName);
                _citrixServers = new Collection <FrameworkServer>(servers.ToList());

                if (_citrixServers.Any())
                {
                    citrixServer_ComboBox.AddServers(servers);

                    var hostName = worker.ServerHostname;
                    if (!_citrixServers.Any(x => x.HostName.Equals(hostName)))
                    {
                        hostName = _citrixServers.First().HostName;
                    }
                    citrixServer_ComboBox.SetSelectedServer(hostName);

                    var appNames = SelectApplicationNames(context, hostName);
                    pubApp_ComboBox.DataSource = appNames;

                    if (appNames.Contains <string>(worker.PublishedApp))
                    {
                        pubApp_ComboBox.SelectedItem = worker.PublishedApp;
                    }
                }
            }

            UpdateControls();

            citrixServer_ComboBox.SelectedIndexChanged += citrixServer_ComboBox_SelectedIndexChanged;
        }