• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IJabbrRepository类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IJabbrRepository的典型用法代码示例。如果您正苦于以下问题:C# IJabbrRepository类的具体用法?C# IJabbrRepository怎么用?C# IJabbrRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IJabbrRepository类属于命名空间,在下文中一共展示了IJabbrRepository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Chat

 public Chat(IApplicationSettings settings, IResourceProcessor resourceProcessor, IChatService service, IJabbrRepository repository)
 {
     _settings = settings;
     _resourceProcessor = resourceProcessor;
     _service = service;
     _repository = repository;
 }
开发者ID:BDDCloud,项目名称:JabbR,代码行数:7,代码来源:Chat.cs


示例2: Chat

 public Chat(IResourceProcessor resourceProcessor, IChatService service, IJabbrRepository repository, ICache cache)
 {
     _resourceProcessor = resourceProcessor;
     _service = service;
     _repository = repository;
     _cache = cache;
 }
开发者ID:codeprogression,项目名称:JabbR,代码行数:7,代码来源:Chat.cs


示例3: TestableChat

 public TestableChat(Mock<ContentProviderProcessor> mockedResourceProcessor, Mock<IChatService> mockedChatService, IJabbrRepository repository, Mock<IConnection> connection)
     : base(mockedResourceProcessor.Object, mockedChatService.Object, repository, new Mock<ICache>().Object, new Mock<ILogger>().Object)
 {
     MockedResourceProcessor = mockedResourceProcessor;
     MockedChatService = mockedChatService;
     Repository = repository;
     MockedConnection = connection;
 }
开发者ID:adamralph,项目名称:JabbR,代码行数:8,代码来源:ChatFacts.cs


示例4: TransformAndParseUrls

        public static string TransformAndParseUrls(IJabbrRepository repository, string text)
        {
            HashSet<string> urls;
            var transform = new TextTransform(repository);
            var parsedText = transform.Parse(text);

            return TextTransform.TransformAndExtractUrls(parsedText, out urls);
        }
开发者ID:alexkopy,项目名称:JabbR,代码行数:8,代码来源:TextTransform.cs


示例5: JabbRAuthenticationCallbackProvider

 public JabbRAuthenticationCallbackProvider(IAuthenticationTokenService authenticationTokenService,
                                            IMembershipService membershipService,
                                            IJabbrRepository repository)
 {
     _authenticationTokenService = authenticationTokenService;
     _membershipService = membershipService;
     _repository = repository;
 }
开发者ID:arri-cc,项目名称:JabbR,代码行数:8,代码来源:JabbRAuthenticationCallbackProvider.cs


示例6: TestableChat

 public TestableChat(Mock<IApplicationSettings> mockSettings, Mock<IResourceProcessor> mockedResourceProcessor, Mock<IChatService> mockedChatService, IJabbrRepository repository, Mock<IConnection> connection)
     : base(mockedResourceProcessor.Object, mockedChatService.Object, repository, new Mock<ICache>().Object)
 {
     MockedResourceProcessor = mockedResourceProcessor;
     MockedChatService = mockedChatService;
     Repository = repository;
     MockedConnection = connection;
 }
开发者ID:ucdavis,项目名称:JabbR,代码行数:8,代码来源:ChatFacts.cs


示例7: CommandManager

 public CommandManager(string clientId,
                       string userId,
                       string roomName,
                       IChatService service,
                       IJabbrRepository repository,
                       INotificationService notificationService)
     : this(clientId, null, userId, roomName, service, repository, notificationService)
 {
 }
开发者ID:larrybeall,项目名称:JabbR,代码行数:9,代码来源:CommandManager.cs


示例8: Chat

 public Chat(ContentProviderProcessor resourceProcessor,
             IChatService service,
             IJabbrRepository repository,
             ICache cache,
             ILogger logger)
 {
     _resourceProcessor = resourceProcessor;
     _service = service;
     _repository = repository;
     _cache = cache;
     _logger = logger;
 }
开发者ID:QuickenLoans,项目名称:JabbR,代码行数:12,代码来源:Chat.cs


