示例#1
0
        public SchoolService(IIdProvider provider,
            IRepository<IStudent> studentRepository,
            IRepository<ITeacher> teacherRepository)
        {
            this.idProvider = provider;

            this.teachers = teacherRepository;
            this.students = studentRepository;
        }
        public override HashSet<uint> Evaluate(IIdProvider provider)
        {
            HashSet<uint> leftSet = Left.Evaluate(provider);
            if (leftSet.Count == 0) return leftSet;

            HashSet<uint> rightSet = Right.Evaluate(provider);
            leftSet.IntersectWith(rightSet);

            return leftSet;
        }
示例#3
0
 public HashSet<uint> Evaluate(IIdProvider provider)
 {
     HashSet<uint> results = new HashSet<uint>();
     ICollection<uint> tryResults;
     if (provider.TryGetValue(this.Term, out tryResults))
     {
         results.UnionWith(tryResults);
     }
     return results;
 }
 public CreateTournamentCommandHandler(ITournamentRepository tournament_repo,
                                       IPersonRepository person_repo,
                                       IIdProvider id_provider, IDateProvider date_Provider,
                                       TournamentDirector director)
 {
     _tournament_repo = tournament_repo;
     _person_repo     = person_repo;
     _id_provider     = id_provider;
     _date_Provider   = date_Provider;
     _director        = director;
 }
示例#5
0
        public HashSet <uint> Evaluate(IIdProvider provider)
        {
            HashSet <uint>     results = new HashSet <uint>();
            ICollection <uint> tryResults;

            if (provider.TryGetValue(this.Term, out tryResults))
            {
                results.UnionWith(tryResults);
            }
            return(results);
        }
        public void Initialize()
        {
            var q = new MockQ();

            _bus                   = new MockEventBus(q);
            _store                 = new EventStoreCrudMock <int>();
            _idProvider            = new EventIdProvider <int>(_store);
            _repo                  = new TransactionnalInputAggregateRepo(_store, _bus, _idProvider);
            _saver                 = _repo as ITransactionnalSave <InputAggregate, int>;
            _eventListenerRegister = q.GetHandlerRegister("Mock");
        }
 public SetAccountLegalEntityPublicHashIdsJob(
     IIdBroker idIdBroker,
     SetAccountLegalEntityPublicHashIdsProcessor accountProcessor,
     SetAccountLegalEntityPublicHashIdsIdProvider accountIdProvider,
     ILog log)
 {
     _idIdBroker        = idIdBroker;
     _accountProcessor  = accountProcessor;
     _accountIdProvider = accountIdProvider;
     _log = log;
 }
示例#8
0
 public TransactionManager(
     IQuik quik,
     IIdProvider idProvider,
     IPersistentStorage persistentStorage,
     ILogger <TransactionManager> logger)
 {
     _quik              = quik;
     _idProvider        = idProvider;
     _persistentStorage = persistentStorage;
     _logger            = logger;
 }
 public CreateTimeEntryInteractor(
     IIdProvider idProvider,
     ITimeService timeService,
     ITogglDataSource dataSource,
     IAnalyticsService analyticsService,
     ITimeEntryPrototype prototype,
     DateTimeOffset startTime,
     TimeSpan?duration)
     : this(idProvider, timeService, dataSource, analyticsService, prototype, startTime, duration,
            prototype.Duration.HasValue ? TimeEntryStartOrigin.Manual : TimeEntryStartOrigin.Timer)
 {
 }
示例#10
0
        private static Property GetFieldsProperty(IIdProvider idProvider, Identity listIdentity)
        {
            //Get fields
            Property fieldsProperty = new Property
            {
                Id       = idProvider.GetActionId(),
                Name     = "Fields",
                ParentId = listIdentity.Id
            };

            return(fieldsProperty);
        }
