private void buttonTestAll_Click(object sender, RoutedEventArgs e)
        {
            cmbContentTypes.IsEnabled         = false;
            buttonGetContentList.IsEnabled    = false;
            buttonStartBot.IsEnabled          = false;
            buttonStopBot.IsEnabled           = false;
            buttonSaveConfiguration.IsEnabled = false;
            buttonTestAll.IsEnabled           = false;
            buttonListFiles.IsEnabled         = false;

            HashSet <ContentType> types = new HashSet <ContentType>()
            {
                ContentType.REPORT, ContentType.NOTICE
            };

            NotifierManager = new KidsNoteNotifierManager(types);

            DateTime scheduled = DateTime.Now;

            scheduled += new TimeSpan(0, 0, 0, 5);

            KidsNoteScheduleParameters param = new KidsNoteScheduleParameters();

            param.Days = KidsNoteScheduleParameters.DaysType.MON_FRI;
            param.Job  = KidsNoteScheduleParameters.JobType.JOB_CHECK_NEW_CONTENTS;
            NotifierManager.AddJob(param);
            NotifierManager.Startup();
        }
        private void StartService()
        {
            if (Manager == null)
            {
                if (!Platform.IsRunningOnMono())
                {
                    Status.dwCurrentState = ServiceState.SERVICE_START_PENDING;
                    SetServiceStatus(this.ServiceHandle, ref Status);
                }

                Manager = new KidsNoteNotifierManager(MonitoringTypes);

                KidsNoteScheduleParameters param = new KidsNoteScheduleParameters();
                param.Days = KidsNoteScheduleParameters.DaysType.MON_FRI;
                param.Job  = KidsNoteScheduleParameters.JobType.JOB_CHECK_NEW_CONTENTS;
                Manager.AddJob(param);

                Manager.Startup();

                if (!Platform.IsRunningOnMono())
                {
                    Status.dwCurrentState = ServiceState.SERVICE_RUNNING;
                    SetServiceStatus(this.ServiceHandle, ref Status);
                }
            }
        }
Example #3
0
        public CliTester()
        {
            MonitoringTypes = new HashSet <ContentType>()
            {
                ContentType.REPORT, ContentType.NOTICE, ContentType.ALBUM
            };

            Manager = new KidsNoteNotifierManager(MonitoringTypes);

            KidsNoteScheduleParameters param = new KidsNoteScheduleParameters();

            param.Days = KidsNoteScheduleParameters.DaysType.MON_FRI;
            param.Job  = KidsNoteScheduleParameters.JobType.JOB_CHECK_NEW_CONTENTS;
            Manager.AddJob(param);

            Manager.Startup();
        }
Example #4
0
        public MainWindow()
        {
            InitializeComponent();

            HashSet <ContentType> types = new HashSet <ContentType>()
            {
                ContentType.REPORT, ContentType.NOTICE, ContentType.ALBUM
            };

            TheManager = new KidsNoteNotifierManager(types);
            TheManager.OnGetNewContents        = this.OnGetNewContents;
            TheManager.OnUploadProgressMessage = this.OnUploadProgressMessage;

            SelectedContents = new HashSet <KeyValuePair <ContentType, ulong> >();

            InitUi();
        }
        protected override void OnStop()
        {
            System.Console.WriteLine("stopping...");

            if (Manager != null)
            {
#if !MONO
                Status.dwCurrentState = ServiceState.SERVICE_PAUSE_PENDING;
                SetServiceStatus(this.ServiceHandle, ref Status);
#endif
                Manager.Cleanup();

#if !MONO
                Status.dwCurrentState = ServiceState.SERVICE_PAUSED;
                SetServiceStatus(this.ServiceHandle, ref Status);
#endif

                Manager = null;
            }
        }
        protected override void OnStop()
        {
            System.Console.WriteLine("stopping...");

            if (Manager != null)
            {
                if (!Platform.IsRunningOnMono())
                {
                    Status.dwCurrentState = ServiceState.SERVICE_PAUSE_PENDING;
                    SetServiceStatus(this.ServiceHandle, ref Status);
                }

                Manager.Cleanup();

                if (!Platform.IsRunningOnMono())
                {
                    Status.dwCurrentState = ServiceState.SERVICE_PAUSED;
                    SetServiceStatus(this.ServiceHandle, ref Status);
                }

                Manager = null;
            }
        }