Example #1
0
        public virtual bool LoadArc(XmlNode child)
        {
            string from = string.Empty;
            string to   = string.Empty;

            if (!Common.GetAttribute(child, FROM_TAG, ref from, errorList) ||
                !Common.GetAttribute(child, TO_TAG, ref to, errorList))
            {
                return(false);
            }

            LocatorBase ll = locators[from] as LocatorBase;

            if (ll != null)
            {
                ArrayList locs = arcs[to] as ArrayList;
                if (locs == null)
                {
                    locs     = new ArrayList();
                    arcs[to] = locs;
                }
                locs.Add(ll);
            }


            return(true);
        }
Example #2
0
        internal override void UpdateResources(LocatorBase locator, string to)
        {
            ReferenceLocator data = resources[to] as ReferenceLocator;

            ((ReferenceLocator)locator).AddInformation(data);

            //resources.Remove( to );
        }
Example #3
0
        internal override void UpdateResources(LocatorBase locator, string to)
        {
            TempLabelData tld = resources[to] as TempLabelData;

            ((LabelLocator)locator).AddLabel(tld.language, tld.role, tld.labelData);

            resources.Remove(to);
        }
Example #4
0
        /// <summary>
        /// Initializes this instance of <see cref="LocatorBase"/> from a parameter-supplied
        /// <see cref="LocatorBase"/>.
        /// </summary>
        /// <param name="orig">The <see cref="LocatorBase"/> from which this instance of <see cref="LocatorBase"/>
        ///  is to be initialized.</param>
        internal void CopyLocatorBaseInformation(LocatorBase orig)
        {
            this.xsd = orig.xsd;
            this.unpartitionedHref = orig.unpartitionedHref;
            this.href = orig.href;

            foreach (string str in orig.labelArray)
            {
                this.labelArray.Add(str);
            }
        }
Example #5
0
        private bool LoadLocator(XmlNode locNode,
                                 Dictionary <string, string> discoveredSchemas, string schemaPath)
        {
            string href  = null;
            string label = null;

            if (!Common.GetAttribute(locNode, HREF_TAG, ref href, errorList) ||
                !Common.GetAttribute(locNode, LABEL_TAG, ref label, errorList))
            {
                return(false);
            }

            if (string.IsNullOrEmpty(href))
            {
                return(false);
            }

            LocatorBase locator = CreateLocator(href);

            locator.ParseHRef(errorList);
            LinkBase.AddDiscoveredSchema(schemaPath, locator.Xsd, discoveredSchemas);


            locator.AddLabel(label);


            if (locators.ContainsKey(locator.HRef))
            {
                PresentationLocator oll = (PresentationLocator)locators[locator.HRef];


                // add a new one, pointing to the same locator
                if (!oll.LabelArray.Contains(label))
                {
                    oll.AddLabel(label);
                }
            }
            else
            {
                locators[locator.HRef] = locator;
            }

            HybridDictionary hrefList = this.LabelHrefMapping[label] as HybridDictionary;

            if (hrefList == null)
            {
                hrefList = new HybridDictionary();
                this.LabelHrefMapping[label] = hrefList;
            }

            hrefList[locator.HRef] = 1;

            return(true);
        }
Example #6
0
        public virtual bool LoadLocator(XmlNode locNode)
        {
            string href  = null;
            string label = null;

            if (!Common.GetAttribute(locNode, HREF_TAG, ref href, errorList) ||
                !Common.GetAttribute(locNode, LABEL_TAG, ref label, errorList))
            {
                return(false);
            }

            LocatorBase locator = CreateLocator(href);

            locator.ParseHRef(errorList);
            locator.AddLabel(label);

            LocatorBase oll = null;

            if (locators.ContainsKey(label))
            {
                oll = (LocatorBase)locators[label];

                // add a new one, pointing to the same locator
                if (!oll.LabelArray.Contains(label))
                {
                    // BUG 1610 - create a new presentation locator, since two arcs could have different
                    //		priorities.
                    PresentationLocator newPL = new PresentationLocator();
                    newPL.HRef = oll.HRef;
                    newPL.UnpartitionedHref = oll.UnpartitionedHref;
                    newPL.Xsd = oll.Xsd;

                    // Add the label to the new presentation locator.  This will differentiate the two locators.
                    newPL.AddLabel(label);

                    locators[label] = newPL;
                }
            }
            else
            {
                locators[label] = locator;
            }

            return(true);
        }
Example #7
0
        /// <summary>
        /// Initializes this instance of <see cref="LocatorBase"/> from a parameter-supplied
        /// <see cref="LocatorBase"/>.
        /// </summary>
        /// <param name="orig">The <see cref="LocatorBase"/> from which this instance of <see cref="LocatorBase"/>
        ///  is to be initialized.</param>
        internal void CopyLocatorBaseInformation(LocatorBase orig)
        {
            this.xsd = orig.xsd;
            this.unpartitionedHref = orig.unpartitionedHref;
            this.href = orig.href;

            foreach (string str in orig.labelArray)
            {
                this.labelArray.Add(str);
            }
        }
Example #8
0
 internal virtual void UpdateResources(LocatorBase locator, string to)
 {
 }
Example #9
0
 internal virtual void UpdateResources(LocatorBase locator, string to)
 {
 }
Example #10
0
        internal override void UpdateResources( LocatorBase locator, string to)
        {
            TempLabelData tld = resources[ to ] as TempLabelData;

            ((LabelLocator)locator).AddLabel( tld.language, tld.role, tld.labelData );

            resources.Remove( to );
        }
Example #11
0
        internal override void UpdateResources( LocatorBase locator, string to)
        {
            ReferenceLocator data = resources[ to ] as ReferenceLocator;

            ((ReferenceLocator)locator).AddInformation( data );

            //resources.Remove( to );
        }