示例#11
0
        public TimeEntriesDataSource(IIdProvider idProvider, IRepository <IDatabaseTimeEntry> repository)
        {
            Ensure.Argument.IsNotNull(repository, nameof(repository));

            this.repository = repository;
            this.idProvider = idProvider;

            CurrentlyRunningTimeEntry = currentTimeEntrySubject.AsObservable().DistinctUntilChanged();

            repository
            .GetAll(te => te.Stop == null)
            .Subscribe(onRunningTimeEntry);
        }
示例#12
0
 public NetworkingModule(string ip, int port, IIdProvider <ulong> idProvider,
                         INetworkingEntityFactory entityFactory,
                         IIdProvider <string> tokenProvider, INetworkingClientFactory clientFactory,
                         IAuthenticationProviderFactory authenticationProviderFactory,
                         IStreamingHandlerFactory streamingHandlerFactory)
 {
     IdProvider    = idProvider;
     TokenProvider = tokenProvider;
     EntityPool    = new NetworkingEntityPool(idProvider, entityFactory);
     ClientPool    = new NetworkingClientPool(tokenProvider, clientFactory);
     Streamer      = new EntityStreamer();
     Server        = new Server(ip, port, ClientPool, authenticationProviderFactory, Streamer, streamingHandlerFactory);
 }
示例#13
0
        internal View(object viewModel, Action <Change> addChange, IIdProvider idProvider)
        {
            Contract.Requires(viewModel != null);
            Contract.Requires(addChange != null);
            Contract.Requires(idProvider != null);
            Contract.Requires(IncludeDeep(viewModel.GetType()), $"An object of type '{viewModel.GetType()}' does not need a view");

            this.AddChange  = addChange;
            this.idProvider = idProvider;
            this.views      = new List <View>();

            registerViewModel(viewModel);
        }
示例#14
0
        public void AddOptionClass(IIdProvider <AOptionClass> provider)
        {
            var index = _optionClasses.FindIndex(o => o.Id == provider.Id);

            if (index < 0)
            {
                _optionClasses.Add(provider);
            }
            else
            {
                _optionClasses[index] = provider;
            }
        }
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            int updateActionId = idProvider.GetActionId();

            IdentityPath = idProvider.GetActionId();
            int propertiesId = idProvider.GetActionId();

            List <Parameter> parameters = new List <Parameter>();

            foreach (CSOMItemField field in FieldsToUpdate)
            {
                parameters.AddRange(field.GetRequestParameters());
            }

            return(new List <ActionObjectPath>()
            {
                new ActionObjectPath()
                {
                    Action = new MethodAction()
                    {
                        Id = updateActionId,
                        Name = "SetFieldValue",
                        ObjectPathId = propertiesId.ToString(),
                        Parameters = parameters
                    },
                    ObjectPath = new Property()
                    {
                        Id = propertiesId,
                        ParentId = IdentityPath,
                        Name = PropertyName
                    }
                },
                new ActionObjectPath()
                {
                    Action = new MethodAction()
                    {
                        Id = updateActionId,
                        ObjectPathId = IdentityPath.ToString(),
                        Name = "Update",
                        Parameters = new List <Parameter>()
                    },
                    ObjectPath = new Identity()
                    {
                        Id = IdentityPath,
                        Name = $"121a659f-e03e-2000-4281-1212829d67dd|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{SiteId}:web:{WebId}{ObjectId}"
                    }
                }
            });
        }
示例#16
0
        /// <summary>
        /// Returns the specified object as reference if it is a view model, otherwise returns the object itself.
        /// </summary>
        public static object AsReferenceOrDefault(object obj, IIdProvider idProvider)
        {
            Contract.Requires(idProvider != null);

            if (obj == null)
            {
                return(null);
            }
            if (IncludeDeep(obj.GetType()))
            {
                int id = idProvider[obj];
                return(Create(id));
            }
            return(obj);
        }
        public TaskManager(IIdProvider provider, ILogger logger)
        {
            if (provider == null)
            {
                throw new ArgumentNullException();
            }

            if (logger == null)
            {
                throw new ArgumentNullException();
            }
            this.idProvider = provider;
            this.logger     = logger;
            this.Tasks      = new List <ITask>();
        }
