Example #1
0
 void AdvanceMonth()
 {
     if (curMonth == Months.Fraessin) {
         curMonth = Months.Vendellan;
         AdvanceYear();
     } else {
         curMonth++;
     }
 }
        protected CronExpression(Months month, int dayNumber, int startHour, int startMinute, CronExpressionType expressionType)
        {
            _month = month;
            _dayNumber = dayNumber;
            _startHour = startHour;
            _startMinute = startMinute;
            _expressionType = expressionType;

            BuildCronExpression();
        }
Example #3
0
        public override void UpdateMonthCollection()
        {
            if (!MediaScheduleSettings.FlightDateStart.HasValue || !MediaScheduleSettings.FlightDateEnd.HasValue)
            {
                Months.Clear();
                return;
            }
            var months         = new List <CalendarMonth>();
            var startDate      = MediaScheduleSettings.FlightDateStart.Value;
            var monthTemplates = MediaScheduleSettings.MondayBased ?
                                 MediaMetaData.Instance.ListManager.MonthTemplatesMondayBased :
                                 MediaMetaData.Instance.ListManager.MonthTemplatesSundayBased;

            while (startDate <= MediaScheduleSettings.FlightDateEnd.Value)
            {
                var monthTemplate = monthTemplates.FirstOrDefault(mt => startDate >= mt.StartDate && startDate <= mt.EndDate);
                if (monthTemplate == null)
                {
                    continue;
                }

                startDate = monthTemplate.Month.Value;
                var month = Months.FirstOrDefault(x => x.Date == startDate);
                if (month == null)
                {
                    if (MediaScheduleSettings.MondayBased)
                    {
                        month = new CalendarMonthMediaMondayBased(this);
                    }
                    else
                    {
                        month = new CalendarMonthMediaSundayBased(this);
                    }
                    ApplyDefaultMonthSettings(month);
                }
                month.Date           = monthTemplate.Month.Value;
                month.DaysRangeBegin = monthTemplate.StartDate.Value;
                month.DaysRangeEnd   = monthTemplate.EndDate.Value;
                month.Days.Clear();
                month.Days.AddRange(Days.Where(x => x.Date >= month.DaysRangeBegin && x.Date <= month.DaysRangeEnd));
                months.Add(month);
                startDate = startDate.AddMonths(1);
            }
            Months.Clear();
            Months.AddRange(months);
        }
        private Months?AskMonth(string question)
        {
            Console.WriteLine(question);
            int    num = int.Parse(Console.ReadLine());
            Months m   = (Months)Enum.Parse(typeof(Months), num.ToString());

            if (Enum.IsDefined(typeof(Months), num) == true)
            {
                return(m);
            }
            else
            {
                Console.WriteLine("Invalide maand  {0}", num);

                return(null);
            }
        }
Example #5
0
        public void InitRealMonths()
        {
            Months.Clear();

            Months.Add("January", 31);
            Months.Add("February", 28);
            Months.Add("March", 31);
            Months.Add("April", 30);
            Months.Add("May", 31);
            Months.Add("June", 30);
            Months.Add("July", 31);
            Months.Add("August", 31);
            Months.Add("September", 30);
            Months.Add("October", 31);
            Months.Add("November", 30);
            Months.Add("December", 31);
        }
Example #6
0
 private void Init()
 {
     for (var i = 1; i <= 12; i++)
     {
         Months.Add(new MonthClass(i, Number));
     }
     if (Number != DateTime.Now.Year)
     {
         SelectedMonth = Months[0];
         SelectedDay   = SelectedMonth.Days[0];
     }
     else
     {
         SelectedMonth = Months[DateTime.Now.Month - 1];
         SelectedDay   = SelectedMonth.Days[DateTime.Now.Day - 1];
     }
 }
Example #7
0
        private static Months GetMonthFromString(string text)
        {
            text = text.ToLower();
            Months foundMonth = Months.NONE;
            // get an array of the months
            var months = Enum.GetValues(typeof(Months));

            foreach (Months month in months)
            {
                if (text.Contains(month.ToString().ToLower()))
                {
                    foundMonth = month;
                    break;
                }
            }
            return(foundMonth);
        }
