internal string GetOrdinalName(DayOrdinal ordinal) { try { string result = ordinal.ToString(); if (Instance.XLang != null) { if (Instance.XLang.Root != null) { XElement xp = Instance.XLang.Root.Element("lists"); if (xp != null) { xp = xp.Element("cboOrdinal"); if (xp != null) { string[] arr = xp.Value.Split('|'); result = arr[(int)ordinal - 1]; } } } } return(result); } catch (Exception ex) { PNStatic.LogException(ex); return(ordinal.ToString()); } }
/// <summary>Overriden. Returns the hash code for this instance.</summary> /// <returns>The hash code for this instance.</returns> public override int GetHashCode() { return(Frequency.GetHashCode() ^ Interval.GetHashCode() ^ DaysOfWeekMask.GetHashCode() ^ DayOfMonth.GetHashCode() ^ DayOrdinal.GetHashCode() ^ Month.GetHashCode()); }
private bool weekdayOccured(DateTime start, DateTime end, DayOfWeek dof, DayOrdinal ordinal) { try { var dateCurrent = start; while (dateCurrent < end) { if (dateCurrent.DayOfWeek == dof) { DayOrdinal ordTemp; var isLast = false; var ordCurrent = PNStatic.WeekdayOrdinal(dateCurrent, dateCurrent.DayOfWeek, ref isLast); if (isLast) { ordTemp = DayOrdinal.Last; } else { ordTemp = (DayOrdinal)ordCurrent; } if (ordTemp == ordinal) { return true; } } dateCurrent = dateCurrent.AddDays(1); } return false; } catch (Exception ex) { PNStatic.LogException(ex); return false; } }
internal string GetOrdinalName(DayOrdinal ordinal) { try { string result = ordinal.ToString(); if (Instance.XLang != null) { if (Instance.XLang.Root != null) { XElement xp = Instance.XLang.Root.Element("lists"); if (xp != null) { xp = xp.Element("cboOrdinal"); if (xp != null) { string[] arr = xp.Value.Split('|'); result = arr[(int)ordinal - 1]; } } } } return result; } catch (Exception ex) { PNStatic.LogException(ex); return ordinal.ToString(); } }