public static INotifier Create(NotifierType type, ILogger logger, IConfigurationSection section) { NotifierFactory factory; switch (type) { case NotifierType.Pushbullet: factory = new PushbulletFactory(); break; case NotifierType.Webhook: factory = new WebhookFactory(); break; case NotifierType.Email: factory = new EmailFactory(); break; case NotifierType.Telegram: factory = new TelegramFactory(); break; default: throw new NotImplementedException(type.ToString()); } INotifier notifier = factory.Create(logger, section); notifier.Cameras = section.GetSection("Cameras").Get <List <string> >(); return(notifier); }
public static extern int RasDial( [In] ref RASDIALEXTENSIONS lpRasDialExtensions, string lpszPhoneBook, [In] ref RASDIALPARAMS lpRasDialParams, NotifierType dwNotifierType, Delegate lpvNotifier, out IntPtr lphRasConn);
private async Task SendLeaderboardsAsync(RestDMChannel channel, NotifierType type) { if (type == NotifierType.PlayerSeasonWins) { var pswLb = await ScrapClient.GetPlayerSeasonWinLeaderboardAsync(); var page = PageUtils.LeaderBoardPage(pswLb.Take(15), 0, member => member.Name, member => member.SeasonWins.ToString(), "Most Active Players", ":muscle:", EmbedColor.Leaderboard); await channel.SendMessageAsync(embed : page.Build().Embed); } else if (type == NotifierType.TeamSeasonWins) { var pswLb = await ScrapClient.GetTeamSeasonWinLeaderboardAsync(); var page = PageUtils.LeaderBoardPage(pswLb.Take(15), 0, teamwin => teamwin.Team.Name, teamwin => teamwin.SeasonWins.ToString(), "Most Active Teams", ":muscle:", EmbedColor.Leaderboard); await channel.SendMessageAsync(embed : page.Build().Embed); } }
private void Put(NotifierType notifierType, IconStatus status) { if (this.unitaryStatus.ContainsKey(notifierType)) { this.unitaryStatus.Remove(notifierType); } this.unitaryStatus.Add(notifierType, status); }
public Notifier(ulong discordId, bool compactDisplay, NotifierType type, TimeSpan interval) { Id = Guid.NewGuid(); DiscordId = discordId; CompactDisplay = compactDisplay; Type = type; Interval = interval; }
public INotifier GetNotifier(NotifierType notifierType) { switch (notifierType) { case NotifierType.MESSAGE_BOX: default: return(new MessageBoxNotifier(_serviceProvider)); case NotifierType.PUSHBULLET: return(new PushbulletNotifier(_options.Pushbullet)); } }
public override int GetHashCode() { int hash = 1; if (NotifierType.Length != 0) { hash ^= NotifierType.GetHashCode(); } if (shmLocator_ != null) { hash ^= ShmLocator.GetHashCode(); } return(hash); }
public ServiceResponse <Notifier> AddNotifier(NotifierType type, string emailFromAddress, string emailFromName, string successEmailSubject, string successEmail, string failureEmailSubject, string failureEmail, bool alwaysEmailOnSuccess, List <NotifierFilter> filters, List <string> tags) { return(this.rest.Post <Notifier>("/notifier", new Dictionary <string, string>() { { "emailFromAddress", emailFromAddress }, { "emailFromName", emailFromName }, { "successEmailSubject", successEmailSubject }, { "successEmail", System.Net.WebUtility.UrlEncode(successEmail) }, { "failureEmailSubject", failureEmailSubject }, { "failureEmail", System.Net.WebUtility.UrlEncode(failureEmail) }, { "alwaysEmailOnSuccess", alwaysEmailOnSuccess.ToString() }, { "type", type.ToString() }, { "filters", ListToString <NotifierFilter>(filters) }, { "tags", ListToString <string>(tags) } })); }
public IEnumerable <User> GetUsersConcernedByThisNotifier(NotifierType notifierType, IEnumerable <User> users) => users .Where(user => (user.NotificationSetting.AcceptedNotifiers & (int)notifierType) != 0);
public async Task <IEnumerable <UserNotificationOptions> > GetUserOptionsAsync(IEnumerable <int> userIds, NotifierType type) { return(await _db.UserOptions.Where(x => userIds.Contains(x.UserId) && type == x.Type).ToListAsync()); }
public async Task <UserNotificationOptions> GetUserOptionsAsync(int userId, NotifierType type) { return(await _db.UserOptions.SingleOrDefaultAsync(x => x.UserId == userId && type == x.Type)); }
public void DefineNormalStatus(NotifierType notifierType) { this.Put(notifierType, IconStatus.Normal); this.updateApplicationStatus(); }
private static string GetDescription(NotifierType notifierType) { return(notifierType.GetType().GetMember(notifierType.ToString())[0].GetCustomAttribute <DescriptionAttribute>().Description); }
public int RasDial(ref RASDIALEXTENSIONS lpRasDialExtensions, string lpszPhoneBook, ref RASDIALPARAMS lpRasDialParams, NotifierType dwNotifierType, RasDialFunc2 lpvNotifier, out IntPtr lphRasConn) { var stopwatch = Stopwatch.StartNew(); var result = AttachedObject.RasDial(ref lpRasDialExtensions, lpszPhoneBook, ref lpRasDialParams, dwNotifierType, lpvNotifier, out lphRasConn); stopwatch.Stop(); var callEvent = new PInvokeInt32CallCompletedTraceEvent { DllName = RasApi32Dll, Duration = stopwatch.Elapsed, MethodName = nameof(RasDial), Result = result, }; callEvent.Args.Add(nameof(lpRasDialExtensions), lpRasDialExtensions); callEvent.Args.Add(nameof(lpszPhoneBook), lpszPhoneBook); callEvent.Args.Add(nameof(lpRasDialParams), lpRasDialParams); callEvent.Args.Add(nameof(dwNotifierType), dwNotifierType); callEvent.Args.Add(nameof(lpvNotifier), lpvNotifier); callEvent.OutArgs.Add(nameof(lphRasConn), lphRasConn); LogVerbose(callEvent); return(result); }
public void DefineDisconnectStatus(NotifierType notifierType) { this.Put(notifierType, IconStatus.Disconnect); this.updateApplicationStatus(); }
public void DefineMessageStatus(NotifierType notifierType) { this.Put(notifierType, IconStatus.Message); this.updateApplicationStatus(); }
public WebServiceChecker(IconeStatusManager iconStatusManager, NotifierType notifierType) { this.iconStatusManager = iconStatusManager; this.notifierType = notifierType; }
public NotifierBuilder OfType(NotifierType type) { this.type = type; return(this); }
private static string GetString(NotifierType notifierType) { return(GetDescription(notifierType)); }
public NotifierFactory(NotifierType notifierType, ISlackOutputConfig slackOutputConfig) { _notifierType = notifierType; _slackOutputConfig = slackOutputConfig; }
public int RasDial(ref RASDIALEXTENSIONS lpRasDialExtensions, string lpszPhoneBook, ref RASDIALPARAMS lpRasDialParams, NotifierType dwNotifierType, RasDialFunc2 lpvNotifier, out IntPtr lphRasConn) { return(UnsafeNativeMethods.RasDial(ref lpRasDialExtensions, lpszPhoneBook, ref lpRasDialParams, dwNotifierType, lpvNotifier, out lphRasConn)); }
public TransformerFactory(NotifierType notifierType, Level level) { _notifierType = notifierType; _level = level; }