Example #8
0
        static void Main(string[] args)
        {
            Console.WriteLine("The value of Jan is " + Months.Jan);
            Console.WriteLine("The integral value of Jan is " + (int)Months.Jan);
            //U could get all the possible values of an Enum using Enum class
            Array values = Enum.GetValues(typeof(Months)); //typeof operator in C# is used to get the type info about the User Defined type.

            foreach (object val in values)
            {
                Console.WriteLine(val);
            }
            //To take the input from the Console:Enum.Parse method...
            Console.WriteLine("Enter the value from the List above");
            string value    = Console.ReadLine();
            Months selected = (Months)Enum.Parse(typeof(Months), value);

            switch (selected)
            {
            case Months.Dec:
            case Months.Jan:
            case Months.Feb:
                Console.WriteLine("Cold Winter");
                break;

            case Months.Mar:
                Console.WriteLine("Springs season");
                break;

            case Months.Apr:
            case Months.May:
                Console.WriteLine("Hot Summer");
                break;

            case Months.Jun:
            case Months.Jul:
            case Months.Aug:
                Console.WriteLine("Rainy Monsoon");
                break;

            case Months.Sep:
            case Months.Oct:
            case Months.Nov:
                Console.WriteLine("autumn season");
                break;
            }
        }
Example #9
0
        public static Reservation MakeReservation(int rId, String rCity, String rBrand, int rPrice)
        {
            Console.WriteLine("--Gestion de reserva--");
            Reservation rev = new Reservation();

            Console.WriteLine("Cuantos dias quiere arrendar");
            int days = Optimize.ValInt();

            Console.WriteLine("En que mes realizara el arriendo");
            int    key   = Optimize.ValInt();
            Months m     = ((Months)key);
            String month = m.ToString();
            int    bill  = rev.Billing(rPrice, days);

            rev = new Reservation(rId, days, month, rCity, rBrand, bill);
            return(rev);
        }
Example #10
0
        static void Main()
        {
            //Enums

            //will return a string array containing all of the names of the months
            string[] months = Enum.GetNames(typeof(Months));
            foreach (string month in months)
            {
                Console.WriteLine($"Month: {month}");
            }

            Console.WriteLine("\nEnter a month as shown above");
            try
            {
                //will convert (parse) a string to an Enum
                Months usersMonth = (Months)Enum.Parse(typeof(Months), Console.ReadLine());
                Console.WriteLine($"Sucsess! {usersMonth}");
            }
            catch (ArgumentException)
            {
                Console.WriteLine("failed to parse");
            }

            //class exercise
            string[] weekDays = Enum.GetNames(typeof(WeekDays));
            Console.WriteLine("\nWeekDays\n");
            foreach (string day in weekDays)
            {
                Console.WriteLine($"Day: {day}");
            }

            Console.WriteLine("\nEnter a day as shown above");
            WeekDays userDay;

            try
            {
                userDay = (WeekDays)Enum.Parse(typeof(WeekDays), Console.ReadLine());
            }
            catch (ArgumentException)
            {
                Console.WriteLine("failed to parse defaulted to Sunday");
                userDay = WeekDays.Sunday;
            }
            Console.WriteLine(IsWeekEnd(userDay));
        }
 // Constructor for the record class - Sets the property values of the constructed record object from the passed parameters
 public Record(int year, Months month, int day, double magnitude, double latitude, double longitude,
               double depth, string region, long irisID, TimeSpan time, long timeStamp, DateTime date, DateTime dateOnly, string dataSet)
 {
     this.year      = year;
     this.month     = month;
     this.day       = day;
     this.magnitude = magnitude;
     this.latitude  = latitude;
     this.longitude = longitude;
     this.depth     = depth;
     this.region    = region;
     this.irisID    = irisID;
     this.time      = time;
     this.timeStamp = timeStamp;
     this.date      = date;
     this.dateOnly  = dateOnly;
     this.dataSet   = dataSet;
 }
 public void FillForm(User user)
 {
     RadioButtons[0].Click();
     CustomerFirstName.SendKeys(user.FirstName);
     CustomerLastName.SendKeys(user.LastName);
     Password.SendKeys(user.Password);
     Days.SelectByValue(user.Day);
     Months.SelectByValue(user.Month);
     Years.SelectByValue(user.Year);
     FirstName.SendKeys(user.AddressFirstName);
     LastName.SendKeys(user.AddressLastName);
     Address.SendKeys(user.Address);
     City.SendKeys(user.City);
     State.SelectByText(user.State);
     PostCode.SendKeys(user.Postalcode);
     Phone.SendKeys(user.MobilePhone);
     Alias.SendKeys(user.Alias);
 }
Example #13
0
 public void FillForm(Registration_User user)
 {
     radioButton[0].Click();
     firstNameField.SendKeys(user.firstNameField);
     lastNameField.SendKeys(user.lastNameField);
     passwordField.SendKeys(user.passwordField);
     Days.SelectByValue(user.dateDD);
     Months.SelectByValue(user.monthDD);
     Years.SelectByValue(user.yearDD);
     addressFirstName.SendKeys(user.addressFirstName);
     addressField.SendKeys(user.addressField);
     cityField.SendKeys(user.cityField);
     State.SelectByValue(user.stateDD);
     postcode.SendKeys(user.postcode);
     phoneField.SendKeys(user.phoneField);
     alias.SendKeys(user.alias);
     registerButton.Click();
 }
Example #14
0
        public int CompareTo(object obj)
        {
            if (!(obj is Date))
            {
                throw new ArgumentException("Object is not a Date");
            }
            Date other = (Date)obj;

            if (years != other.years)
            {
                return(years.CompareTo(other.Years));
            }
            if (Months != other.Months)
            {
                return(Months.CompareTo(other.Months));
            }
            return(Days.CompareTo(other.Days));
        }
        public static async Task<bool> FetchEvents(Months month)
        {
            try
            {
                HttpClient client = new HttpClient();
                
                string uri = "https://iecsemanipal.com/app/events.php";
                var content = new FormUrlEncodedContent(new[]
                {
                    new KeyValuePair<string,string>("month","12")

                });
                    var response = await client.PostAsync(uri, content);
                    response.EnsureSuccessStatusCode();
                    var resonseString = response.Content.ReadAsStringAsync().Result;
                    Debug.WriteLine(response.ToString());
                    var responseString = response.Content.ReadAsStringAsync().Result;
                    var ResponseObj = JsonConvert.DeserializeObject<EventResponse>(responseString);

                    switch (ResponseObj.status)
                    {
                        case "602":

                        case "604":
                            return false;

                        case "611":
                            foreach (Event e in ResponseObj.events)
                            {
                                App.fetchedEvents.Add(e);
                            }
                            return true;
                        default:
                            return false;
                    }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.StackTrace);
                return false;
            }


        }
