Exemplo n.º 1
0
        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;
                }
            }
        }
Exemplo n.º 2
0
        internal SubcategoryContentHandler(IBooster booster, IResourcesQuery resourcesQuery, IFaqsQuery faqsQuery)
        {
            _booster = booster;
            var resourceCategories = resourcesQuery.GetCategories();
            var faqCategories      = faqsQuery.GetCategories();

            _categories = resourceCategories.Concat(faqCategories).ToList();
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        protected JobTypesFieldHandler(string fieldName, string sortFieldName, IBooster booster)
        {
            _fieldName = fieldName;
            _booster   = booster;

            if (!string.IsNullOrEmpty(sortFieldName))
            {
                _sortFieldName  = sortFieldName;
                _supportSorting = true;
            }
        }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
        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));
        }
Exemplo n.º 7
0
        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;
            }
        }
Exemplo n.º 8
0
 public CandidateStatusContentHandler(IBooster booster)
 {
     _booster = booster;
 }
Exemplo n.º 9
0
 public EthnicStatusContentHandler(IBooster booster)
 {
     _booster = booster;
 }
Exemplo n.º 10
0
 protected TimestampFieldHandler(string fieldName, TimeGranularity timeGranularity, IBooster booster)
 {
     _fieldName       = fieldName;
     _timeGranularity = timeGranularity;
     _booster         = booster;
 }
Exemplo n.º 11
0
 public JobTypesContentHandler(IBooster booster)
     : base(FieldName.JobTypes, FieldName.JobTypesSort, booster)
 {
 }
Exemplo n.º 12
0
 public LocationContentHandler(IBooster booster, ILocationQuery locationQuery)
     : base(FieldName.Location, null, booster, locationQuery)
 {
 }
Exemplo n.º 13
0
 public ItemTypeContentHandler(IBooster booster)
 {
     _booster = booster;
 }
Exemplo n.º 14
0
 public NameContentHandler(Analyzer analyzer, IBooster booster)
 {
     _analyzer = analyzer;
     _booster  = booster;
 }
Exemplo n.º 15
0
 public VisaStatusContentHandler(IBooster booster)
 {
     _booster = booster;
 }
Exemplo n.º 16
0
 public CreatedTimeContentHandler(IBooster booster)
     : base(FieldName.CreatedTime, TimeGranularity.Hour, booster)
 {
 }
Exemplo n.º 17
0
 public IntegratorContentHandler(IBooster booster)
 {
     _booster = booster;
 }
Exemplo n.º 18
0
 public LastUpdatedContentHandler(IBooster booster)
     : base(FieldName.LastUpdatedDay, TimeGranularity.Day, booster)
 {
 }
Exemplo n.º 19
0
 public CommunityContentHandler(IBooster booster)
 {
     _booster = booster;
 }
Exemplo n.º 20
0
 public SalaryContentHandler(IBooster booster)
     : base(FieldName.MinSalary, FieldName.MaxSalary, booster)
 {
 }
Exemplo n.º 21
0
 public DesiredJobTypesContentHandler(IBooster booster)
     : base(FieldName.DesiredJobTypes, string.Empty, booster)
 {
 }
Exemplo n.º 22
0
 public IndustryContentHandler(IBooster booster, IIndustriesQuery industriesQuery)
     : base(FieldName.Industries, booster, industriesQuery)
 {
 }
Exemplo n.º 23
0
 public PopularityContentHandler(IBooster booster)
 {
     _booster = booster;
 }