impscanceleventargs.cs

来自「破解的飞信源代码」· CS 代码 · 共 75 行

CS
75
字号
namespace Imps.Client.Core
{
    using System;
    using System.Collections.Generic;

    public class ImpsCancelEventArgs : EventArgs
    {
        private bool _cancel = false;
        private List<ImpsCancelOperationDelegate> _cancelOperations = new List<ImpsCancelOperationDelegate>();
        private List<string> _cancelQuestions = new List<string>();
        private List<string> _cancelReasons = new List<string>();

        public void AddCancelQuestion(string question)
        {
            this._cancelQuestions.Add(question);
        }

        public void AddCancelQuestion(string question, ImpsCancelOperationDelegate operationCallBack)
        {
            this._cancelQuestions.Add(question);
            this._cancelOperations.Add(operationCallBack);
        }

        public void AddCancelReason(string reason)
        {
            this._cancelReasons.Add(reason);
        }

        public bool Cancel
        {
            get
            {
                if (!this._cancel && (this.CancelQuestions.get_Count() <= 0))
                {
                    return (this.CancelReasons.get_Count() > 0);
                }
                return true;
            }
            set
            {
                if (!value)
                {
                    throw new ArgumentException();
                }
                this._cancel = value;
            }
        }

        public ICollection<ImpsCancelOperationDelegate> CancelOperations
        {
            get
            {
                return this._cancelOperations;
            }
        }

        public ICollection<string> CancelQuestions
        {
            get
            {
                return this._cancelQuestions;
            }
        }

        public ICollection<string> CancelReasons
        {
            get
            {
                return this._cancelReasons;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?