示例9: ClearConnectedClients

 private static void ClearConnectedClients(IJabbrRepository repository)
 {
     try
     {
         repository.RemoveAllClients();
         repository.CommitChanges();
     }
     catch (Exception ex)
     {
         Elmah.ErrorLog.GetDefault(null).Log(new Error(ex));
     }
 }
开发者ID:hb2uk,项目名称:Help,代码行数:12,代码来源:NinjectWebCommon.cs


示例10: RemoveZombies

        private static void RemoveZombies(ILogger logger, IJabbrRepository repo)
        {
            // Remove all zombie clients
            var zombies = repo.Clients.Where(c =>
                SqlFunctions.DateDiff("mi", c.LastActivity, DateTimeOffset.UtcNow) > 3);

            // We're doing to list since there's no MARS support on azure
            foreach (var client in zombies.ToList())
            {
                logger.Log("Removed zombie connection {0}", client.Id);

                repo.Remove(client);
            }
        }
开发者ID:phillip-haydon,项目名称:JabbR,代码行数:14,代码来源:PresenceMonitor.cs


示例11: CommandManager

 public CommandManager(string clientId,
                       string userId,
                       string roomName,
                       IChatService service,
                       IJabbrRepository repository,
                       INotificationService notificationService)
 {
     _clientId = clientId;
     _userId = userId;
     _roomName = roomName;
     _chatService = service;
     _repository = repository;
     _notificationService = notificationService;
 }
开发者ID:kiliman,项目名称:JabbR,代码行数:14,代码来源:CommandManager.cs


示例12: TestableChat

 public TestableChat(Mock<ContentProviderProcessor> mockedResourceProcessor, Mock<IChatService> mockedChatService, IJabbrRepository repository, Mock<IConnection> connection, ApplicationSettings settings)
     : base(mockedResourceProcessor.Object,
            mockedChatService.Object,
            new Mock<IRecentMessageCache>().Object, 
            repository, 
            new Mock<ICache>().Object, 
            new Mock<ILogger>().Object,
            settings)
 {
     MockedResourceProcessor = mockedResourceProcessor;
     MockedChatService = mockedChatService;
     Repository = repository;
     MockedConnection = connection;
     Settings = settings;
 }
开发者ID:QuinntyneBrown,项目名称:JabbR,代码行数:15,代码来源:ChatFacts.cs


示例13: Chat

 public Chat(ContentProviderProcessor resourceProcessor,
             IChatService service,
             IRecentMessageCache recentMessageCache,
             IJabbrRepository repository,
             ICache cache,
             ILogger logger,
             ApplicationSettings settings)
 {
     _resourceProcessor = resourceProcessor;
     _service = service;
     _recentMessageCache = recentMessageCache;
     _repository = repository;
     _cache = cache;
     _logger = logger;
     _settings = settings;
 }
开发者ID:renangrativol,项目名称:JabbR,代码行数:16,代码来源:Chat.cs


示例14: ClearConnectedClients

        private static void ClearConnectedClients(IJabbrRepository repository)
        {
            try
            {
                foreach (var u in repository.Users)
                {
                    u.Status = (int)UserStatus.Offline;
                }

                repository.RemoveAllClients();
                repository.CommitChanges();
            }
            catch (Exception ex)
            {
                Elmah.ErrorLog.GetDefault(null).Log(new Error(ex));
            }
        }
开发者ID:andrewtobin,项目名称:JabbR,代码行数:17,代码来源:Bootstrapper.cs


示例15: CheckUserStatus

        private static void CheckUserStatus(IJabbrRepository repo, IHubContext hubContext)
        {
            var inactiveUsers = new List<ChatUser>();
            var offlineUsers = new List<ChatUser>();

            IQueryable<ChatUser> users = repo.GetOnlineUsers();

            foreach (var user in users)
            {
                var status = (UserStatus)user.Status;
                var elapsed = DateTime.UtcNow - user.LastActivity;

                if (user.ConnectedClients.Count == 0)
                {
                    // Fix users that are marked as inactive but have no clients
                    user.Status = (int)UserStatus.Offline;
                    offlineUsers.Add(user);
                }
                else if (elapsed.TotalMinutes > 5)
                {
                    user.Status = (int)UserStatus.Inactive;
                    inactiveUsers.Add(user);
                }
            }

            if (inactiveUsers.Count > 0)
            {
                PerformRoomAction(inactiveUsers, roomGroup =>
                {
                    hubContext.Clients.Group(roomGroup.Room.Name).markInactive(roomGroup.Users);
                });
            }

            // TODO: Only remove users relevant to this server.
            //if (offlineUsers.Count > 0)
            //{
            //    PerformRoomAction(offlineUsers, roomGroup =>
            //    {
            //        foreach (var user in roomGroup.Users)
            //        {
            //            hubContext.Clients.Group(roomGroup.Room.Name).leave(user, roomGroup.Room.Name);
            //        }
            //    });
            //}
        }
