/// <summary> /// Will create an <see cref="ActionExecutionControl"/> if there is a state of <see cref="ItemStateEnum"/>.Waiting passed /// </summary> /// <param name="currentfile"></param> /// <param name="action"></param> /// <param name="state"></param> public void SetDisplayText(string currentfile, string action, ItemStateEnum state) { if (InvokeRequired) { IAsyncResult result = BeginInvoke(new MethodInvoker(delegate { SetDisplayText(currentfile, action, state); })); m_invokes.Add(result); } else { string name = string.Format("{0}{1}", currentfile, action); if (state == ItemStateEnum.Waiting) { m_currentAction = new ActionExecutionControl(); m_currentAction.Margin = new Padding(1); m_currentAction.Dock = DockStyle.Fill; m_currentAction.BackColor = ((actionExecutionTableLayoutPanel.Controls.Count % 2) == 0 ? Color.FromArgb(240, 240, 240) : Color.FromArgb(225, 225, 225)); m_currentAction.Name = name; actionExecutionTableLayoutPanel.Controls.Add(m_currentAction, 0, actionExecutionTableLayoutPanel.RowCount++); } m_currentAction.SetDisplayText(currentfile, action, state); if (state == ItemStateEnum.Completed) { Step(); } } }
private void SetStateText(ItemStateEnum state) { if (InvokeRequired) { Invoke(new MethodInvoker(delegate { SetStateText(state); })); } else { switch (state) { case ItemStateEnum.Waiting: contentActionStateLabel.Text = Properties.Resources.PROGRESS_STATE_WAITING; break; case ItemStateEnum.Initializing: contentActionStateLabel.Text = Properties.Resources.PROGRESS_STATE_INITIALIZING; break; case ItemStateEnum.InProgress: contentActionStateLabel.Text = Properties.Resources.PROGRESS_STATE_INPROGRESS; break; case ItemStateEnum.Completed: contentActionStateLabel.Text = Properties.Resources.PROGRESS_STATE_COMPLETE; break; } Application.DoEvents(); } }
public PolicyActionProgressCallback(IPolicyClientUIManager uiManager, int steps) { m_policyActionProgressDialog = uiManager.PolicyActionProgressDialog ?? uiManager.CreatePolicyActionProgressDialog(false); m_policyActionProgressDialog.SetSteps(steps); m_state = ItemStateEnum.Waiting; }
public void OnScanPolicy(string policyName, string contentName) { m_state = ItemStateEnum.InProgress; if (m_policyActionProgressDialog != null) { m_policyActionProgressDialog.SetDisplayText(contentName, policyName, m_state); } }
/// <summary> /// Update the ContentItem action text and state. /// </summary> /// <param name="currentfile"></param> /// <param name="action"></param> /// <param name="state"></param> public void SetDisplayText(string currentfile, string action, ItemStateEnum state) { if (InvokeRequired) { Invoke(new MethodInvoker(delegate { SetDisplayText(currentfile, action, state); })); } else { if (contentIconPictureBox.Image == null) { Icon icon = IconLoader.GetSystemLargeIcon(currentfile); Bitmap bmp = null; if (icon != null) { bmp = icon.ToBitmap(); bmp.MakeTransparent(); } contentIconPictureBox.Image = bmp; } ContentItemText = currentfile; ContentItemActionText = action; State = state; Application.DoEvents(); } }
public void SetDisplayText(string currentfile, string action, ItemStateEnum state) { }
public void SetDisplayText(string currentfile, string action, ItemStateEnum state) { _pscontrol.SetDiaplayText(currentfile, action); }
public void SetDisplayText(string currentfile, string action, ItemStateEnum state) { if (InvokeRequired) { IAsyncResult result = BeginInvoke(new MethodInvoker(delegate { SetDisplayText(currentfile, action, state); })); m_invokes.Add(result); } else { descriptionLabel.Text = currentfile; subDescriptionLabel.Text = action; if (!Visible) { ShowDialog(); } Step(); Application.DoEvents(); } }
public void OnBeforeExecute(string actionName, string contentName) { m_state = ItemStateEnum.Waiting; m_policyActionProgressDialog.SetDisplayText(contentName, actionName, m_state); }
public void OnAfterExecute(string actionName, string contentName) { m_state = ItemStateEnum.Completed; m_policyActionProgressDialog.SetDisplayText(contentName, actionName, m_state); }