public InterfaceInfoType(ISessionInfoRepository sessionInfoRepository)
        {
            Name        = nameof(InterfaceInfo);
            Description = "Information about interface.";

            Field(x => x.ID, type: typeof(IntGraphType)).Description("The ID of the Interface.");
            Field(x => x.IntID).Description("Internal identification of the Interface.");
            Field(x => x.Name).Description("The name of the Interface.");
            Field(x => x.InterfaceDirection, type: typeof(InterfaceDirectionEnum)).Description("The direction of the Interface.");
            Field(x => x.SupportsDataLoadingTool).Description("Determines if Interface is supported by Data loading tool.");
            Field(x => x.Version).Description("The version of the Interface.");
            Field(x => x.LastInstallation).Description("The last installation date of the Interface.");
            Field(x => x.Description, true).Description("The description of the Interface.");
            Field(x => x.ObjectIDLabel).Description("The label of the Object ID column of the Interface.");
            Field(x => x.AdditionalInfo1Label, true).Description("The label of the additional info 1 column of the Interface.");
            Field(x => x.AdditionalInfo2Label, true).Description("The label of the additional info 2 column of the Interface.");
            Field(x => x.FileBased).Description("Determines if Interface process data from file or not.");
            Field(x => x.SupportsReprocessing).Description("Determines if Interface supports reprocessing of data.");

            Field <ListGraphType <SessionInfoType> >(
                "Sessions",
                resolve: context =>
            {
                var sessions = sessionInfoRepository.GetInterfaceSessions(context.Source.ID).ToList();
                return(sessions);
            });
        }
 public LoadUserInfoRepository(ISessionInfoRepository sessionInfoRepository
     , IUserInfoRepository userInfoRepository
     , ILoadUserInfoFactory loadUserInfoFactory
     , ISendUserInfoFactory sendUserInfoFactory)
 {
     _sessionInfoRepository = sessionInfoRepository;
     _userInfoRepository = userInfoRepository;
     _loadUserInfoFactory = loadUserInfoFactory;
     _sendUserInfoFactory = sendUserInfoFactory;
 }
 public LoadSessionInfoRepository(IApplicationSettingsRepository applicationSettingsRepository
     , ISessionInfoRepository sessionInfoRepository
     , ILoadSessionInfoFactory loadSessionInfoFactory
     , ISendSessionInfoFactory sendSessionInfoFactory)
 {
     _applicationSettingsRepository = applicationSettingsRepository;
     _sessionInfoRepository = sessionInfoRepository;
     _loadSessionInfoFactory = loadSessionInfoFactory;
     _sendSessionInfoFactory = sendSessionInfoFactory;
 }
 public AddFriendsAvatarsToRepository(ISessionInfoRepository sessionInfoRepository
     , IFriendsRepository friendsRepository
     , IFriendsAvatarsRepository friendsAvatarsRepository
     , IAddFriendAvatarFactory addFriendAvatarFactory
     , ISendFriendsAvatarsFactory sendAvatarsFactory)
 {
     _sessionInfoRepository = sessionInfoRepository;
     _friendsRepository = friendsRepository;
     _friendsAvatarsRepository = friendsAvatarsRepository;
     _addFriendAvatarFactory = addFriendAvatarFactory;
     _sendAvatarsFactory = sendAvatarsFactory;
 }
Пример #5
0
 public MessageInputViewModel(int friendId
     , ISendMessageToVk sendMessageToVk
     , ISessionInfoRepository sessionInfoRepository
     , ILoadingIndicatorViewModel loadingIndicatorModel
     , ILanguageRepository languageRepository
     , ILogger logger) 
     : base(languageRepository, logger)
 {
     _sendMessageToVk = sendMessageToVk;
     _sessionInfoRepository = sessionInfoRepository;
     FriendId = friendId;
     LoadingIndicatorModel = loadingIndicatorModel;
 }
Пример #6
0
        public BridgeManagementQuery(
            IInterfaceInfoRepository interfaceInfoRepository,
            ISessionInfoRepository sessionInfoRepository,
            IRecordInfoRepository recordInfoRepository)
        {
            if (interfaceInfoRepository == null)
            {
                throw new ArgumentNullException(nameof(interfaceInfoRepository));
            }
            if (sessionInfoRepository == null)
            {
                throw new ArgumentNullException(nameof(sessionInfoRepository));
            }

            InitializeInterfaceInfoQuery(interfaceInfoRepository);
            InitializeSessionInfoQuery(sessionInfoRepository);
            InitializeRecordInfoQuery(recordInfoRepository);
        }