开发者ID:csainty,项目名称:JabbR,代码行数:45,代码来源:Startup.BackgroundWork.cs


示例16: MarkInactiveUsers

        private static void MarkInactiveUsers(IJabbrRepository repo, IHubContext hubContext)
        {
            var inactiveUsers = new List<ChatUser>();

            IQueryable<ChatUser> users = repo.GetOnlineUsers();

            foreach (var user in users)
            {
                var status = (UserStatus)user.Status;
                var elapsed = DateTime.UtcNow - user.LastActivity;

                if (user.ConnectedClients.Count == 0)
                {
                    // Fix users that are marked as inactive but have no clients
                    user.Status = (int)UserStatus.Offline;
                }
                else if (elapsed.TotalMinutes > 15)
                {
                    user.Status = (int)UserStatus.Inactive;
                    inactiveUsers.Add(user);
                }
            }

            if (inactiveUsers.Count > 0)
            {
                var roomGroups = from u in inactiveUsers
                                 from r in u.Rooms
                                 select new { User = u, Room = r } into tuple
                                 group tuple by tuple.Room into g
                                 select new
                                 {
                                     Room = g.Key,
                                     Users = g.Select(t => new UserViewModel(t.User))
                                 };

                foreach (var roomGroup in roomGroups)
                {
                    hubContext.Clients.Group(roomGroup.Room.Name).markInactive(roomGroup.Users).Wait();
                }
            }
        }
开发者ID:arri-cc,项目名称:JabbR,代码行数:41,代码来源:Startup.BackgroundWork.cs


示例17: ChatService

 public ChatService(IJabbrRepository repository, ICryptoService crypto)
 {
     _repository = repository;
     _crypto = crypto;
 }
开发者ID:alexkopy,项目名称:JabbR,代码行数:5,代码来源:ChatService.cs


示例18: JabbRAuthenticationCallbackProvider

 public JabbRAuthenticationCallbackProvider(IJabbrRepository repository)
 {
     _repository = repository;
 }
开发者ID:sachin303,项目名称:JabbR,代码行数:4,代码来源:JabbRAuthenticationCallbackProvider.cs


示例19: TestableChat

 public TestableChat(Mock<IResourceProcessor> mockedResourceProcessor, Mock<IChatService> mockedChatService, IJabbrRepository repository, Mock<IConnection> connection)
     : base(mockedResourceProcessor.Object, mockedChatService.Object, repository)
 {
     MockedResourceProcessor = mockedResourceProcessor;
     MockedChatService = mockedChatService;
     Repository = repository;
     MockedConnection = connection;
 }
开发者ID:skoon,项目名称:JabbR,代码行数:8,代码来源:ChatFacts.cs


示例20: UpdatePresence

        private void UpdatePresence(ILogger logger, IJabbrRepository repo)
        {
            // Get all connections on this node and update the activity
            foreach (var connection in _heartbeat.GetConnections())
            {
                if (!connection.IsAlive)
                {
                    continue;
                }

                ChatClient client = repo.GetClientById(connection.ConnectionId);

                if (client != null)
                {
                    client.LastActivity = DateTimeOffset.UtcNow;
                }
                else
                {
                    EnsureClientConnected(logger, repo, connection);
                }
            }

            repo.CommitChanges();
        }
开发者ID:BrianRosamilia,项目名称:JabbR,代码行数:24,代码来源:PresenceMonitor.cs



注:本文中的IJabbrRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IJavascriptObject类代码示例发布时间:2022-05-24
下一篇:
C# IIterator类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap