예제 #1
0
        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));
            }
        }
예제 #2
0
        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();
            });
        }
예제 #3
0
        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());
        }
예제 #4
0
        public override Task OnConnected()
        {
            NotificationEvents notificationEvents = new NotificationEvents();

            Clients.Caller.returnSportEv(notificationEvents.GetSportEv());



            return(base.OnConnected());
        }
예제 #5
0
        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);
            }
        }
예제 #6
0
        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();
        }
예제 #7
0
        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());
                        }
                    }
                }
            }
        }
예제 #8
0
        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);
            }
        }
예제 #10
0
        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());
        }
예제 #11
0
        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);
        }
예제 #12
0
		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;
			}
		}
예제 #13
0
 public void AddEventListener(NotificationEvents type, IEventListener listener, bool capture)
 {
 }
예제 #14
0
 public void AddEventListener(NotificationEvents type, HtmlEventHandlerWithTarget<Notification> listener)
 {
 }
예제 #15
0
 public void AddEventListener(NotificationEvents type, HtmlEventHandlerWithTarget <Notification> listener, bool capture)
 {
 }
예제 #16
0
 public void AddEventListener(NotificationEvents type, IEventListener listener)
 {
 }
예제 #17
0
 public void RemoveEventListener(NotificationEvents type, IEventListener listener)
 {
 }
예제 #18
0
 public void AddEventListener(NotificationEvents type, HtmlEventHandler listener)
 {
 }
예제 #19
0
 public void RemoveEventListener(NotificationEvents type, HtmlEventHandler listener, bool capture)
 {
 }
예제 #20
0
 public void RemoveEventListener(NotificationEvents type, HtmlEventHandlerWithTarget <Notification> listener)
 {
 }
예제 #21
0
 public void AddEventListener(NotificationEvents type, IEventListener listener)
 {
 }
예제 #22
0
 public void AddEventListener(NotificationEvents type, HtmlEventHandler listener, bool capture)
 {
 }
예제 #23
0
 public void RemoveEventListener(NotificationEvents type, HtmlEventHandler listener)
 {
 }
예제 #24
0
		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);
			}
		}
예제 #25
0
 public void RemoveEventListener(NotificationEvents type, IEventListener listener, bool capture)
 {
 }
예제 #26
0
 public void RemoveEventListener(NotificationEvents type, IEventListener listener)
 {
 }
예제 #27
0
 public void RemoveEventListener(NotificationEvents type, HtmlEventHandlerWithTarget<Notification> listener, bool capture)
 {
 }
예제 #28
0
 public void RemoveEventListener(NotificationEvents type, Action listener, bool capture)
 {
 }
예제 #29
0
 public void AddEventListener(NotificationEvents type, Action listener, bool capture)
 {
 }