Example #1
0
        private void PopulateNumeric()
        {
            Element.PeriodType periodType = Element.PeriodType.duration;
            element               = new Node(Element.CreateMonetaryElement("test", false, Element.BalanceType.credit, periodType));
            contextRef            = new ContextProperty();
            contextRef.PeriodType = periodType;

            unitRef = new UnitProperty();

            markupData = "-123.12";
        }
Example #2
0
        private void PopulateNonNumeric()
        {
            Element.PeriodType periodType = Element.PeriodType.duration;
            element               = new Node(Element.CreateElement(Element.DataTypeCode.String, "test", false, periodType));
            contextRef            = new ContextProperty();
            contextRef.PeriodType = periodType;

            unitRef = null;

            markupData = "Test Markup Data";
        }
Example #3
0
        private bool ParsePeriods(XmlNode timePeriod, XmlNamespaceManager theManager)
        {
            XmlNode start = (XmlElement)timePeriod.SelectSingleNode("./link2:" + START_DATE, theManager);

            if (start == null)
            {
                start = (XmlElement)timePeriod.SelectSingleNode("./" + START_DATE);
            }

            if (start != null)
            {
                PeriodType      = Element.PeriodType.duration;
                PeriodStartDate = DateTime.Parse(start.InnerXml);

                XmlNode end = (XmlElement)timePeriod.SelectSingleNode("./link2:" + END_DATE, theManager);
                if (end == null)
                {
                    end = (XmlElement)timePeriod.SelectSingleNode("./" + END_DATE);
                }

                PeriodEndDate = DateTime.Parse(end.InnerXml);
            }
            else
            {
                XmlNode instant = timePeriod.SelectSingleNode("./link2:" + INSTANT, theManager);
                if (instant == null)
                {
                    instant = timePeriod.SelectSingleNode("./" + INSTANT);
                }

                if (instant != null)
                {
                    PeriodType      = Element.PeriodType.instant;
                    PeriodStartDate = DateTime.Parse(instant.InnerXml);
                }
                else
                {
                    //it's got to be forever
                    if (timePeriod.InnerXml.IndexOf(FOREVER) == -1)
                    {
                        Common.WriteError("XBRLParser.Error.MissingRequiredField", ErrorList, "TimePeriod detail");
                        return(false);
                    }
                    else
                    {
                        PeriodType = Element.PeriodType.forever;
                    }
                }
            }

            return(true);
        }
Example #4
0
 /// <summary>
 /// Creates a new <see cref="CalendarPeriod"/> of a duration from
 /// <paramref name="startDate"/> to <paramref name="endDate"/>.
 /// </summary>
 /// <param name="startDate">The <see cref="DateTime"/> on which to
 /// begin the duration.</param>
 /// <param name="endDate"></param>
 public CalendarPeriod( DateTime startDate, DateTime endDate )
 {
     this.PeriodType = Element.PeriodType.duration;
     this.StartDate = startDate;
     this.EndDate = endDate;
 }
Example #5
0
 /// <summary>
 /// Creates a new <see cref="CalendarPeriod"/> of instant duration with
 /// <paramref name="asOfDate"/> indicating the date.
 /// </summary>
 /// <param name="asOfDate">The <see cref="DateTime"/> with which to
 /// iniate the object.</param>
 public CalendarPeriod( DateTime asOfDate )
 {
     this.PeriodType = Element.PeriodType.instant;
     this.StartDate = asOfDate;
 }
Example #6
0
 /// <summary>
 /// Creates a new <see cref="CalendarPeriod"/> of a duration from
 /// <paramref name="startDate"/> to <paramref name="endDate"/>.
 /// </summary>
 /// <param name="startDate">The <see cref="DateTime"/> on which to
 /// begin the duration.</param>
 /// <param name="endDate"></param>
 public CalendarPeriod(DateTime startDate, DateTime endDate)
 {
     this.PeriodType = Element.PeriodType.duration;
     this.StartDate  = startDate;
     this.EndDate    = endDate;
 }
Example #7
0
 /// <summary>
 /// Creates a new <see cref="CalendarPeriod"/> of instant duration with
 /// <paramref name="asOfDate"/> indicating the date.
 /// </summary>
 /// <param name="asOfDate">The <see cref="DateTime"/> with which to
 /// iniate the object.</param>
 public CalendarPeriod(DateTime asOfDate)
 {
     this.PeriodType = Element.PeriodType.instant;
     this.StartDate  = asOfDate;
 }
Example #8
0
        private bool ParsePeriods( XmlNode timePeriod, XmlNamespaceManager theManager )
        {
            XmlNode start = (XmlElement)timePeriod.SelectSingleNode( "./link2:" + START_DATE, theManager );
            if ( start == null )
            {
                start = (XmlElement)timePeriod.SelectSingleNode( "./" + START_DATE );
            }

            if ( start != null )
            {
                PeriodType = Element.PeriodType.duration;
                PeriodStartDate = DateTime.Parse( start.InnerXml );

                XmlNode end = (XmlElement)timePeriod.SelectSingleNode( "./link2:" + END_DATE, theManager );
                if ( end == null )
                {
                    end = (XmlElement)timePeriod.SelectSingleNode( "./" + END_DATE );
                }

                PeriodEndDate = DateTime.Parse( end.InnerXml );
            }
            else
            {
                XmlNode instant = timePeriod.SelectSingleNode( "./link2:" + INSTANT, theManager );
                if ( instant == null )
                {
                    instant = timePeriod.SelectSingleNode( "./" + INSTANT );
                }

                if ( instant != null )
                {
                    PeriodType = Element.PeriodType.instant;
                    PeriodStartDate = DateTime.Parse( instant.InnerXml );
                }
                else
                {
                    //it's got to be forever
                    if ( timePeriod.InnerXml.IndexOf( FOREVER ) == -1 )
                    {
                        Common.WriteError( "XBRLParser.Error.MissingRequiredField", ErrorList, "TimePeriod detail" );
                        return false;
                    }
                    else
                    {
                        PeriodType = Element.PeriodType.forever;
                    }
                }
            }

            return true;
        }