public void ScanRecords()
        {
            string infoMsg = String.Format("Date : {0} Time : {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongTimeString());
            log.Info(infoMsg + " REQUESTED BY WEB SERVICE");

            try
            {
                NotificationController controller = new NotificationController();
                controller.Check();
            }
            catch (Exception ex)
            {
                log.Error("" + ex.Message.ToString());
            }

            log.Info(infoMsg + " RESPONDED BY WEB SERVICE");
        }
        public NotifierApplicationContext()
        {
            //Instantiate the component Module to hold everything
            mComponents = new System.ComponentModel.Container();

            //Instantiate the NotifyIcon attaching it to the components container and
            //provide it an icon, note, you can imbed this resource
            mNotifyIcon = new NotifyIcon(this.mComponents);
            mNotifyIcon.Icon = new System.Drawing.Icon("Icon.ico");
            mNotifyIcon.Visible = true;

            //Instantiate the context menu and items
            mContextMenu = new ContextMenuStrip();

            //Attach the menu to the notify icon
            mNotifyIcon.ContextMenuStrip = mContextMenu;

            mCheckNow = new ToolStripMenuItem();
            mCheckNow.Text = "Check Now";
            mCheckNow.Click += mCheckNow_Click;

            mExitApplication = new ToolStripMenuItem();
            mExitApplication.Text = "Exit";
            mExitApplication.Click += mExitApplication_Click;

            mStartMonitoring = new ToolStripMenuItem();
            mStartMonitoring.Text = "Start";
            mStartMonitoring.Click += mStartMonitoring_Click;

            mStopMonitoring = new ToolStripMenuItem();
            mStopMonitoring.Text = "Stop";
            mStopMonitoring.Click += mStopMonitoring_Click;

            mContextMenu.Items.Add(mStartMonitoring);
            mContextMenu.Items.Add(mCheckNow);
            mContextMenu.Items.Add(mStopMonitoring);
            mContextMenu.Items.Add(mExitApplication);

            mController = new NotificationController();

            StateChange();
        }
        static async Task Main(string[] args)
        {
            NotificationController.GetInstance().StartTimer();

            Console.Title = "Samples.PubSub.Notifier";
            var endpointConfiguration = new EndpointConfiguration("Samples.PubSub.Notifier");

            endpointConfiguration.UsePersistence <LearningPersistence>();
            endpointConfiguration.UseTransport <LearningTransport>();
            endpointConfiguration.UseSerialization <NewtonsoftSerializer>();


            endpointConfiguration.SendFailedMessagesTo("error");
            endpointConfiguration.EnableInstallers();

            var endpointInstance = await Endpoint.Start(endpointConfiguration)
                                   .ConfigureAwait(false);

            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
            await endpointInstance.Stop()
            .ConfigureAwait(false);
        }
Example #4
0
 static NotificationController()
 {
     _notificationController = new NotificationController();
 }