Exemple #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));
        }
        public XmlContext(XmlMetadata metadata)
        {
            if (metadata == null)
            {
                throw Error.ArgumentNull("metadata");
            }

            this.metadata = metadata;
        }
Exemple #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);
        }
 protected XmlContext(XmlContext parent) : base(parent)
 {
     this.metadata = parent.metadata;
 }
Exemple #5
0
 public static void SetXmlMeta(this DictionaryAdapterMeta meta, XmlMetadata xmlMeta)
 {
     meta.ExtendedProperties[XmlMetaKey] = xmlMeta;
 }