Example #16
0
        public static string ToCronRepresentationSingle(Months month)
        {
            switch (month)
            {
            case Months.January:
                return("JAN");

            case Months.February:
                return("FEB");

            case Months.March:
                return("MAR");

            case Months.April:
                return("APR");

            case Months.May:
                return("MAY");

            case Months.June:
                return("JUN");

            case Months.July:
                return("JUL");

            case Months.August:
                return("AUG");

            case Months.September:
                return("SEP");

            case Months.October:
                return("OCT");

            case Months.November:
                return("NOV");

            case Months.December:
                return("DEC");

            default:
                throw new ArgumentException();
            }
        }
        protected void DeserializeInternal <TMonth, TDay, TNote>(XmlNode node)
            where TMonth : CalendarMonth
            where TDay : CalendarDay
            where TNote : CalendarNote
        {
            foreach (XmlNode childNode in node.ChildNodes)
            {
                switch (childNode.Name)
                {
                case "Days":
                    Days.Clear();
                    foreach (XmlNode dayNode in childNode.ChildNodes)
                    {
                        var day = (TDay)Activator.CreateInstance(typeof(TDay));
                        day.Deserialize(dayNode);
                        Days.Add(day);
                    }
                    break;

                case "Months":
                    Months.Clear();
                    foreach (XmlNode monthNode in childNode.ChildNodes)
                    {
                        var month = (TMonth)Activator.CreateInstance(typeof(TMonth));
                        month.Deserialize(monthNode);
                        Months.Add(month);
                    }
                    break;

                case "CalendarNotes":
                    Notes.Clear();
                    foreach (XmlNode noteNode in childNode.ChildNodes)
                    {
                        var note = (TNote)Activator.CreateInstance(typeof(TNote));
                        note.Deserialize(noteNode);
                        if (note.StartDay != DateTime.MinValue && note.FinishDay != DateTime.MinValue)
                        {
                            Notes.Add(note);
                        }
                    }
                    break;
                }
            }
        }
        private void CacheNextMonths()
        {
            var monthsToAdd = new List <MonthViewModel>();
            var lastMonth   = Months.Last();

            for (int i = 1; i < CachedMonthCount; i++)
            {
                var monthToAddDateTime = lastMonth.CurrentDate.AddMonths(i);
                var monthToAdd         = new MonthViewModel(
                    monthToAddDateTime,
                    SelectDayCommand,
                    _toDoCalendarViewModel.GetDaysWithToDoByDateAndStatus(monthToAddDateTime, ConstantsHelper.Active),
                    _toDoCalendarViewModel.GetDaysWithToDoByDateAndStatus(monthToAddDateTime, ConstantsHelper.Completed));

                monthsToAdd.Add(monthToAdd);
                Months.RemoveAt(0);
            }
            Months.AddRange(monthsToAdd);
        }
        public void CalendarMonthsTest()
        {
            const int       startYear  = 2004;
            const YearMonth startMonth = YearMonth.November;
            const int       monthCount = 5;
            Months          months     = new Months(startYear, startMonth, monthCount);

            Assert.AreEqual(months.MonthCount, monthCount);
            Assert.AreEqual(months.StartMonth, startMonth);
            Assert.AreEqual(months.StartYear, startYear);
            Assert.AreEqual(months.EndYear, 2005);
            Assert.AreEqual(months.EndMonth, YearMonth.March);
            Assert.AreEqual(months.GetMonths().Count, monthCount);
            Assert.IsTrue(months.GetMonths()[0].IsSamePeriod(new Month(2004, YearMonth.November)));
            Assert.IsTrue(months.GetMonths()[1].IsSamePeriod(new Month(2004, YearMonth.December)));
            Assert.IsTrue(months.GetMonths()[2].IsSamePeriod(new Month(2005, YearMonth.January)));
            Assert.IsTrue(months.GetMonths()[3].IsSamePeriod(new Month(2005, YearMonth.February)));
            Assert.IsTrue(months.GetMonths()[4].IsSamePeriod(new Month(2005, YearMonth.March)));
        } // CalendarMonthsTest
Example #20
0
 public void FillForm(UserRegistration user)
 {
     RadioButtons[(int)Gender.Female].Click();
     ElementExtension.Type(CustomerFirstName, user.FirstName);
     ElementExtension.Type(CustomerLastName, user.LastName);
     ElementExtension.Type(Password, user.Password);
     Days.SelectByValue(user.Date);
     Months.SelectByValue(user.Month);
     Years.SelectByValue(user.Year);
     ElementExtension.Type(FirstName, user.PostFirstName);
     ElementExtension.Type(LastName, user.PostLastName);
     ElementExtension.Type(Address, user.Address);
     ElementExtension.Type(City, user.City);
     State.SelectByText(user.State);
     ElementExtension.Type(PostCode, user.PostCode);
     ElementExtension.Type(Phone, user.Phone);
     ElementExtension.Type(Alias, user.Alias);
     RegisterButton.Click();
 }
Example #21
0
 public void FillForm(RegistrationUser user)
 {
     RadioButtons[0].Click();
     CustomerFirstName.SendKeys(user.FirstName);
     CustomerLastName.SendKeys(user.LastName);
     Password.SendKeys(user.Password);
     Days.SelectByValue(user.Date);
     Months.SelectByValue(user.Month);
     Years.SelectByValue(user.Year);
     FirstName.SendKeys(user.RealFirstName);
     LastName.SendKeys(user.RealLastName);
     Address.SendKeys(user.Address);
     City.SendKeys(user.City);
     State.SelectByValue(user.State);
     PostCode.SendKeys(user.PostCode);
     Phone.SendKeys(user.Phone);
     Alias.SendKeys(user.Alias);
     RegisterButton.Click();
 }
