Exemple #1
0
        public void Add(BaseXmlConfigFactory factory, string regName, BaseObjectElementAttribute attr, Type type)
        {
            ObjectElementAttribute objAttr = new ObjectElementAttribute(attr.NamespaceType)
            {
                LocalName      = regName,
                ObjectType     = type,
                UseConstructor = attr.UseConstructor
            };

            if (attr.NamespaceType == NamespaceType.Namespace)
            {
                objAttr.NamespaceUri = attr.NamespaceUri;
            }
            QName       qName = objAttr.GetQName(objAttr.LocalName);
            VersionData data  = ObjectUtil.TryGetValue(fLocalElements, qName.LocalName);

            if (data == null)
            {
                data = new VersionData();
                fLocalElements.Add(qName.LocalName, data);
                fXmlElements.Add(qName, data);
            }
            data.Add(attr, objAttr, factory.DefaultVersion);
            fTypeElements.Add(type, objAttr);
        }
Exemple #2
0
        public void Add(ObjectElementAttribute attr, PropertyInfo info)
        {
            TkDebug.AssertNotNullOrEmpty(attr.LocalName, string.Format(ObjectUtil.SysCulture,
                                                                       "属性{0}由于配置多个ObjectElement,因此需要指定LocalName", info.Name), attr);
            TkDebug.AssertNotNull(attr.ObjectType, string.Format(ObjectUtil.SysCulture,
                                                                 "属性{0}由于配置多个ObjectElement,因此需要指定LocalName", info.Name), attr);
            QName name = attr.GetQName(attr.LocalName);

            fXmlElements.Add(name, attr);
            fLocalElements.Add(name.LocalName, attr);
            fTypeElements.Add(attr.ObjectType, attr);
        }
Exemple #3
0
        public void Add(BaseXmlConfigFactory factory, string regName, BaseObjectElementAttribute attr, Type type)
        {
            ObjectElementAttribute objAttr = new ObjectElementAttribute(attr.NamespaceType)
            {
                LocalName      = regName,
                ObjectType     = type,
                UseConstructor = attr.UseConstructor
            };

            if (attr.NamespaceType == NamespaceType.Namespace)
            {
                objAttr.NamespaceUri = attr.NamespaceUri;
            }
            QName qName = objAttr.GetQName(objAttr.LocalName);

            fXmlElements.Add(qName, objAttr);
            fLocalElements.Add(qName.LocalName, objAttr);
            fTypeElements.Add(type, objAttr);
        }