Ejemplo n.º 1
0
 /// <summary>
 /// 初始化数据操作服务
 /// </summary>
 /// <typeparam name="DbContext"></typeparam>
 private void InitServiceProvider <DbContext>() where DbContext : DataContext, new()
 {
     ErrorLogService        = new ErrorLogService <DbContext>();
     UnsendMessageService   = new UnsendMessageService <DbContext>();
     UserService            = new UserService <DbContext>();
     MessageHistoryService  = new MessageHistoryService <DbContext>();
     UserRelationService    = new UserRelationService <DbContext>();
     UserLoginRecordService = new UserLoginRecordService <DbContext>();
 }
Ejemplo n.º 2
0
 public RssCtlCallback(
     TelegramService telegramService,
     MessageHistoryService messageHistoryService,
     RssFeedService rssFeedService,
     RssService rssService
     )
 {
     _telegramService       = telegramService;
     _messageHistoryService = messageHistoryService;
     _rssFeedService        = rssFeedService;
     _rssService            = rssService;
 }
Ejemplo n.º 3
0
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);

             IRepository<MessageHistory> messageHistoryRepository  = new Repository<MessageHistory>(new DatabaseContext());
             IRepository<User> userRepository = new Repository<User>(new DatabaseContext());
            IMessageHistoryService messageService = new MessageHistoryService(messageHistoryRepository);
            IUserService userService = new UserService(userRepository, null);
            GlobalHost.DependencyResolver.Register(typeof(ChatHub), () => new ChatHub(messageService, userService));

            app.MapSignalR();
        }
Ejemplo n.º 4
0
 public ChatService(
     ILogger <ChatService> logger,
     CacheService cacheService,
     IOptionsSnapshot <RestrictionConfig> restrictionConfig,
     ITelegramBotClient botClient,
     BotService botService,
     MessageHistoryService messageHistoryService,
     SettingsService settingsService
     )
 {
     _logger                = logger;
     _botClient             = botClient;
     _botService            = botService;
     _messageHistoryService = messageHistoryService;
     _cacheService          = cacheService;
     _restrictionConfig     = restrictionConfig.Value;
     _settingsService       = settingsService;
 }
Ejemplo n.º 5
0
        public UserProfileViewModel(
            MessageHistoryService messageHistoryServ,
            UserSearcher userSearchingServ,
            FriendsService friendServ,
            Messanger mesServ,
            SessionInfo session,
            MessageSearcher mesSerServ,
            Services.PhotoService.UsersPhotoService profilePhotoService,
            ImageService imageServ,
            Authenticator authenticatorServ,
            ImageUrlService imageUrlServ)
        {
            Messages                 = new FlowDocument();
            controlsVisibility       = false;
            canExecute               = true;
            CurrentSession           = session;
            messageHistoryService    = messageHistoryServ;
            userSearchingService     = userSearchingServ;
            friendService            = friendServ;
            this.profilePhotoService = profilePhotoService;
            imageService             = imageServ;
            Friends = friendService.GetFriends(currentSession.LoggedUser.Id).ResultTask.Result;
            authenticatorService = authenticatorServ;
            imageUrlService      = imageUrlServ;

            FindFriendEmailOrLogin = string.Empty;
            messengerService       = mesServ;
            DocWidth = 248;
            FontSize = 13;
            messageSearchingService = mesSerServ;
            var imageUrl = profilePhotoService.GetProfilePhoto(currentSession.LoggedUser.ProfilePhotoId).Url;

            if (imageUrl.Contains(@"\Resources\images\ProfilePhotos"))
            {
                ImageSource = imageUrl;
            }
            else
            {
                ImageSource = imageUrlService.GetImageUrl(currentSession.LoggedUser.ProfilePhotoId);
            }
        }
Ejemplo n.º 6
0
 public MessageHistoryModule(MessageHistoryService messageHistory, SettingsService settings)
 {
     _messageHistory = messageHistory;
     _settings       = settings;
 }