Beispiel #1
0
        // Token: 0x06001EF0 RID: 7920 RVA: 0x000942F0 File Offset: 0x000924F0
        internal override void Copy(BamlRecord record)
        {
            base.Copy(record);
            BamlXmlnsPropertyRecord bamlXmlnsPropertyRecord = (BamlXmlnsPropertyRecord)record;

            bamlXmlnsPropertyRecord._prefix       = this._prefix;
            bamlXmlnsPropertyRecord._xmlNamespace = this._xmlNamespace;
            bamlXmlnsPropertyRecord._assemblyIds  = this._assemblyIds;
        }
Beispiel #2
0
        // Read an XML namespace definition record.  This contains a mapping from 
        // an xml namespace to a prefix used within the scope of the current element.
        protected virtual void ReadXmlnsPropertyRecord(BamlXmlnsPropertyRecord xmlnsRecord) 
        {
            Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType ||
                ReaderFlags.ClrObject == CurrentContext.ContextType ||
                ReaderFlags.PropertyComplexClr == CurrentContext.ContextType || 
                ReaderFlags.PropertyComplexDP == CurrentContext.ContextType);
 
            // Accept name space directives for DependencyObjects and clr objects only 
            if (ReaderFlags.DependencyObject == CurrentContext.ContextType ||
                ReaderFlags.ClrObject == CurrentContext.ContextType || 
                ReaderFlags.PropertyComplexClr == CurrentContext.ContextType ||
                ReaderFlags.PropertyComplexDP == CurrentContext.ContextType)
            {
                XmlnsDictionary[xmlnsRecord.Prefix] = xmlnsRecord.XmlNamespace; 

                XamlTypeMapper.SetUriToAssemblyNameMapping(xmlnsRecord.XmlNamespace, xmlnsRecord.AssemblyIds); 
 
                // Making this call will populate XamlTypeMapper.NamespaceMapHashList
                //  with appropriate values for this namespace URI. 
                // We do this here because we need to save this data now to make it
                //  available later for XamlTypeMapper.GetTypeFromName() which gets it
                //  as value of XmlAttributeProperties.XmlNamespaceMapsProperty.
 
         // XamlTypeMapper.GetNamespaceMapEntries(xmlnsRecord);
 
                if (ReaderFlags.DependencyObject == CurrentContext.ContextType) 
                {
                    SetXmlnsOnCurrentObject(xmlnsRecord); 
                }
            }
        }
Beispiel #3
0
        // Add an XML namespace dictionary entry to the current object in the
        // context stack.
        // NOTE:  Setting Xmlns information on a delay created type is not currently 
        //        supported.  The type must have already been instantiated in order to
        //        set the dictionary property on it.  See Windows bug 1068961. 
        protected void SetXmlnsOnCurrentObject(BamlXmlnsPropertyRecord xmlnsRecord) 
        {
            DependencyObject e = CurrentContext.ObjectData as DependencyObject; 

            // For cases where we have object factories, we may not have a valid DependencyObject at
            // this point, so don't try to set the xmlns dictionary.
            if (e != null) 
            {
                XmlnsDictionary elemDict = XmlAttributeProperties.GetXmlnsDictionary(e); 
 
                if (null != elemDict)
                { 
                    elemDict.Unseal();
                    elemDict[xmlnsRecord.Prefix] = xmlnsRecord.XmlNamespace;
                    elemDict.Seal();
                } 
                else
                { 
                    elemDict = new XmlnsDictionary(); 
                    elemDict[xmlnsRecord.Prefix] = xmlnsRecord.XmlNamespace;
                    elemDict.Seal(); 
                    XmlAttributeProperties.SetXmlnsDictionary(e, elemDict);
                }
            }
        }