Пример #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;
 }