示例#1
0
            /// <summary>
            /// Set controles for state: Exception
            /// Add exception to ListView
            /// </summary>
            internal void SetProgress_Exception(TaskException exception)
            {
                System.Drawing.Color ItemBackground;
                switch (exception.Level)
                {
                case TaskException.ExceptionLevel.Slight:
                    ItemBackground = System.Drawing.Color.FromArgb(255, 255, 192);
                    break;

                case TaskException.ExceptionLevel.Medium:
                    ItemBackground = System.Drawing.Color.FromArgb(255, 224, 192);
                    break;

                case TaskException.ExceptionLevel.Critical:
                    ItemBackground = System.Drawing.Color.FromArgb(255, 192, 192);
                    break;

                default:
                    ItemBackground = System.Drawing.SystemColors.Window;
                    break;
                }

                ListViewItem ExItem = new ListViewItem
                {
                    BackColor = ItemBackground,
                    Tag       = exception,
                    Text      = (this._progressControle._exceptionListView.Items.Count + 1).ToString()
                };

                ExItem.SubItems.Add(exception.Source);
                ExItem.SubItems.Add(exception.Target);
                ExItem.SubItems.Add(exception.Text);

                ListViewInv.AddItem(this._progressControle._exceptionListView, ExItem);
                TabPageInv.ImageIndex(this._progressControle._conclusionTabPage, EXCEPTION_ICON_INDEX);
                TextBoxInv.Text(this._progressControle._exceptionCount, string.Format(FORMAT_VALUE, this._progressControle._exceptionListView.Items.Count));
            }
示例#2
0
 internal void ClearExceptionlog()
 {
     TabPageInv.ImageIndex(this._progressControle._conclusionTabPage, -1);
     ListViewInv.ClearItems(this._progressControle._exceptionListView);
     TextBoxInv.Text(this._progressControle._exceptionCount, "0");
 }