예제 #1
0
        /// <summary>
        /// Equality comparison between this and the supplied representation. This
        /// representation must be of type XSGDay
        /// </summary>
        /// <param name="arg">
        ///            The XSGDay to compare with </param>
        /// <returns> True if the two representations are of the same day. False
        ///         otherwise </returns>
        /// <exception cref="DynamicError"> </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public boolean eq(AnyType arg, org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public virtual bool eq(AnyType arg, DynamicContext dynamicContext)
        {
            XSGDay   val     = (XSGDay)NumericType.get_single_type(arg, typeof(XSGDay));
            Calendar thiscal = normalizeCalendar(calendar(), tz());
            Calendar thatcal = normalizeCalendar(val.calendar(), val.tz());

            return(thiscal.Equals(thatcal));
        }
예제 #2
0
        private XSGDay castGDay(AnyAtomicType aat)
        {
            if (aat is XSGDay)
            {
                XSGDay gday = (XSGDay)aat;
                return(new XSGDay(gday.calendar(), gday.tz()));
            }

            if (aat is XSDate)
            {
                XSDate date = (XSDate)aat;
                return(new XSGDay(date.calendar(), date.tz()));
            }

            if (aat is XSDateTime)
            {
                XSDateTime dateTime = (XSDateTime)aat;
                return(new XSGDay(dateTime.calendar(), dateTime.tz()));
            }
            return(parse_gDay(aat.StringValue));
        }