示例#18
0
        public override HashSet <uint> Evaluate(IIdProvider provider)
        {
            HashSet <uint> leftSet = Left.Evaluate(provider);

            if (leftSet.Count == 0)
            {
                return(leftSet);
            }

            HashSet <uint> rightSet = Right.Evaluate(provider);

            leftSet.IntersectWith(rightSet);

            return(leftSet);
        }
        public CreateProjectInteractor(
            IIdProvider idProvider,
            ITimeService timeService,
            IDataSource <IThreadSafeProject, IDatabaseProject> dataSource,
            CreateProjectDTO dto)
        {
            Ensure.Argument.IsNotNull(dto, nameof(dto));
            Ensure.Argument.IsNotNull(dataSource, nameof(dataSource));
            Ensure.Argument.IsNotNull(idProvider, nameof(idProvider));
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));

            this.dto         = dto;
            this.dataSource  = dataSource;
            this.idProvider  = idProvider;
            this.timeService = timeService;
        }
示例#20
0
        public CreateDefaultWorkspaceInteractor(
            IIdProvider idProvider,
            ITimeService timeService,
            ISingletonDataSource <IThreadSafeUser> userDataSource,
            IDataSource <IThreadSafeWorkspace, IDatabaseWorkspace> workspaceDataSource)
        {
            Ensure.Argument.IsNotNull(idProvider, nameof(idProvider));
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));
            Ensure.Argument.IsNotNull(userDataSource, nameof(userDataSource));
            Ensure.Argument.IsNotNull(workspaceDataSource, nameof(workspaceDataSource));

            this.idProvider          = idProvider;
            this.timeService         = timeService;
            this.userDataSource      = userDataSource;
            this.workspaceDataSource = workspaceDataSource;
        }
        public ContinueMostRecentTimeEntryInteractor(
            IIdProvider idProvider,
            ITimeService timeService,
            ITogglDataSource dataSource,
            IAnalyticsService analyticsService)
        {
            Ensure.Argument.IsNotNull(idProvider, nameof(idProvider));
            Ensure.Argument.IsNotNull(dataSource, nameof(dataSource));
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));
            Ensure.Argument.IsNotNull(analyticsService, nameof(analyticsService));

            this.idProvider       = idProvider;
            this.dataSource       = dataSource;
            this.timeService      = timeService;
            this.analyticsService = analyticsService;
        }
        public InteractorFactory(
            IIdProvider idProvider,
            ITimeService timeService,
            ITogglDataSource dataSource,
            IUserPreferences userPreferences,
            IAnalyticsService analyticsService,
            INotificationService notificationService,
            IIntentDonationService intentDonationService,
            IApplicationShortcutCreator shortcutCreator,
            ILastTimeUsageStorage lastTimeUsageStorage,
            IPlatformInfo platformInfo,
            UserAgent userAgent,
            ICalendarService calendarService,
            ISyncManager syncManager,
            IStopwatchProvider stopwatchProvider)
        {
            Ensure.Argument.IsNotNull(dataSource, nameof(dataSource));
            Ensure.Argument.IsNotNull(idProvider, nameof(idProvider));
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));
            Ensure.Argument.IsNotNull(userPreferences, nameof(userPreferences));
            Ensure.Argument.IsNotNull(shortcutCreator, nameof(shortcutCreator));
            Ensure.Argument.IsNotNull(analyticsService, nameof(analyticsService));
            Ensure.Argument.IsNotNull(notificationService, nameof(notificationService));
            Ensure.Argument.IsNotNull(intentDonationService, nameof(intentDonationService));
            Ensure.Argument.IsNotNull(lastTimeUsageStorage, nameof(lastTimeUsageStorage));
            Ensure.Argument.IsNotNull(platformInfo, nameof(platformInfo));
            Ensure.Argument.IsNotNull(userAgent, nameof(userAgent));
            Ensure.Argument.IsNotNull(calendarService, nameof(calendarService));
            Ensure.Argument.IsNotNull(syncManager, nameof(syncManager));
            Ensure.Argument.IsNotNull(stopwatchProvider, nameof(stopwatchProvider));

            this.dataSource            = dataSource;
            this.idProvider            = idProvider;
            this.timeService           = timeService;
            this.userPreferences       = userPreferences;
            this.shortcutCreator       = shortcutCreator;
            this.analyticsService      = analyticsService;
            this.notificationService   = notificationService;
            this.intentDonationService = intentDonationService;
            this.lastTimeUsageStorage  = lastTimeUsageStorage;
            this.platformInfo          = platformInfo;
            this.userAgent             = userAgent;
            this.calendarService       = calendarService;
            this.syncManager           = syncManager;
            this.stopwatchProvider     = stopwatchProvider;
        }
        public CreateTagInteractor(
            IIdProvider idProvider,
            ITimeService timeService,
            IDataSource <IThreadSafeTag, IDatabaseTag> dataSource,
            string tagName,
            long workspaceId)
        {
            Ensure.Argument.IsNotNull(tagName, nameof(tagName));
            Ensure.Argument.IsNotNull(dataSource, nameof(dataSource));
            Ensure.Argument.IsNotNull(idProvider, nameof(idProvider));
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));
            Ensure.Argument.IsNotZero(workspaceId, nameof(workspaceId));

            this.tagName     = tagName;
            this.dataSource  = dataSource;
            this.idProvider  = idProvider;
            this.timeService = timeService;
            this.workspaceId = workspaceId;
        }
