private readonly bool[] _homeLocations; // indexed by location ID public LocationFieldHandler(string locationField, string relocationsField, IBooster booster, ILocationQuery locationQuery) { _locationFieldName = locationField; _relocationsFieldName = relocationsField; _booster = booster; // Build the world index. _worldIndex = new BitWorldIndex(); _worldIndex.BuildUp(locationQuery, true); // Mark locations in the home country. var homeCountry = locationQuery.GetCountry("Australia"); var homePointSet = _worldIndex.GetPointSet(homeCountry.Id, 0); var maxPointSetId = _worldIndex.GetMaxPointSetId(); _homeLocations = new bool[maxPointSetId + 1]; foreach (var location in _worldIndex.GetKnownLocations()) { if (location.Value.Overlaps(homePointSet)) { _homeLocations[location.Key] = true; } } }
internal SubcategoryContentHandler(IBooster booster, IResourcesQuery resourcesQuery, IFaqsQuery faqsQuery) { _booster = booster; var resourceCategories = resourcesQuery.GetCategories(); var faqCategories = faqsQuery.GetCategories(); _categories = resourceCategories.Concat(faqCategories).ToList(); }
public IndustryFieldHandler(string fieldName, IBooster booster, IIndustriesQuery industriesQuery) { _fieldName = fieldName; _booster = booster; _allIndustryIds = new HashSet <Guid>(industriesQuery.GetIndustries().Select(i => i.Id)); var otherIndustry = industriesQuery.GetIndustry("Other"); _otherIndustryId = otherIndustry == null ? (Guid?)null : otherIndustry.Id; }
protected JobTypesFieldHandler(string fieldName, string sortFieldName, IBooster booster) { _fieldName = fieldName; _booster = booster; if (!string.IsNullOrEmpty(sortFieldName)) { _sortFieldName = sortFieldName; _supportSorting = true; } }
public Indexer(IBooster booster, IJobAdFlagListsQuery jobAdFlagListsQuery) { _contentAnalyzer = new SimpleAnalyzer(); _contentHandler = new ContentHandler(); _salaryHandler = new SalaryContentHandler(booster); _createdTimeHandler = new CreatedTimeContentHandler(booster); _integratorHandler = new IntegratorContentHandler(booster); _jobTypesHandler = new JobTypesContentHandler(booster); _jobAdFlagListsQuery = jobAdFlagListsQuery; }
protected SalaryFieldHandler(string minFieldName, string maxFieldName, IBooster booster) { _minFieldName = minFieldName; _maxFieldName = maxFieldName; _booster = booster; _nullSalaryFilter = NumericRangeFilter.newIntRange(_maxFieldName, new java.lang.Integer(0), new java.lang.Integer(0), true, true); // nonNullSalary <=> NOT nullSalary _nonNullSalaryFilter = new BooleanFilter(); _nonNullSalaryFilter.add(new FilterClause(_nullSalaryFilter, BooleanClause.Occur.MUST_NOT)); }
public BoosterListViewModel(GameViewModel gameViewModel) { // EVIP: using reflection to find all non-abstract implementations of an interface var currentAssembly = this.GetType().GetTypeInfo().Assembly; // EVIP: using Linq for searching var allIBoosterTypes = currentAssembly.DefinedTypes .Where(t => t.ImplementedInterfaces.Any(i => i == typeof(IBooster))) .Where(t => !t.IsAbstract).ToList(); foreach (var boosterType in allIBoosterTypes) { // EVIP: using reflection to instantiate objects IBooster booster = Activator.CreateInstance(boosterType.AsType()) as IBooster; booster.GameViewModel = gameViewModel; } }
public CandidateStatusContentHandler(IBooster booster) { _booster = booster; }
public EthnicStatusContentHandler(IBooster booster) { _booster = booster; }
protected TimestampFieldHandler(string fieldName, TimeGranularity timeGranularity, IBooster booster) { _fieldName = fieldName; _timeGranularity = timeGranularity; _booster = booster; }
public JobTypesContentHandler(IBooster booster) : base(FieldName.JobTypes, FieldName.JobTypesSort, booster) { }
public LocationContentHandler(IBooster booster, ILocationQuery locationQuery) : base(FieldName.Location, null, booster, locationQuery) { }
public ItemTypeContentHandler(IBooster booster) { _booster = booster; }
public NameContentHandler(Analyzer analyzer, IBooster booster) { _analyzer = analyzer; _booster = booster; }
public VisaStatusContentHandler(IBooster booster) { _booster = booster; }
public CreatedTimeContentHandler(IBooster booster) : base(FieldName.CreatedTime, TimeGranularity.Hour, booster) { }
public IntegratorContentHandler(IBooster booster) { _booster = booster; }
public LastUpdatedContentHandler(IBooster booster) : base(FieldName.LastUpdatedDay, TimeGranularity.Day, booster) { }
public CommunityContentHandler(IBooster booster) { _booster = booster; }
public SalaryContentHandler(IBooster booster) : base(FieldName.MinSalary, FieldName.MaxSalary, booster) { }
public DesiredJobTypesContentHandler(IBooster booster) : base(FieldName.DesiredJobTypes, string.Empty, booster) { }
public IndustryContentHandler(IBooster booster, IIndustriesQuery industriesQuery) : base(FieldName.Industries, booster, industriesQuery) { }
public PopularityContentHandler(IBooster booster) { _booster = booster; }