Пример #7
0
        public ImportLogType(ISessionInfoRepository sessionInfoRepository)
        {
            Name        = nameof(ImportLog);
            Description = "Interface log.";

            Field(x => x.SessionID, type: typeof(IntGraphType)).Description("The ID of the Session.");
            Field(x => x.ItemID, type: typeof(IntGraphType)).Description("Interface log row number.");
            Field(x => x.RecordID, type: typeof(IntGraphType), nullable: true).Description("The ID of the Record.");
            Field(x => x.ObjectID, nullable: true).Description("The ID of the Object.");
            Field(x => x.AdditionalInfo1, nullable: true).Description("The ID of the first Additional info.");
            Field(x => x.AdditionalInfo2, nullable: true).Description("The ID of the second Additional info.");
            Field(x => x.ProcessingPhase, type: typeof(ProcessingPhaseEnum)).Description("Phase of the processing during which message has been logged.");
            Field(x => x.LogMessage).Description("Logged message.");
            Field(x => x.LogSeverity, type: typeof(LogLevelEnum)).Description("Severity of the logged message.");
            Field(x => x.TimeStamp, type: typeof(DateGraphType)).Description("Time when message has been logged.");

            Field <SessionInfoType>(nameof(SessionInfo),
                                    resolve: context => sessionInfoRepository.Get(context.Source.SessionID));
        }
        public RunLongPollBackgroundService(LongPollBackgroundService longPollBackgroundService
            , IAddDialogMessagesFactory addDialogMessagesFactory
            , ISessionInfoRepository sessionInfoRepository
            , IFriendsRepository friendsRepository
            , IDialogMessagesRepository dialogMessagesRepository
            , ILogger logger)
        {
            _longPollBackgroundService = longPollBackgroundService;
            _addDialogMessagesFactory = addDialogMessagesFactory;
            _sessionInfoRepository = sessionInfoRepository;
            _friendsRepository = friendsRepository;
            _dialogMessagesRepository = dialogMessagesRepository;

            _longPollBackgroundService.Complete += OnComplete;
            
            _longPollBackgroundService.Error += (sender, args) =>
            {
                logger.Error(args.Exception);
            };
        }
Пример #9
0
        private void InitializeSessionInfoQuery(ISessionInfoRepository sessionInfoRepository)
        {
            Field <SessionInfoType>(
                "Session",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> >
            {
                Name        = "ID",
                Description = "id of the session"
            }),
                resolve: context =>
            {
                var id = context.GetArgument <int>("Id");
                return(sessionInfoRepository.Get(id));
            });

            Field <ListGraphType <SessionInfoType> >(
                "Sessions",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> >
            {
                Name        = "InterfaceID",
                Description = "id of the interface."
            },
                    new QueryArgument <ProjectionType>
            {
                Name        = nameof(Projection),
                Description = "Data projection."
            }),
                resolve: context =>
            {
                var id         = context.GetArgument <short>("InterfaceID");
                var projection = context.GetArgument <Projection>(nameof(Projection));
                var sessions   = sessionInfoRepository
                                 .GetInterfaceSessions(id)
                                 .ProjectData(projection);

                return(sessions.ToList());
            });
        }
Пример #10
0
        public HeaderViewModel(IApplicationSettingsRepository applicationSettingsRepository
            , ISessionInfoRepository sessionInfoRepository
            , IUserInfoRepository userInfoRepository
            , IUserAvatarRepository userAvatarRepository

            , ILoadSessionInfoFactory loadSessionInfoFactory
            , ISendApplicationSettingsFactory sendApplicationSettingsFactory
            , ISendSessionInfoFactory sendSessionInfoFactory

            , ICommandEngineAsync<AfterLoginAttribute> afterLoginEngine

            , IVkAuthorizer vkAuthorizer
            , ILanguageRepository languageRepository
            , ILogger logger) 
            : base(languageRepository, logger)
        {
            _applicationSettingsRepository = applicationSettingsRepository;
            _sessionInfoRepository = sessionInfoRepository;
            _userInfoRepository = userInfoRepository;
            _userAvatarRepository = userAvatarRepository;

            _loadSessionInfoFactory = loadSessionInfoFactory;
            _sendApplicationSettingsFactory = sendApplicationSettingsFactory;
            _sendSessionInfoFactory = sendSessionInfoFactory;

            _afterLoginEngine = afterLoginEngine;

            _vkAuthorizer = vkAuthorizer;

            _sessionInfoRepository.Loaded += SessionInfoRepositoryLoaded;
            _userInfoRepository.Loaded += UserInfoLoaded;
            _userAvatarRepository.Loaded += UserAvatarLoaded;
        }