public ActionResult Index() { List <object> MultyList = new List <object>(); using (MatchDBContext db = new MatchDBContext()) { try { //db.Database.Delete(); //NewFilter newFilter = new NewFilter(); //newFilter.DataImport(); NotificationEvents NE = new NotificationEvents(); MultyList.Add(db.Sports.ToList()); MultyList.Add(db.Events.ToList()); MultyList.Add(db.Matches.ToList()); MultyList.Add(db.Bets.ToList()); MultyList.Add(db.Odds.ToList()); }catch { } return(View(MultyList)); } }
public void SetNotificationEvents(IEnumerable <SonarQubeNotification> events) { if (events == null || !events.Any() || !AreNotificationsEnabled || !isVisible) { return; } uiThreadInvoker(() => { NotificationEvents.Clear(); foreach (var ev in events) { NotificationEvents.Add(ev); telemetryManager.NotificationReceived(ev.Category); } HasUnreadEvents = true; IsToolTipVisible = true; autocloseTimer.Start(); }); }
public override Task OnConnected() { NotificationSports notificationSports = new NotificationSports(); Clients.All.returnFullTableSports(notificationSports.GetTableSports()); NotificationEvents notificationEvents = new NotificationEvents(); Clients.All.returnSportEv(notificationEvents.GetSportEv()); NotificationMatches notificationClass = new NotificationMatches(); Clients.All.returnFullTableMatches(notificationClass.GetTableMatches()); NotificationBets notificationBets = new NotificationBets(); Clients.All.returnFullTableBets(notificationBets.GetTableBets()); NotificationOdds notificationOdds = new NotificationOdds(); Clients.All.returnFullTableOdds(notificationOdds.GetTableOdds()); return(base.OnConnected()); }
public override Task OnConnected() { NotificationEvents notificationEvents = new NotificationEvents(); Clients.Caller.returnSportEv(notificationEvents.GetSportEv()); return(base.OnConnected()); }
public void Watch(string baseDirectory, NotificationEvents events) { mBaseDirectory = baseDirectory; mNotificationEvents = events; if ((events & (NotificationEvents.Modified | NotificationEvents.Created | NotificationEvents.Deleted | NotificationEvents.Renamed)) != 0) { WatchFileEvents(baseDirectory, events); } if ((events & NotificationEvents.AttributesChanged) != 0) { WatchAttributeEvents(baseDirectory); } }
protected void Session_Start(object sender, EventArgs e) { NotificationSports NS = new NotificationSports(); NS.RegisterNotificationSports(); NotificationBets NB = new NotificationBets(); NB.RegisterNotificationBets(); NotificationEvents NE = new NotificationEvents(); NE.RegisterNotificationEvent(); NotificationMatches NC = new NotificationMatches(); NC.RegisterNotificationMatches(); NotificationOdds NO = new NotificationOdds(); NO.RegisterNotificationOdds(); }
internal void SendNotificationEvent(String table, String nameEvent, ActionTable action, String jsonTableData) { Boolean eventValid = false; NotificationEvents notificationEvent = NotificatioEventDb.GetNotificationEvent(table, nameEvent); List <NotificationConditions> notificationConditions = null; eventValid = (action == ActionTable.I && notificationEvent.EventInsert); if (!eventValid) { eventValid = (action == ActionTable.U && notificationEvent.EventUpdate); } if (!eventValid) { eventValid = (action == ActionTable.D && notificationEvent.EventDelete); } if (eventValid && notificationEvent.Nortify) { notificationConditions = notificationEvent.NotificationConditions.ToList(); String query = null; String codntionParams = null; foreach (NotificationConditions itemCondition in notificationConditions) { itemCondition.NotificationQueryCondition.ToList().ForEach(t => { query = String.Concat(query, t.QueryCondition); codntionParams = String.Concat(codntionParams, t.ParameterDimical, ";"); }); codntionParams = codntionParams.Remove(codntionParams.Length - 1); if (itemCondition.Notify) { if (!String.IsNullOrEmpty(jsonTableData)) { query = QueryResolve(query, codntionParams, jsonTableData); } query = String.Concat("Select * From ", table, " Where ", query); if (NotificationQuerys.ExecuteCondition(query)) { SendDestination(itemCondition.NotificationDestination?.ToList()); } } } } }
private void WatchFileEvents(string baseDirectory, NotificationEvents events) { if (mFileWatcher != null) { mFileWatcher.Dispose(); } NotifyFilters filters = 0; if ((events & NotificationEvents.Modified) != 0) { filters |= NotifyFilters.Size | NotifyFilters.LastWrite; } if ((events & NotificationEvents.Renamed) != 0) { filters |= NotifyFilters.FileName; } try { mFileWatcher = new FileSystemWatcher(); mFileWatcher.Filter = "*.*"; mFileWatcher.IncludeSubdirectories = true; mFileWatcher.NotifyFilter = filters; mFileWatcher.Changed += new FileSystemEventHandler(mFileWatcher_Changed); mFileWatcher.Created += new FileSystemEventHandler(mFileWatcher_Created); mFileWatcher.Renamed += new RenamedEventHandler(mFileWatcher_Renamed); mFileWatcher.Deleted += new FileSystemEventHandler(mFileWatcher_Deleted); mFileWatcher.Error += new ErrorEventHandler(mFileWatcher_Error); mFileWatcher.InternalBufferSize = 32768; mFileWatcher.Path = baseDirectory; mFileWatcher.EnableRaisingEvents = true; } catch (Exception) { mFileWatcher = null; } }
/// <summary> /// This method gets called if one of the option checkboxes /// changes its state. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void checkBoxOptionsCheckStateChanged(object sender, EventArgs e) { CheckBox checkBox = sender as CheckBox; if (sender == null) { return; } if (sender == checkBoxEnableShellChangeNotifier) { shellChangeNotifier1.Enabled = checkBoxEnableShellChangeNotifier.Checked; return; } if (sender == checkBoxShellChangeNotifierRecursive) { shellChangeNotifier1.Recursive = checkBoxShellChangeNotifierRecursive.Checked; return; } object o = Enum.Parse(typeof(NotificationEvents), checkBox.Text); if (o == null) { return; } NotificationEvents notificationEvent = (NotificationEvents)o; if (checkBox.Checked) { //set the bit of the particular event to listen to shellChangeNotifier1.EventFilter |= notificationEvent; } else { //clear the bit of the particular event by applying the inverted mask shellChangeNotifier1.EventFilter &= (NotificationEvents)(~(int)notificationEvent); } }
static void Main(string[] args) { string signalRAddress = "http://localhost:55839/notifications/"; var container = new UnityContainer(); var events = new NotificationEvents(); container.RegisterInstance <INotificationEvents>(events); var handler = new SignalRHandler(container); Task.Run(async() => await handler.InitializeAsync(signalRAddress)); events.SalesOrderCreated += (sender, e) => { Console.WriteLine($"Order #{e.SalesOrder.Id} created for customer {e.SalesOrder.CustomerName}"); }; Console.ReadLine(); Task.Run(async() => await handler.DisconnectAsync()); }
public IRolePlugin Start() { var agentConfig = new AgentConfiguration { AgentId = "TestAgent" }; Container.Initialise(); Messenger.Initialise(new MagnumMessenger()); Messenger.InterceptBefore <NotificationEvent>(msg => NotificationEvents.Add(msg)); Messenger.InterceptBefore <NotificationRequest>(msg => NotificationRequests.Add(msg)); NotificationHub.Initialise(new DefaultNotificationHub(agentConfig, _notificationFilters)); RunStartupPlugins(); _customPluginActions.ForEach(a => a(this)); _role = new Agent.Roles.Agent(agentConfig, _publisherLoader, _checkLoader, _activityLoader); _role.Start(); return(_role); }
private void WatchFileEvents(string baseDirectory, NotificationEvents events) { if (mFileWatcher != null) mFileWatcher.Dispose(); NotifyFilters filters = 0; if ((events & NotificationEvents.Modified) != 0) filters |= NotifyFilters.Size | NotifyFilters.LastWrite; if ((events & NotificationEvents.Renamed) != 0) filters |= NotifyFilters.FileName; try { mFileWatcher = new FileSystemWatcher(); mFileWatcher.Filter = "*.*"; mFileWatcher.IncludeSubdirectories = true; mFileWatcher.NotifyFilter = filters; mFileWatcher.Changed += new FileSystemEventHandler(mFileWatcher_Changed); mFileWatcher.Created += new FileSystemEventHandler(mFileWatcher_Created); mFileWatcher.Renamed += new RenamedEventHandler(mFileWatcher_Renamed); mFileWatcher.Deleted += new FileSystemEventHandler(mFileWatcher_Deleted); mFileWatcher.Error += new ErrorEventHandler(mFileWatcher_Error); mFileWatcher.InternalBufferSize = 32768; mFileWatcher.Path = baseDirectory; mFileWatcher.EnableRaisingEvents = true; } catch(Exception) { mFileWatcher = null; } }
public void AddEventListener(NotificationEvents type, IEventListener listener, bool capture) { }
public void AddEventListener(NotificationEvents type, HtmlEventHandlerWithTarget<Notification> listener) { }
public void AddEventListener(NotificationEvents type, HtmlEventHandlerWithTarget <Notification> listener, bool capture) { }
public void AddEventListener(NotificationEvents type, IEventListener listener) { }
public void RemoveEventListener(NotificationEvents type, IEventListener listener) { }
public void AddEventListener(NotificationEvents type, HtmlEventHandler listener) { }
public void RemoveEventListener(NotificationEvents type, HtmlEventHandler listener, bool capture) { }
public void RemoveEventListener(NotificationEvents type, HtmlEventHandlerWithTarget <Notification> listener) { }
public void AddEventListener(NotificationEvents type, IEventListener listener) { }
public void AddEventListener(NotificationEvents type, HtmlEventHandler listener, bool capture) { }
public void RemoveEventListener(NotificationEvents type, HtmlEventHandler listener) { }
public void Watch(string baseDirectory, NotificationEvents events) { mBaseDirectory = baseDirectory; mNotificationEvents = events; if( (events & (NotificationEvents.Modified | NotificationEvents.Created | NotificationEvents.Deleted | NotificationEvents.Renamed)) != 0) { WatchFileEvents(baseDirectory, events); } if((events & NotificationEvents.AttributesChanged) != 0) { WatchAttributeEvents(baseDirectory); } }
public void RemoveEventListener(NotificationEvents type, IEventListener listener, bool capture) { }
public void RemoveEventListener(NotificationEvents type, IEventListener listener) { }
public void RemoveEventListener(NotificationEvents type, HtmlEventHandlerWithTarget<Notification> listener, bool capture) { }
public void RemoveEventListener(NotificationEvents type, Action listener, bool capture) { }
public void AddEventListener(NotificationEvents type, Action listener, bool capture) { }