本文整理汇总了C#中IJabbrRepository类的典型用法代码示例。如果您正苦于以下问题:C# IJabbrRepository类的具体用法?C# IJabbrRepository怎么用?C# IJabbrRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IJabbrRepository类属于命名空间,在下文中一共展示了IJabbrRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Chat
public Chat(IApplicationSettings settings, IResourceProcessor resourceProcessor, IChatService service, IJabbrRepository repository)
{
_settings = settings;
_resourceProcessor = resourceProcessor;
_service = service;
_repository = repository;
}
示例2: Chat
public Chat(IResourceProcessor resourceProcessor, IChatService service, IJabbrRepository repository, ICache cache)
{
_resourceProcessor = resourceProcessor;
_service = service;
_repository = repository;
_cache = cache;
}
示例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;
}
示例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);
}
示例5: JabbRAuthenticationCallbackProvider
public JabbRAuthenticationCallbackProvider(IAuthenticationTokenService authenticationTokenService,
IMembershipService membershipService,
IJabbrRepository repository)
{
_authenticationTokenService = authenticationTokenService;
_membershipService = membershipService;
_repository = repository;
}
示例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;
}
示例7: CommandManager
public CommandManager(string clientId,
string userId,
string roomName,
IChatService service,
IJabbrRepository repository,
INotificationService notificationService)
: this(clientId, null, userId, roomName, service, repository, notificationService)
{
}
示例8: Chat
public Chat(ContentProviderProcessor resourceProcessor,
IChatService service,
IJabbrRepository repository,
ICache cache,
ILogger logger)
{
_resourceProcessor = resourceProcessor;
_service = service;
_repository = repository;
_cache = cache;
_logger = logger;
}
示例9: ClearConnectedClients
private static void ClearConnectedClients(IJabbrRepository repository)
{
try
{
repository.RemoveAllClients();
repository.CommitChanges();
}
catch (Exception ex)
{
Elmah.ErrorLog.GetDefault(null).Log(new Error(ex));
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
}
示例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);
// }
// });
//}
}