/// <summary> /// Merges the contents of a parameter-supplied <see cref="ReferenceLocator"/> into /// the reference datas collection of this <see cref="ReferenceLocator"/>. /// </summary> /// <param name="dupRL">The <see cref="ReferenceLocator"/> whose reference datas /// collection is to be merged into the reference datas collection of this /// <see cref="ReferenceLocator"/>.</param> public void Merge(ReferenceLocator dupRL) { IDictionaryEnumerator enumer = dupRL.referenceDatas.GetEnumerator(); while (enumer.MoveNext()) { if (referenceDatas.ContainsKey(enumer.Key)) { ArrayList values = (ArrayList)this.referenceDatas[enumer.Key]; ArrayList newValues = (ArrayList)enumer.Value; // only add if they don't exist // this is a simple (and slow) search, but I don't think there will be many references foreach (string val in newValues) { if (!values.Contains(val)) { values.Add(val); } } } else { referenceDatas[enumer.Key] = enumer.Value; } } }
internal override void UpdateResources(LocatorBase locator, string to) { ReferenceLocator data = resources[to] as ReferenceLocator; ((ReferenceLocator)locator).AddInformation(data); //resources.Remove( to ); }
internal void AddInformation(ReferenceLocator tempLocator) { //Parse out eact reference sub type and add to the hash table int nextRefCount = References.Count + 1; foreach (string refKey in tempLocator.referenceDatas.Keys) { int endPos = refKey.IndexOf(' '); string refPart = endPos > 0 ? refKey.Substring(0, endPos) : refKey; referenceDatas[refPart + " " + nextRefCount.ToString()] = tempLocator.referenceDatas[refKey]; } }
/// <summary> /// Parse the <see cref="XmlDocument"/> underlying this <see cref="Presentation"/> object, /// populating role and link information. /// </summary> /// <param name="numErrors">An output parameter. The number of errors encountered during /// the parse process.</param> protected override void ParseInternal(out int numErrors) { numErrors = 0; XmlNodeList locNodes = theDocument.SelectNodes(LOCATOR_KEY, theManager); if (locNodes == null || locNodes.Count == 0) { Common.WriteWarning("XBRLParser.Error.ReferenceDoesNotContainReferences", errorList, schemaFilename); return; } XmlNodeList refs = theDocument.SelectNodes(REFERENCE_LINK_KEY, theManager); foreach (XmlNode node in refs) { ReferenceLink refLink = new ReferenceLink(errorList); refLink.ParseLinks(node, theManager, out numErrors); if (refLink.References != null && refLink.References.Count > 0) { if (references == null) { references = new Hashtable(); } foreach (ReferenceLocator rl in refLink.References.Values) { if (references.ContainsKey(rl.HRef)) { ReferenceLocator orig = references[rl.HRef] as ReferenceLocator; orig.Merge(rl); } else { references[rl.HRef] = rl; } } } } }
internal void AddInformation( ReferenceLocator tempLocator ) { //Parse out eact reference sub type and add to the hash table int nextRefCount = References.Count + 1; foreach (string refKey in tempLocator.referenceDatas.Keys ) { int endPos = refKey.IndexOf(' '); string refPart = endPos > 0 ? refKey.Substring(0, endPos) : refKey; referenceDatas[refPart + " " + nextRefCount.ToString()] = tempLocator.referenceDatas[refKey]; } }
/// <summary> /// Merges the contents of a parameter-supplied <see cref="ReferenceLocator"/> into /// the reference datas collection of this <see cref="ReferenceLocator"/>. /// </summary> /// <param name="dupRL">The <see cref="ReferenceLocator"/> whose reference datas /// collection is to be merged into the reference datas collection of this /// <see cref="ReferenceLocator"/>.</param> public void Merge( ReferenceLocator dupRL ) { IDictionaryEnumerator enumer = dupRL.referenceDatas.GetEnumerator(); while ( enumer.MoveNext() ) { if ( referenceDatas.ContainsKey( enumer.Key ) ) { ArrayList values = (ArrayList)this.referenceDatas[enumer.Key]; ArrayList newValues = (ArrayList)enumer.Value; // only add if they don't exist // this is a simple (and slow) search, but I don't think there will be many references foreach ( string val in newValues ) { if ( !values.Contains( val ) ) { values.Add( val ); } } } else { referenceDatas[enumer.Key] = enumer.Value; } } }
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; }
/// <summary> /// Adding new references to the element /// </summary> /// <param name="references"></param> public void UpdateReferences(ReferenceExtenderDefinition[] references) { if (this.referenceInfo == null) { referenceInfo = new ReferenceLocator(); } referenceInfo.UpdateNodeReferences(references); }
/// <summary> /// Returns this <see cref="Element"/>'s reference information. /// </summary> /// <param name="references">An output parameter. The returned reference information.</param> /// <returns>True if a non-null <see cref="ReferenceLocator"/> is associated with this <see cref="Element"/> /// (and is returned).</returns> /// <remarks>Public for use by Dragon View.</remarks> public bool TryGetReferenceLocators(out ReferenceLocator references) { if (referenceInfo != null) { references = referenceInfo; return true; } else { references = null; return false; } }