Example #22
0
        private ObservableCollection <Month> CreateMonth(DateTime date)
        {
            months.Clear();

            int monthIndex = 1;

            while (monthIndex < 13)
            {
                Month month = new Month()
                {
                    SelectedDate = new DateTime(date.Year, monthIndex, date.AddMonths(monthIndex - 1).Day), DefaultDate = date, CurrentDate = date, Days = days == null?CreateDay(date) : days
                };
                month.MonthSelected += month_MonthSelected;
                Months.Add(month);

                monthIndex++;
            }
            return(months);
        }
Example #23
0
        static void Main(string[] args)
        {
            foreach (string item in SimpleDemo())
            {
                Console.WriteLine(item);
            }


            Console.WriteLine("------------------");

            Months mon = new Months();

            foreach (string m in mon)
            {
                Console.WriteLine(m);
            }

            Console.ReadKey();
        }
        /// <summary>
        /// Generates a random month.
        /// </summary>
        /// <param name="min">Min value.</param>
        /// <param name="max">Max value.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when <c>min</c> is less than 1.</exception>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when <c>max</c> is greater than 12.</exception>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when <c>min</c> is greater than <c>max</c>.</exception>
        /// <returns>Returns random generated month.</returns>
        public string NextMonth(int min = 1, int max = 12)
        {
            if (min < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(min), "min cannot be less than 1.");
            }

            if (max > 12)
            {
                throw new ArgumentOutOfRangeException(nameof(max), "max cannot be greater than 12.");
            }

            if (min > max)
            {
                throw new ArgumentOutOfRangeException(nameof(min), "min cannot be greater than max.");
            }

            return(PickRandomItem(Months.Skip(min - 1).Take(max - min - 1).ToList()).Item1);
        }
Example #25
0
        private void month_MonthSelected(object sender, MonthSelectArgs e)
        {
            Month month = e.Month;

            if (lastMonth != null)
            {
                for (int i = 0; i < Months.Count; i++)
                {
                    if (lastMonth.SelectedDate.Month == Months[i].SelectedDate.Month)
                    {
                        if (lastMonth.SelectedDate.Day == Months[i].SelectedDate.Day)
                        {
                            lastMonth = Months[i];
                            Months.RemoveAt(i);
                            Months.Insert(i, lastMonth);
                        }
                    }
                }
            }
            lastMonth = month;
            DateTime dateTime = DateTime.Now;

            try
            {
                dateTime         = lastMonth.SelectedDate;
                SelectedDateTime = new DateTime(YearTitle, dateTime.Month, dateTime.Day);
            }
            catch (Exception)
            {
                SelectedDateTime = DateTime.Now;
            }
            finally
            {
                UpdateDays(SelectedDateTime);
                semanticzoomDate.ToggleActiveView();
            }

            this.header.MonthTitle = SelectedDateTime.Month.ToString();
            this.header.YearTitle  = SelectedDateTime.Year.ToString();
            this.MonthTitle        = SelectedDateTime.Month;
            this.YearTitle         = SelectedDateTime.Year;
        }
        /// <summary>
        /// загрузка таблицы, начиная с заданной ячейки
        /// </summary>
        /// <param name="array"></param>
        /// <param name="startLine"></param>
        /// <param name="startCol"></param>
        /// <returns></returns>
        private Dataset loadTable(string[] array, int startLine, int startCol)
        {
            Dataset res = new Dataset();

            for (int i = startLine; i < startLine + 12; i++)
            {
                DataHours <double> dh    = new DataHours <double>();
                Months             month = (Months)(i - startLine + 1);
                string[]           line  = array[i].Split(';');

                for (int j = startCol; j < startCol + 24; j++)
                {
                    int    hour = j - startCol;
                    double val  = double.Parse(line[j].Replace(',', Constants.DecimalSeparator));
                    dh[hour] = val;
                }
                res[month] = dh;
            }
            return(res);
        }
