Ejemplo n.º 1
0
        /// <summary>
        /// 延迟执行 定时任务
        /// </summary>
        /// <param name="delayTime">毫秒(必须大于10)</param>
        /// <param name="timeDelegate"></param>
        public void AddTimeEvent(long delayTime, TimeDelegate timeDelegate)
        {
            //TODO id 锁
            TimerModel timeModel = new TimerModel(id.Add(), DateTime.Now.Ticks + delayTime, timeDelegate);

            //
            idModelDict.TryAdd(timeModel.id, timeModel);
        }
Ejemplo n.º 2
0
        public void add(string account, string password)
        {
            AccountModel model = new AccountModel();

            model.Account  = account;
            model.password = password;
            model.id       = id.Add(); // 添加1 并且返回

            accountDictionary.Add(account, model);
        }