示例#24
0
        public CreateClientInteractor(
            IIdProvider idProvider,
            ITimeService timeService,
            IDataSource <IThreadSafeClient, IDatabaseClient> dataSource,
            string clientName,
            long workspaceId)
        {
            Ensure.Argument.IsNotNull(dataSource, nameof(dataSource));
            Ensure.Argument.IsNotNull(idProvider, nameof(idProvider));
            Ensure.Argument.IsNotNull(clientName, nameof(clientName));
            Ensure.Argument.IsNotNull(workspaceId, nameof(workspaceId));
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));

            this.idProvider  = idProvider;
            this.timeService = timeService;
            this.dataSource  = dataSource;
            this.clientName  = clientName;
            this.workspaceId = workspaceId;
        }
示例#25
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();

            List <ActionObjectPath> actions      = new List <ActionObjectPath>();
            ActionObjectPath        spoOperation = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = QueryIdPath,
                    ObjectPathId = IdentityPath.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = false,
                        Properties          = new List <Property>()
                        {
                            new Property()
                            {
                                Name = "PollingInterval"
                            },
                            new Property()
                            {
                                Name = "IsComplete"
                            },
                        }
                    }
                }
            };

            ActionObjectPath identity = new ActionObjectPath()
            {
                ObjectPath = new Identity()
                {
                    Id   = IdentityPath,
                    Name = ObjectIdentity.Replace("\n", "&#xA;")
                }
            };

            actions.Add(spoOperation);
            actions.Add(identity);
            return(actions);
        }
