Ejemplo n.º 1
0
        public void ExcludeOver(catTypes cat, int hour, int day, int month, int year, int minMinute)
        {
            switch (cat)
            {
                case catTypes.Day:
                    for (int i = 0; i < 24; i++)
                    {
                        crit.ExcludeTimes.Add(new VersionInfoSearchCriteria.ExcludeTime(i,-1,year,month,day));
                    }
                break;

                case catTypes.Hour:
                    for (int i = 0; i < minMinute; i++)
                    {
                        crit.ExcludeTimes.Add(new VersionInfoSearchCriteria.ExcludeTime(hour, i, year, month, day));
                    }
                break;

                case catTypes.Month:
                    for (int i = 0; i < 32; i++)
                    {
                        crit.ExcludeTimes.Add(new VersionInfoSearchCriteria.ExcludeTime(-1, -1, year, month, i));
                    }
                break;

                case catTypes.Year:
                    for (int i = 0; i < 13; i++)
                    {
                        crit.ExcludeTimes.Add(new VersionInfoSearchCriteria.ExcludeTime(-1, -1, year, i, -1));
                    }
                break;

            }
        }
Ejemplo n.º 2
0
        private void Exclude(VersionInfoSearchCriteria crit,catTypes cator)
        {
            switch(cator)
            {
                case catTypes.DayOW:
                    foreach (DayOfWeek day in Enum.GetValues(typeof(DayOfWeek)))
                    {
                        if (crit.DaysOfWeek.Contains(day) == false)
                        {
                            crit.AddDayOfWeek(day, true);
                        }
                    }
                break;

                case catTypes.Month:
                    for (int i = 1; i <= 12; i++)
                    {
                        if (crit.Months.Contains(i) == false)
                        {
                            crit.AddMonth(i, true);
                        }
                    }
                break;

                case catTypes.DayOM:
                    for (int i = 1; i <= 31; i++)
                    {
                        if (crit.DaysOfMonth.Contains(i) == false)
                        {
                            crit.AddDaysOfMonth(i, true);
                        }
                    }
                break;

                case catTypes.Hour:
                    for (int i = 0; i < 24; i++)
                    {
                        if (crit.Hours.Contains(i) == false)
                        {
                            crit.AddHours(i, true);
                        }
                    }
                break;

                case catTypes.Minute:
                    for (int i = 0; i < 60; i++)
                    {
                        if (crit.Minutes.Contains(i) == false)
                        {
                            crit.AddMinutes(i, true);
                        }
                    }
                break;

                case catTypes.Year:
                    foreach (int y in YearsList)
                    {
                        if (crit.Years.Contains(y) == false)
                        {
                            crit.AddYears(y, true);
                        }
                    }
                    break;

            }
        }