Пример #1
0
        /// <summary> Поставщик вариантов задания </summary>
        /// <param name="taskId">Id задания</param>
        /// <param name="sessionGuid">Guid сессии</param>
        /// <param name="allowedVariantGenerationVersions">Допустимые версии генераторов. АХТУНГ! Имеет смысл только мажорная часть версии!</param>
        /// <param name="client">Клиент</param>
        public VariantProvider(long taskId, Guid sessionGuid, Version[] allowedVariantGenerationVersions,
                               DisposableWcfClientWrapper <IVariantProviderServiceClient> client)
        {
            Contract.Requires(client != null);
            Contract.Requires(sessionGuid != null);
            Contract.Requires(allowedVariantGenerationVersions != null && allowedVariantGenerationVersions.Any());

            _taskId      = taskId;
            _sessionGuid = sessionGuid;
            _allowedVariantGenerationVersions = allowedVariantGenerationVersions;


            _providerServiceClient = client.Instance;
            _providerServiceClient.GetVariantCompleted += ProviderServiceClientOnGetVariantCompleted;
        }
Пример #2
0
        /// <summary> ViewModel для панели информации </summary>
        public UserActionsManager(long taskId, Guid sessionGuid,
                                  DisposableWcfClientWrapper <IUserActionsRegistratorClient> registratorClient, IDateTimeService dateService)
        {
            Contract.Requires <ArgumentNullException>(sessionGuid != null);
            Contract.Requires <ArgumentNullException>(registratorClient != null);
            Contract.Requires <ArgumentNullException>(dateService != null);

            _dateService = dateService;
            _taskId      = taskId;
            _sessionGuid = sessionGuid;
            _userActionsRegistratorClient = registratorClient.Instance;
            _userActionsRegistratorClient.RegisterUserActionsCompleted += RegistrationComplete;

            _internalDisplayLog = new ObservableCollection <LogEventViewModel>();
            Log = new ReadOnlyObservableCollection <LogEventViewModel>(_internalDisplayLog);
            _notRegisteredActions = new List <ActionDescription>();
            _responseQueue        = new List <RegisterUserActionsCompletedEventArgs>();
        }