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);
                }
            }
        }
Beispiel #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();
        }