private void CheckInbox()
        {
            while (Inbox.Any())
            {
                var message = Inbox.First.Value;
                Inbox.RemoveFirst();
                switch (message)
                {
                case SpeedChangeMessage.Stop:
                    ComputationInfo.IsActive = false;
                    break;

                case SpeedChangeMessage.SpeedUp:
                    TargetOptCenterParams.RunnerPoolSize = (int)(TargetOptCenterParams.RunnerPoolSize / 2);
                    break;

                case SpeedChangeMessage.SlowDown:
                    TargetOptCenterParams.RunnerPoolSize *= 2;
                    break;

                default:
                    break;
                }
            }
        }
示例#2
0
 public bool ContainsLetter(string id)
 {
     if (HasMail)
     {
         return(Inbox.Any(x => x.Id == id));
     }
     return(false);
 }
示例#3
0
 public bool ContainsAuthor(ulong id)
 {
     if (HasMail)
     {
         return(Inbox.Any(x => x.Author.Id == id));
     }
     return(false);
 }
示例#4
0
 public bool HasLetterAt(int i)
 {
     if (HasMail)
     {
         return(Inbox.Any(x => Inbox.IndexOf(x) == i));
     }
     return(false);
 }