Example #27
0
        public DataRange GenerateRange(DataItem dataItem)
        {
            DataRange res = new DataRange();

            for (int i = 0; i < 8760; i++)
            {
                long     ticks = (long)(i * 60 * 60 * 10e6);
                DateTime date  = new DateTime(ticks);
                Months   month = (Months)date.Month;
                int      hour  = date.Hour;

                double clsk = dataItem.DatasetClearSky[month][hour];
                double alsk = dataItem.DatasetAllsky[month][hour];

                RawItem ni = new RawItem(date, alsk, clsk);
                res.Add(ni);
            }

            return(res);
        }
        private void buttonSave_Click(object sender, EventArgs e)
        {
            foreach (TextBox tb in Textboxes.Values)
            {
                Months month = (Months)tb.Tag;
                if (string.IsNullOrWhiteSpace(tb.Text))
                {
                    _ = MessageBox.Show(this, $"Не удалось распознать значение месяца: {month.Description()}", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
                }
                if (!double.TryParse(tb.Text.Trim().Replace('.', Constants.DecimalSeparator), out double value))
                {
                    _ = MessageBox.Show(this, $"Не удалось распознать \"{tb.Text}\" как число", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
                }
                Values[month] = value;
            }

            Result       = Values;
            DialogResult = DialogResult.OK;
            Close();
        }
Example #29
0
        public bool Equals(CoarseDuration other)
        {
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Years.Equals(other.Years) &&
                   Months.Equals(other.Months) &&
                   Days.Equals(other.Days) &&
                   Hours.Equals(other.Hours) &&
                   Minutes.Equals(other.Minutes) &&
                   Seconds.Equals(other.Seconds) &&
                   Sign.Equals(other.Sign));
        }
Example #30
0
        public PersonPageVM()
        {
            ActorPage actorPage = new ActorPage();

            actorPage.DataContext = this;
            View = actorPage;

            for (int i = 1; i <= 31; i++)
            {
                Days.Add(i);
            }
            for (int i = 1; i <= 12; i++)
            {
                Months.Add(i);
            }
            for (int i = DateTime.Now.Year; i >= 1900; i--)
            {
                Years.Add(i);
            }
        }
Example #31
0
 public void FillFormEmail(UserProperty user)
 {
     Radiobuttons[0].Click();
     CustomerFirstName.SendKeys(user.FirstName);
     CustomerLastName.SendKeys(user.LastName);
     passwordField.SendKeys(user.Password);
     Days.SelectByValue(user.Day);
     Months.SelectByValue(user.Month);
     Years.SelectByValue(user.Year);
     FirstName.SendKeys(user.AdressFirstName);
     LastName.SendKeys(user.AddressLastName);
     Address.SendKeys(user.Address);
     City.SendKeys(user.City);
     State.SelectByText(user.State);
     PostCode.SendKeys(user.Postalcode);
     Phone.SendKeys(user.Phone);
     Alias.SendKeys(user.Alias);
     Email.Clear();
     RegisterButton.Click();
 }
Example #32
0
        // ----------------------------------------------------------------------
        public static void ShowAll(int periodCount, int year, YearMonth yearMonth)
        {
            WriteLine("Input: count={0}, year={1}, month={2}", periodCount, year, yearMonth);
            WriteLine();

            MonthTimeRange monthTimeRange;

            if (periodCount == 1)
            {
                Month month = new Month(year, yearMonth);
                monthTimeRange = month;

                Month previousMonth = month.GetPreviousMonth();
                Month nextMonth     = month.GetNextMonth();

                ShowMonth(month);
                ShowCompactMonth(previousMonth, "Previous Month");
                ShowCompactMonth(nextMonth, "Next Month");
                WriteLine();
            }
            else
            {
                Months months = new Months(year, yearMonth, periodCount);
                monthTimeRange = months;

                ShowMonths(months);
                WriteLine();

                foreach (Month month in months.GetMonths())
                {
                    ShowCompactMonth(month);
                }
                WriteLine();
            }

            foreach (Day day in monthTimeRange.GetDays())
            {
                DayDemo.ShowCompactDay(day);
            }
            WriteLine();
        }         // ShowAll
Example #33
0
        /// <summary>
        /// Output GEDCOM formatted text representing the age.
        /// </summary>
        /// <param name="tw">The writer to output to.</param>
        /// <param name="level">The GEDCOM level.</param>
        public void Output(TextWriter tw, int level)
        {
            tw.Write(Environment.NewLine);
            tw.Write(level);
            tw.Write(" AGE ");

            // never write out INFANT CHILD, this potentially loses information,
            // always write out < 1 or < 8  and includes months days if set
            if (StillBorn)
            {
                tw.Write("STILLBORN");
            }
            else
            {
                if (Equality < 0)
                {
                    tw.Write("< ");
                }
                else if (Equality > 0)
                {
                    tw.Write("> ");
                }

                if (Years != -1)
                {
                    tw.Write(Years.ToString());
                    tw.Write("y ");
                }

                if (Months != -1)
                {
                    tw.Write(Months.ToString());
                    tw.Write("m ");
                }
                else if (Days != -1)
                {
                    tw.Write(Days.ToString());
                    tw.Write("d");
                }
            }
        }
Example #34
0
        public async void ReadMyXML(string year)
        {
            Months = new Months();

            Progress<int> progress = new Progress<int>((p) => { ProgressPercent = p; });

            BasicFileDownloader bidl = new BasicFileDownloader(ToAbsoluteUri("xmlmonths.aspx?ay=" + year));
            IRandomAccessStream s = await bidl.DownloadAsync(progress);

            XmlReaderSettings settings = new XmlReaderSettings();
            settings.ConformanceLevel = ConformanceLevel.Fragment;
            settings.IgnoreWhitespace = true;
            settings.IgnoreComments = true;
            settings.Async = true;
            XmlReader reader = XmlReader.Create(s.AsStream(), settings);
            reader.ReadStartElement("Model");
            reader.ReadStartElement("Months");
            Count = 0;
            while (reader.IsStartElement())
            {
                string month = reader[0];
                string str = reader[1];
                str = str.Replace("_s.jpg", "");
                if (!String.IsNullOrEmpty(str))
                {
                    uint count = 0;
                    if (uint.TryParse(reader[2], out count))
                    {
                        Month m = new Month(month, str, count);
                        Months.Add(m);
                        Count += m.Count;
                    }
                }
                await reader.ReadAsync();
            }
        }
Example #35
0
 public static void Main()
 {
     var month=new Months();
 }
        protected CronExpression(DaySeqNumber dayNumber, DaysOfWeek days, Months month, int startHour, int startMinute, CronExpressionType expressionType)
        {
            _dayNumber = (int)dayNumber;
            _days = days;
            _month = month;
            _startHour = startHour;
            _startMinute = startMinute;
            _expressionType = expressionType;

            BuildCronExpression();
        }
 /// <summary>
 /// Create new CronExpression instance, which occurs on every first, 
 /// second, third or fourth day of the week on specific month *month*
 /// at specified hours
 /// </summary>
 /// <param name="dayNumber">Day sequental number (first, second, third, fourth)</param>
 /// <param name="days">Day of week</param>
 /// <param name="month">Month</param>
 /// <param name="hour">Hour, when occurence will happen</param>
 /// <param name="minute">Minute, when occurence will happen</param>
 /// <returns>New CronExpression instance</returns>
 public static CronExpression EverySpecificSeqWeekDayOfMonthAt(DaySeqNumber dayNumber, DaysOfWeek days, Months month, int hour, int minute)
 {
     var ce = new CronExpression(dayNumber, days, month, hour, minute, CronExpressionType.EverySpecificSeqWeekDayOfMonthAt);
     return ce;
 }
 /// <summary>
 /// Create new CronExpression instance, which occurs on every specific day *dayNumber* of 
 /// specific month *month* at specified hours
 /// </summary>
 /// <param name="month">Month</param>
 /// <param name="dayNumber">Day number</param>
 /// <param name="hour">Hour, when occurence will happen</param>
 /// <param name="minute">Minute, when occurence will happen</param>
 /// <returns>New CronExpression instance</returns>
 public static CronExpression EverySpecificDayOfMonthAt(Months month, int dayNumber, int hour, int minute)
 {
     var ce = new CronExpression(month, dayNumber, hour, minute, CronExpressionType.EverySpecificDayOfMonthAt);
     return ce;
 }
Example #39
0
 public bool CheckMonth(DateTime dateToCheck, Months month)
 {
     return dateToCheck.Month.Equals((int)month);
 }