Пример #1
0
        public static void generateData(ISearchSubscriber subscriber)
        {
            subscriber.onSearchStarted();
            Random rnd = new Random();

            for (int i = 0; i < COUNT; i++)
            {
                if (isStopped)
                {
                    isStopped = false;
                    subscriber.onSearchFinished();
                    break;
                }

                Thread.Sleep(200);
                subscriber.onItemFoundEvent(new ItemUpdatedEvent("TEST ITEM " + rnd.Next(1, 50000)));
            }
            subscriber.onSearchFinished();
        }
 public override List <VkCommands.Data.IData> search(ISearchProfile sProfile, ISearchSubscriber subscriber)
 {
     isStopped = false;
     subscriber.onSearchStarted();
     if (sProfile.GetType() == typeof(PeopleSearchProfile))
     {
         List <IData> data = searchPeople(sProfile, 0, subscriber);
         subscriber.onSearchFinished();
         return(data);
     }
     else if (sProfile.GetType() == typeof(GroupSearchProfile))
     {
         return(searchGroup(sProfile, 0));
     }
     else
     {
         return(null);
     }
 }