示例#26
0
        public EntitySyncServer(ulong threadCount, int syncRate, Func <ulong, bool> netOwnerEvents,
                                Func <ulong, IClientRepository, NetworkLayer> createNetworkLayer,
                                Func <IEntity, ulong, ulong> entityThreadId,
                                Func <ulong, ulong, ulong, ulong> entityIdAndTypeThreadId,
                                Func <ulong, SpatialPartition> createSpatialPartition, IIdProvider <ulong> idProvider)
        {
            if (threadCount < 1)
            {
                throw new ArgumentException("threadCount must be >= 1");
            }

            if (syncRate < 0)
            {
                throw new ArgumentException("syncRate must be >= 0");
            }

            entityThreads            = new EntityThread[threadCount];
            entityThreadRepositories = new EntityThreadRepository[threadCount];
            clientThreadRepositories = new ClientThreadRepository[threadCount];
            spatialPartitions        = new SpatialPartition[threadCount];

            for (ulong i = 0; i < threadCount; i++)
            {
                var clientThreadRepository = new ClientThreadRepository();
                var entityThreadRepository = new EntityThreadRepository();
                var spatialPartition       = createSpatialPartition(i);
                entityThreadRepositories[i] = entityThreadRepository;
                clientThreadRepositories[i] = clientThreadRepository;
                spatialPartitions[i]        = spatialPartition;
                entityThreads[i]            = new EntityThread(i, entityThreadRepository, clientThreadRepository, spatialPartition, syncRate, netOwnerEvents(i),
                                                               OnEntityCreate,
                                                               OnEntityRemove, OnEntityDataChange, OnEntityPositionChange, OnEntityClearCache, OnEntityNetOwnerChange);
            }

            entityRepository = new EntityRepository(entityThreadRepositories, entityThreadId, entityIdAndTypeThreadId);
            clientRepository = new ClientRepository(clientThreadRepositories);
            networkLayer     = createNetworkLayer(threadCount, clientRepository);
            networkLayer.OnConnectionConnect    += OnConnectionConnect;
            networkLayer.OnConnectionDisconnect += OnConnectionDisconnect;
            this.idProvider = idProvider;
        }
示例#27
0
        public InteractorFactory(
            IIdProvider idProvider,
            ITimeService timeService,
            ITogglDataSource dataSource,
            IUserPreferences userPreferences,
            IAnalyticsService analyticsService,
            IApplicationShortcutCreator shortcutCreator)
        {
            Ensure.Argument.IsNotNull(dataSource, nameof(dataSource));
            Ensure.Argument.IsNotNull(idProvider, nameof(idProvider));
            Ensure.Argument.IsNotNull(timeService, nameof(timeService));
            Ensure.Argument.IsNotNull(userPreferences, nameof(userPreferences));
            Ensure.Argument.IsNotNull(shortcutCreator, nameof(shortcutCreator));
            Ensure.Argument.IsNotNull(analyticsService, nameof(analyticsService));

            this.dataSource       = dataSource;
            this.idProvider       = idProvider;
            this.timeService      = timeService;
            this.userPreferences  = userPreferences;
            this.shortcutCreator  = shortcutCreator;
            this.analyticsService = analyticsService;
        }
 public SqlTransactionRepository(
     string dsn,
     ISpecificationFinder specFinder,
     string[] indexedSegments,
     Type identityType,
     string schema        = "dbo",
     string commonSchema  = "dbo",
     int segmentBatchSize = 1000,
     string sqlDateType   = "date")
     : base(dsn, identityType, schema)
 {
     _commonDb      = new DbCreation(dsn, commonSchema, identityType, sqlDateType);
     _transactionDb = new DbCreation(dsn, schema, identityType, sqlDateType);
     _idProvider    = GetIdProvider(dsn, commonSchema, identityType, segmentBatchSize / 10);
     _schemaEnsured = false;
     _batchSize     = segmentBatchSize;
     _segmentBatch  = new SegmentBatch(this, identityType);
     _specs         = new Dictionary <string, SegmentSpecification>();
     foreach (var segmentId in indexedSegments)
     {
         var spec = specFinder.FindSegmentSpec("5010", segmentId.Trim());
         _specs.Add(segmentId.Trim(), spec);
     }
 }
 public SqliteFlightStorage(SqliteDbContext dbContext, IIdProvider idProvider, ILogger <SqliteFlightStorage> logger)
 {
     this.dbContext  = dbContext;
     this.idProvider = idProvider;
     this.logger     = logger;
 }
