private static List<YaSearchResult> YaSearch(string query, int group)
 {
     string user = "******";
     string key = "03.56416762:5589252e96061e5a63e0be3823f0101b.vir.10f8546b09ea0adc51ac1f602746f568";
     Yandex.XML.Search.APICredentials _DefaultCredential = new APICredentials();
     _DefaultCredential.User = user;
     _DefaultCredential.Key = key;
     YandexRegion _region = YandexRegion.GetList().FirstOrDefault(n => n.StringName.Contains("Москва"));
     YandexSearchQuery _query = new YandexSearchQuery(query, group - 1, _DefaultCredential, _region, RequestMethodEnum.POST);
     List<YaSearchResult> resultList = _query.GetResponseToList();
     error_code = _query._error;
     found_docs_human = _query._found;
     return resultList;
 }
        public YandexSearchQuery(string query, int page, APICredentials APICred, YandexRegion region, RequestMethodEnum? requestMethod)
        {
            if (!String.IsNullOrEmpty(query.Trim()))
            {
                _query = query;
                if (region != null) //Если запрос с регионом
                {
                    _region = region;
                }
                else
                {
                    _region = new YandexRegion();
                    _region.Key = -1;
                    _region.StringName = "Региональная привязка отсутсвует";
                }

            }
            _page = page;
            _APICredentials = APICred;
            if (requestMethod != null)
            {
                _requestMethod = (RequestMethodEnum)requestMethod;

            }
            else
            {   //По умолчанию отправляем запрос POST
                _requestMethod = RequestMethodEnum.POST;
            }
            if (_requestMethod == RequestMethodEnum.POST)
            {
                this._responseStream = ResponseStreamPOST();

            }
            else if (_requestMethod == RequestMethodEnum.GET)
            {
                this._responseStream = ResponseStreamGET();

            }
        }