public GlobalSearchSettings(IEnumerable<UniversityWithFaculties> universities, SearchOptions searchOption,
			int fromYear = 1994, int toYear = 1997,
			bool forceBirthday = true)
		{
			FromYear = fromYear;
			ToYear = toYear;

			UserGetter = new GlobalSearch(forceBirthday, FromYear, ToYear, universities, searchOption);
		}
		public CommunitySearchSettings(string groupId, IEnumerable<UniversityWithFaculties> universities,
			SearchOptions searchOption,
			int fromYear = 1994, int toYear = 1997, bool forceBirthday = true)
		{
			FromYear = fromYear;
			ToYear = toYear;

			UserGetter = new CommunitySearch(groupId, forceBirthday, FromYear, ToYear, universities, searchOption);
		}
		public CommunitySearch(string groupId, bool forceBirthday, int fromYear, int toYear,
			IEnumerable<UniversityWithFaculties> universities, SearchOptions searchOption)
			: base(forceBirthday, fromYear, toYear, universities, searchOption)
		{
			_groupId = groupId;
		}
		private void SearchTab_OnSelected(object sender, RoutedEventArgs e)
		{
			if (_universities.Count == 0 || _universities.All(u => u.Faculties.Count == 0))
			{
				MessageBox.Show("Необходимо выбрать ВУЗы и факультеты!", "Внимание!", MessageBoxButton.OK, MessageBoxImage.Warning);
				e.Handled = true;
				SearchTab.IsSelected = false;
				SettingsTab.IsSelected = true;
				return;
			}

			if (GroupSearch.IsChecked == true && string.IsNullOrWhiteSpace(GroupId.Text))
			{
				MessageBox.Show("Необходимо указать ID группы, в которой требуется искать!", "Внимание!", MessageBoxButton.OK,
					MessageBoxImage.Warning);
				e.Handled = true;
				SearchTab.IsSelected = false;
				SettingsTab.IsSelected = true;
				return;
			}

			GenderOptions gender;
			if (UnknownGender.IsChecked == true)
				if (MaleGender.IsChecked == true)
					gender = FemaleGender.IsChecked == true ? GenderOptions.All : GenderOptions.MaleAndUnknown;
				else if (FemaleGender.IsChecked == true)
					gender = GenderOptions.FemaleAndUnknown;
				else
					gender = GenderOptions.Unknown;
			else if (MaleGender.IsChecked == true && FemaleGender.IsChecked == true)
				gender = GenderOptions.MaleAndFemale;
			else if (MaleGender.IsChecked == true)
				gender = GenderOptions.Male;
			else if (FemaleGender.IsChecked == true)
				gender = GenderOptions.Female;
			else
				gender = GenderOptions.Unknown;

			var relations = new List<RelationType>();
			if (UnknownRelation.IsChecked == false)
				relations.Add(RelationType.Unknown);
			if (Single.IsChecked == false)
				relations.Add(RelationType.NotMarried);
			if (InActiveSearch.IsChecked == false)
				relations.Add(RelationType.InActiveSearch);
			if (HasFriend.IsChecked == false)
				relations.Add(RelationType.HasFriend);
			if (Engaged.IsChecked == false)
				relations.Add(RelationType.Engaged);
			if (Married.IsChecked == false)
				relations.Add(RelationType.Married);
			if (Amorous.IsChecked == false)
				relations.Add(RelationType.Amorous);
			if (ItsComplex.IsChecked == false)
				relations.Add(RelationType.ItsComplex);

			var options = new SearchOptions(gender, relations);

			if (GroupSearch.IsChecked == true)
			{
				_settings = new CommunitySearchSettings(groupId: GroupId.Text, universities: _universities, searchOption: options,
					fromYear: Convert.ToInt32(StartYear.Text), toYear: Convert.ToInt32(StopYear.Text),
					forceBirthday: ForceBirthday.IsChecked == true);
			}
			else
			{
				_settings = new GlobalSearchSettings(universities: _universities, searchOption: options,
					fromYear: Convert.ToInt32(StartYear.Text), toYear: Convert.ToInt32(StopYear.Text),
					forceBirthday: ForceBirthday.IsChecked == true);
			}
		}
		public GlobalSearch(bool forceBirthday, int fromYear, int toYear, IEnumerable<UniversityWithFaculties> universities,
			SearchOptions searchOptions)
			: base(forceBirthday, fromYear, toYear, universities, searchOptions)
		{
		}