示例#1
0
        private bool TryGetXmlMetadata(Type clrType, out XmlMetadata metadata)
        {
            var kind = XmlTypeSerializer.For(clrType).Kind;

            return(kind == XmlTypeKind.Complex && clrType.GetTypeInfo().IsInterface
                                ? Try.Success(out metadata, GetXmlMetadata(clrType))
                                : Try.Failure(out metadata));
        }
示例#2
0
        public XmlContext(XmlMetadata metadata)
        {
            if (metadata == null)
            {
                throw Error.ArgumentNull("metadata");
            }

            this.metadata = metadata;
        }
示例#3
0
        private void InitializePrimary(DictionaryAdapterMeta meta, IDictionaryAdapter dictionaryAdapter)
        {
            RequireXmlMeta(meta);
            primaryXmlMeta = meta.GetXmlMeta();

            if (node == null)
            {
                node = GetBaseNode();
            }
            if (!node.IsReal)
            {
                node.Realized += HandleNodeRealized;
            }

            if (references == null)
            {
                references = new XmlReferenceManager(node, DefaultXmlReferenceFormat.Instance);
            }
            InitializeReference(this);
        }
示例#4
0
 public static void SetXmlMeta(this DictionaryAdapterMeta meta, XmlMetadata xmlMeta)
 {
     meta.ExtendedProperties[XmlMetaKey] = xmlMeta;
 }
示例#5
0
 protected XmlContext(XmlContext parent) : base(parent)
 {
     this.metadata = parent.metadata;
 }