Example #1
0
        /// <summary>
        /// Creates and returns a new <see cref="Enumeration"/> of a Boolean type.
        /// </summary>
        /// <param name="name">The name to be assigned to the created <see cref="Enumeration"/>.</param>
        /// <returns>The newly created <see cref="Enumeration"/>.</returns>
        public static Enumeration CreateBooleanEnum( string name )
        {
            Enumeration enumer = new Enumeration( name );

            //US 22336: "Yes" and "No" are not actually valid values for Boolean within the XBRL spec:
            //http://www.schemacentral.com/sc/xbrl21/t-xbrli_booleanItemType.html.  However, given that users tend to think of
            //booleans as "Yes" and "No" validation has been updated to handle "Yes" and "No" values.
            //enumer.Values.Add( StringResourceUtility.GetString( "XBRLParser.BooleanEnumeration.Yes" ) );
            //enumer.Values.Add( StringResourceUtility.GetString( "XBRLParser.BooleanEnumeration.No" ) );
            enumer.Values.Add( StringResourceUtility.GetString( "XBRLParser.BooleanEnumeration.True" ) );
            enumer.Values.Add( StringResourceUtility.GetString( "XBRLParser.BooleanEnumeration.False" ) );

            return enumer;
        }
Example #2
0
        internal void LoadEnumerationsAndOtherExtendedDataTypes( out int errors )
        {
            errors = 0;
            if (IsAucentExtension && skipAucentExtensions && !this.innerTaxonomy)
            {
                //if this is a top level aucent extension taxonomy and ...
                //if the skipAucentExtensions is set to true ... we want to load just the no rivet created files...
                //as we will merge the rivet created files later....
                return ;
            }

            XmlNodeList enumNodes = theDocument.SelectNodes( COMPLEX_KEY_FOR_ENUM, theManager );
            if ( enumNodes != null && enumNodes.Count > 0 )
            {
                this.infos[0].HasCustomTypes = true;
                foreach ( XmlNode complexNode in enumNodes )
                {
                    // create an enumeration object
                    Enumeration e = new Enumeration();
                    XmlAttribute ComplexNodeName = complexNode.Attributes[NAME_TAG];

                    e.Name = string.Format(DocumentBase.NAME_FORMAT, GetNSPrefix(), ComplexNodeName.Value);

                    // look for a restriction
                    XmlNode restrictionNode = complexNode.SelectSingleNode( RESTRICTION_KEY, theManager );

                    if ( restrictionNode != null )
                    {
                        e.RestrictionType = restrictionNode.Attributes[BASE_TAG].Value;
                        extendedDataMappings[e.Name] = e.RestrictionType;
                    }

                    // now go through the enumerations
                    XmlNodeList enums = complexNode.SelectNodes( ENUM_KEY, theManager );
                    if ( enums == null || enums.Count == 0 )
                    {
                        //need to load other information regarding this complex type..

                        continue;
                    }

                    foreach ( XmlNode enumVal in enums )
                    {
                        e.Values.Add( enumVal.Attributes[VALUE_TAG].Value );
                    }

                    // and add it to the hashtable
                    enumTable[e.Name] = e;
                }
            }
        }
Example #3
0
        private Element(Element e, bool UseClone)
        {
            this.id = e.id;
            this.prefix = e.prefix;
            this.nameWithNSPrefix = e.nameWithNSPrefix;
            this.name = e.name;
            this.type = e.type;
            this.origElementType = e.origElementType;
            this.substGroup = e.substGroup;
            this.attributeType = e.attributeType;
            this.isNull = e.isNull;
            this.tuple = e.tuple;
            this.nillable = e.nillable;
            this.perType = e.perType;
            this.balType = e.balType;
            this.abst = e.abst;
            this.typedDimensionId = e.typedDimensionId;

            //this.tupleChildren = e.tupleChildren;

            // need to do a deep copy - the IM taxonomy on .NET 2.0 children are pointing to the wrong parent
            // this didn't seem to make a difference, but I think it's a good thing, so I'm going to leave it in
            if (UseClone)
            {
                if (e.tupleChildren != null)
                {
                    tupleChildren = new SortedList();
                    IDictionaryEnumerator enumer = e.tupleChildren.GetEnumerator();

                    while (enumer.MoveNext())
                    {
                        this.AddChild((double)enumer.Key, (Element)((Element)enumer.Value).Clone());
                    }
                }

                if (e.tupleParentList != null)
                {
                    tupleParentList = new List<Element>();
                    foreach( Element tp in e.tupleParentList )
                    {
                        if (tp.id == this.id)
                        {
                            tupleParentList.Add(this);
                        }
                        else
                        {
                            tupleParentList.Add(tp.Clone() as Element);
                        }
                    }
                }

            }
            else
            {
                this.tupleChildren = e.tupleChildren;
                this.tupleParentList = e.tupleParentList;
            }
            this.labelInfo = e.labelInfo;
            this.referenceInfo = e.referenceInfo;
            this.taxonomyInfoId = e.taxonomyInfoId;
            this.markupValues = e.markupValues;
            this.EnumData = e.EnumData;
            this.IsAucentExtendedElement = e.IsAucentExtendedElement;
            this.HasCompleteTupleFamily = e.HasCompleteTupleFamily;

            this.isChoice = e.isChoice;
            this.UseChoiceIcon = e.UseChoiceIcon;
            this.ChoiceContainer = e.ChoiceContainer;
            this.childrenInfo = e.childrenInfo;
        }