Ejemplo n.º 1
0
 /// <summary>
 /// Возвращает хэш-код данного экземпляра.
 /// </summary>
 /// <returns>
 /// 32-разрядное целое число со знаком, являющееся хэш-кодом для данного экземпляра.
 /// </returns>
 /// <filterpriority>2</filterpriority>
 public override int GetHashCode()
 {
     return(StartingAt.GetHashCode()
            ^ EndingAt.GetHashCode()
            ^ Period.GetHashCode()
            ^ OccursEvery.GetHashCode()
            ^ IsSingleLanch.GetHashCode());
 }
Ejemplo n.º 2
0
        public SchedulerModel()
        {
            Calendar    calendar = CultureInfo.CurrentCulture.Calendar;
            CultureInfo german   = new CultureInfo("ru-RU");
            DateTime    date     = DateTime.Now;

            cTimeConst   = date;
            cDate        = date;
            cTimeConst   = cTimeConst.AddHours(2);
            StartingAt   = date;
            StartingAt   = StartingAt.AddHours(1);
            EndingAt     = DateTime.Today.AddHours(23).AddMinutes(59).AddSeconds(59);
            DurationTo   = new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month));
            DurationFrom = new DateTime(date.Year, 1, 1);
            //Description.Text = _sheduling.DescriptionFor(ApplySheduling());

            DailyPeriod       = 1;
            SingleLanchPeriod = 1;
            WeeklyPeriod      = 1;
            DayOffset         = 1;
            MonthlyPeriod     = 1;
            tbxMonthNumFor    = 1;
            var list = new List <SelectListItem>();

            foreach (RhythmByWeek part in Enum.GetValues(typeof(RhythmByWeek)))
            {
                var x = new SelectListItem {
                    Text = GetNameRhythmByWeek(part), Value = ((int)part).ToString()
                };
                list.Add(x);
            }
            _WeekPartList = new SelectList(list, "Value", "Text");
            list          = new List <SelectListItem>();
            foreach (DayOfWeek week in Enum.GetValues(typeof(DayOfWeek)).Cast <DayOfWeek>().Where(x => x != DayOfWeek.Sunday))
            {
                var x = new SelectListItem {
                    Text = german.DateTimeFormat.DayNames[(int)week], Value = ((int)week).ToString()
                };
                list.Add(x);
            }
            var y = new SelectListItem {
                Text = german.DateTimeFormat.DayNames[(int)DayOfWeek.Sunday], Value = ((int)DayOfWeek.Sunday).ToString()
            };

            list.Add(y);
            _listDayOfWeek = new SelectList(list, "Value", "Text");

            list = new List <SelectListItem>();
            foreach (RhythmByTime part in Enum.GetValues(typeof(RhythmByTime)))
            {
                var x = new SelectListItem {
                    Text = GetName(part), Value = ((int)part).ToString()
                };
                list.Add(x);
            }
            _RhythmByTime = new SelectList(list, "Value", "Text");
        }
Ejemplo n.º 3
0
 public override string ToString()
 {
     return(" ID: " + Id +
            " DateTime: " + StartingAt.ToString() +
            " Route: " + Route.ToString());
 }