示例#30
0
 public JsonFileFlightStorage(IIdProvider idProvider, string filePath) : base(filePath)
 {
     this.idProvider = idProvider;
 }
示例#31
0
 public abstract HashSet<uint> Evaluate(IIdProvider provider);
        public SchoolSystemFactory(IIdProvider provider)
        {
            Validator.CheckIfNull(provider, "Parameter cannot be null!");

            this.idProvider = provider;
        }
示例#33
0
        private static Dictionary <string, IFieldUpdateStrategy> ConstructCustomUpdateStrategies(IIdProvider idProvider, Identity listIdentity, Property fieldsProperty)
        {
            Dictionary <string, IFieldUpdateStrategy> fieldUpdateStrategies = new Dictionary <string, IFieldUpdateStrategy>
            {
                { "FieldTaxonomyValue", new TaxonomyFieldUpdateStrategy(idProvider, listIdentity, fieldsProperty) },
                { "TaxonomyFieldTypeMulti", new TaxonomyMultiFieldUpdateStrategy(idProvider, listIdentity, fieldsProperty) }
            };

            return(fieldUpdateStrategies);
        }
 public MessageController(IWebChatData data, IIdProvider provider)
     : base(data)
 {
     this.provider = provider;
 }
示例#35
0
        public List <ActionObjectPath> GetRequest(IIdProvider idProvider)
        {
            int removeSiteId = idProvider.GetActionId();

            IdentityPath = idProvider.GetActionId();
            QueryIdPath  = idProvider.GetActionId();

            #region XML Payload generated

            /*
             * <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="pnp core sdk"
             *  xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
             *  <Actions>
             *      <Query Id="3" ObjectPathId="1">
             *          <Query SelectAllProperties="false">
             *              <Properties>
             *                  <Property Name="PollingInterval" ScalarProperty="true" />
             *                  <Property Name="IsComplete" ScalarProperty="true" />
             *              </Properties>
             *          </Query>
             *      </Query>
             *  </Actions>
             *  <ObjectPaths>
             *      <Constructor Id="2" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
             *      <Method Id="1" ParentId="2" Name="RemoveSite">
             *          <Parameters>
             *              <Parameter Type="String">https://bertonline.sharepoint.com/sites/removeme</Parameter>
             *          </Parameters>
             *      </Method>
             *  </ObjectPaths>
             * </Request>
             */
            #endregion

            List <ActionObjectPath> actions      = new List <ActionObjectPath>();
            ActionObjectPath        spoOperation = new ActionObjectPath()
            {
                Action = new QueryAction()
                {
                    Id           = QueryIdPath,
                    ObjectPathId = removeSiteId.ToString(),
                    SelectQuery  = new SelectQuery()
                    {
                        SelectAllProperties = false,
                        Properties          = new List <Property>()
                        {
                            new Property()
                            {
                                Name = "PollingInterval"
                            },
                            new Property()
                            {
                                Name = "IsComplete"
                            },
                        }
                    }
                }
            };

            ActionObjectPath removeSiteAction = new ActionObjectPath()
            {
                ObjectPath = new ObjectPathMethod()
                {
                    Id         = removeSiteId,
                    ParentId   = IdentityPath,
                    Name       = operationName,
                    Parameters = new MethodParameter()
                    {
                        Properties = new List <Parameter>()
                        {
                            new Parameter()
                            {
                                Value = SiteUrl.AbsoluteUri.ToString(),
                            }
                        }
                    }
                }
            };


            ActionObjectPath spoOperationCollection = new ActionObjectPath()
            {
                ObjectPath = new ConstructorPath
                {
                    Id     = IdentityPath,
                    TypeId = PnPAdminConstants.CsomTenantObject
                }
            };

            actions.Add(spoOperation);
            actions.Add(spoOperationCollection);
            actions.Add(removeSiteAction);

            return(actions);
        }
 public AccountController(IWebChatData data, IIdProvider idProvider)
     : base(data)
 {
     this.idProvider = idProvider;
 }