コード例 #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;
                }
            }
        }
コード例 #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();
        }
コード例 #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;
        }
コード例 #4
0
        protected JobTypesFieldHandler(string fieldName, string sortFieldName, IBooster booster)
        {
            _fieldName = fieldName;
            _booster   = booster;

            if (!string.IsNullOrEmpty(sortFieldName))
            {
                _sortFieldName  = sortFieldName;
                _supportSorting = true;
            }
        }
コード例 #5
0
ファイル: Indexer.cs プロジェクト: formist/LinkMe
        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;
        }
コード例 #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));
        }
コード例 #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;
            }
        }
コード例 #8
0
 public CandidateStatusContentHandler(IBooster booster)
 {
     _booster = booster;
 }
コード例 #9
0
 public EthnicStatusContentHandler(IBooster booster)
 {
     _booster = booster;
 }
コード例 #10
0
 protected TimestampFieldHandler(string fieldName, TimeGranularity timeGranularity, IBooster booster)
 {
     _fieldName       = fieldName;
     _timeGranularity = timeGranularity;
     _booster         = booster;
 }
コード例 #11
0
 public JobTypesContentHandler(IBooster booster)
     : base(FieldName.JobTypes, FieldName.JobTypesSort, booster)
 {
 }
コード例 #12
0
 public LocationContentHandler(IBooster booster, ILocationQuery locationQuery)
     : base(FieldName.Location, null, booster, locationQuery)
 {
 }
コード例 #13
0
 public ItemTypeContentHandler(IBooster booster)
 {
     _booster = booster;
 }
コード例 #14
0
 public NameContentHandler(Analyzer analyzer, IBooster booster)
 {
     _analyzer = analyzer;
     _booster  = booster;
 }
コード例 #15
0
 public VisaStatusContentHandler(IBooster booster)
 {
     _booster = booster;
 }
コード例 #16
0
 public CreatedTimeContentHandler(IBooster booster)
     : base(FieldName.CreatedTime, TimeGranularity.Hour, booster)
 {
 }
コード例 #17
0
 public IntegratorContentHandler(IBooster booster)
 {
     _booster = booster;
 }
コード例 #18
0
 public LastUpdatedContentHandler(IBooster booster)
     : base(FieldName.LastUpdatedDay, TimeGranularity.Day, booster)
 {
 }
コード例 #19
0
 public CommunityContentHandler(IBooster booster)
 {
     _booster = booster;
 }
コード例 #20
0
 public SalaryContentHandler(IBooster booster)
     : base(FieldName.MinSalary, FieldName.MaxSalary, booster)
 {
 }
コード例 #21
0
 public DesiredJobTypesContentHandler(IBooster booster)
     : base(FieldName.DesiredJobTypes, string.Empty, booster)
 {
 }
コード例 #22
0
 public IndustryContentHandler(IBooster booster, IIndustriesQuery industriesQuery)
     : base(FieldName.Industries, booster, industriesQuery)
 {
 }
コード例 #23
0
 public PopularityContentHandler(IBooster booster)
 {
     _booster = booster;
 }