Example #1
0
 public override void InitXml(System.Xml.XmlNode node)
 {
     base.InitXml(node);
     m_start = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "start"), DateTimeFormatInfo.InvariantInfo);
     m_end   = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "end"), DateTimeFormatInfo.InvariantInfo);
     m_type  = (DateMatchType)XmlUtils.GetMandatoryIntegerAttributeValue(node, "type");
 }
Example #2
0
        /// <summary>
        /// Tests if two dates are the same, given a mask as DateMatchType.
        ///
        /// ie, 20070605 will match 20070705 if DateMatchType is Day or Year.
        /// </summary>
        /// <param name="fulldate">The fulldate in TLDate format (int).</param>
        /// <param name="matchdate">The matchdate to test against (int).</param>
        /// <param name="dmt">The "mask" that says what to pay attention to when matching.</param>
        /// <returns></returns>
        public static bool TLDateMatch(int fulldate, int matchdate, DateMatchType dmt)
        {
            const int d = 0, m = 1, y = 2;

            if (dmt == DateMatchType.None)
            {
                return(false);
            }
            bool matched = true;

            // if we're requesting a day match,
            if ((dmt & DateMatchType.Day) == DateMatchType.Day)
            {
                matched &= TLDateSplit(fulldate)[d] == TLDateSplit(matchdate)[d];
            }
            if ((dmt & DateMatchType.Month) == DateMatchType.Month)
            {
                matched &= TLDateSplit(fulldate)[m] == TLDateSplit(matchdate)[m];
            }
            if ((dmt & DateMatchType.Year) == DateMatchType.Year)
            {
                matched &= TLDateSplit(fulldate)[y] == TLDateSplit(matchdate)[y];
            }
            return(matched);
        }
Example #3
0
 public DateTimeMatcher(DateTime start, DateTime end, DateMatchType type)
 {
     m_start            = start;
     m_end              = end;
     m_type             = type;
     IsStartAD          = true;
     IsEndAD            = true;
     UnspecificMatching = false;
 }
Example #4
0
		public DateTimeMatcher(DateTime start, DateTime end, DateMatchType type)
		{
			m_start = start;
			m_end = end;
			m_type = type;
			IsStartAD = true;
			IsEndAD = true;
			UnspecificMatching = false;
		}
Example #5
0
 public override void InitXml(System.Xml.XmlNode node)
 {
     base.InitXml(node);
     m_start            = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "start"), DateTimeFormatInfo.InvariantInfo);
     m_end              = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "end"), DateTimeFormatInfo.InvariantInfo);
     m_type             = (DateMatchType)XmlUtils.GetMandatoryIntegerAttributeValue(node, "type");
     HandleGenDate      = XmlUtils.GetOptionalBooleanAttributeValue(node, "genDate", false);
     IsStartAD          = XmlUtils.GetOptionalBooleanAttributeValue(node, "startAD", true);
     IsEndAD            = XmlUtils.GetOptionalBooleanAttributeValue(node, "endAD", true);
     UnspecificMatching = XmlUtils.GetOptionalBooleanAttributeValue(node, "unspecific", false);
 }
Example #6
0
 public DateTimeMatcher(DateTime start, DateTime end, DateMatchType type)
 {
     m_start = start;
     m_end   = end;
     m_type  = type;
 }
Example #7
0
 /// <summary>
 /// Tests if two dates are the same, given a mask as DateMatchType.
 /// 
 /// ie, 20070605 will match 20070705 if DateMatchType is Day or Year.
 /// </summary>
 /// <param name="fulldate">The fulldate in TLDate format (int).</param>
 /// <param name="matchdate">The matchdate to test against (int).</param>
 /// <param name="dmt">The "mask" that says what to pay attention to when matching.</param>
 /// <returns></returns>
 public static bool TLDateMatch(int fulldate,int matchdate, DateMatchType dmt)
 {
     const int d = 0, m=1,y=2;
     if (dmt == DateMatchType.None) 
         return false;
     bool matched = true;
     // if we're requesting a day match,
     if ((dmt & DateMatchType.Day) == DateMatchType.Day)
         matched &= TLDateSplit(fulldate)[d] == TLDateSplit(matchdate)[d];
     if ((dmt & DateMatchType.Month)==DateMatchType.Month)
         matched &= TLDateSplit(fulldate)[m] == TLDateSplit(matchdate)[m];
     if ((dmt & DateMatchType.Year)== DateMatchType.Year)
         matched &= TLDateSplit(fulldate)[y] == TLDateSplit(matchdate)[y];
     return matched;
 }
Example #8
0
 /// <summary>
 /// Adds a single DateFilter
 /// </summary>
 /// <param name="date">The date.</param>
 /// <param name="type">The type.</param>
 public void DateFilter(int date, DateMatchType type)
 {
     datelist.Add(new TLDateFilter(date, type));
 }
Example #9
0
 public TLDateFilter(int date, DateMatchType type)
 { this.date = date; this.type = type; }
Example #10
0
 public QlDateFilter(int date, DateMatchType type)
 {
     Date = date; Type = type;
 }
Example #11
0
 /// <summary>
 /// Adds a single DateFilter
 /// </summary>
 /// <param name="date">The date.</param>
 /// <param name="type">The type.</param>
 public void DateFilter(int date, DateMatchType type)
 {
     _datelist.Add(new QlDateFilter(date, type));
 }
Example #12
0
		public override void InitXml(System.Xml.XmlNode node)
		{
			base.InitXml(node);
			m_start = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "start"), DateTimeFormatInfo.InvariantInfo);
			m_end = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "end"), DateTimeFormatInfo.InvariantInfo);
			m_type = (DateMatchType)XmlUtils.GetMandatoryIntegerAttributeValue(node, "type");
			HandleGenDate = XmlUtils.GetOptionalBooleanAttributeValue(node, "genDate", false);
			IsStartAD = XmlUtils.GetOptionalBooleanAttributeValue(node, "startAD", true);
			IsEndAD = XmlUtils.GetOptionalBooleanAttributeValue(node, "endAD", true);
			UnspecificMatching = XmlUtils.GetOptionalBooleanAttributeValue(node, "unspecific", false);
		}
Example #13
0
		public override void InitXml(System.Xml.XmlNode node)
		{
			base.InitXml(node);
			m_start = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "start"), DateTimeFormatInfo.InvariantInfo);
			m_end = DateTime.Parse(XmlUtils.GetManditoryAttributeValue(node, "end"), DateTimeFormatInfo.InvariantInfo);
			m_type = (DateMatchType)XmlUtils.GetMandatoryIntegerAttributeValue(node, "type");
		}
Example #14
0
		public DateTimeMatcher(DateTime start, DateTime end, DateMatchType type)
		{
			m_start = start;
			m_end = end;
			m_type = type;
		}
Example #15
0
 public TLDateFilter(int date, DateMatchType type)
 {
     this.date = date; this.type = type;
 }