Beispiel #1
0
        //Public Sub New() 'Questo costruttore serve per fare un nuovo ogg prima del deserializzatore?
        //End Sub

        /// <summary>
        /// </summary>
        /// <param name="periodicCycle">Se valorizzato verrà eseguita non più di una volta ogni unità di periodicita, es perdiocità settimanale = al massimo 1 volta a settimana</param>
        /// <param name="intervalloVerificaMs">Se 0 non verrà scatenato l'evento "Esegui" in automatico ma si dovrà richiamare il metodo Eseguibile per sapere se si ha il permesso dello scheduler</param>
        public SchedulerM(Periodicity periodicCycle = null, HourlyPeriods hourlyPeriods = null, WeekDays weekDays               = null, MonthsAndDays monthsAndDays = null, YearWeeks yearWeeks = null,
                          YearDays yearDays         = null, WeekDay weekStartsDay = WeekDay.Monday, UInt32 intervalloVerificaMs = 0)
        {
            //Creo gli oggetti per far in modo che i vari dataGrid abbiano gli oggetti su cui fare il binding
            this.PeriodicCycle   = periodicCycle;
            this.HourlyPeriods   = hourlyPeriods;
            this.WeekDays        = weekDays;
            this.MonthsAndDays   = monthsAndDays;
            this.YearWeeks       = yearWeeks;
            this.YearDays        = yearDays;
            this.WeekStartsDay   = weekStartsDay;
            this.CheckIntervalMs = intervalloVerificaMs;

            this.lastTimeExec          = DateTime.MinValue;
            this.firmeUltimeEsecuzione = new List <Tuple <DateTime, String> >();

            tmrCheckIfExecutable.Elapsed += TmrCheckIfExecutable_Elapsed;
        }
Beispiel #2
0
        private bool?ExecYearDays(YearDays yearDays, DateTime dataAtt, ref string firmaEsecuzione)
        {
            if (yearDays == null)
            {
                Log.main.Add(new Mess(LogType.Warn, Log.main.warnUserText, "oggetto yearDays a null ma isYearDaysEnabled a true"));
                return(null);     //Non ci sono filtri per GiorniSett
            }
            if (yearDays.Count == 0)
            {
                return(null);
            }

            //if (yearDays.Contains(dataAtt.DayOfYear) == false) return false;
            if ((from tmp in yearDays where tmp.Day == dataAtt.DayOfYear select tmp).Count() == 0)
            {
                return(false);
            }
            firmaEsecuzione += "nrGiorniDellAnno:" + dataAtt.DayOfYear + "|";
            return(true);
        }
Beispiel #3
0
        private bool?ExecYearDays(YearDays yearDays, DateTime dataAtt)
        {
            string tmp = "";

            return(ExecYearDays(yearDays, dataAtt, ref tmp));
        }