コード例 #1
0
ファイル: Project.cs プロジェクト: mff-uk/exolutio
        public void Deserialize(XElement parentNode, SerializationContext context)
        {
            parentNode     = (XElement)context.Document.Element(context.ExolutioNS + "Project");
            UsesVersioning = SerializationContext.DecodeBool(parentNode.Attribute("UsesVersioning").Value);
            if (UsesVersioning)
            {
                VersionManager         = new VersionManager(this);
                VersionManager.Loading = true;
                this.DeserializeWrappedCollection("Versions", VersionManager.Versions, Version.CreateInstance, parentNode, context);
                this.DeserializeWrappedCollection("ProjectVersions", ProjectVersions, ProjectVersion.CreateInstance, parentNode, context);
                XElement versionLinksElement = parentNode.Element(context.ExolutioNS + "VersionLinks");
                if (versionLinksElement != null)
                {
                    VersionManager.DeserializeVersionLinks(versionLinksElement, context);
                }
                VersionManager.Loading = false;
            }
            else
            {
                ProjectVersion objSingleVersion = new ProjectVersion(this, Guid.Empty);
                objSingleVersion.DeserializeFromChildElement("SingleVersion", parentNode, context);
                SingleVersion = objSingleVersion;
            }

            //XAttribute nameAttribute = parentNode.Attribute("Name");
            //if (nameAttribute != null)
            //{
            //    this.Name = nameAttribute.Value;
            //}
        }
コード例 #2
0
ファイル: AttributeType.cs プロジェクト: mff-uk/exolutio
        public override void Deserialize(XElement parentNode, SerializationContext context)
        {
            base.Deserialize(parentNode, context);

            this.IsSealed = SerializationContext.DecodeBool(parentNode.Attribute("IsSealed").Value);
            this.Name     = SerializationContext.DecodeString(parentNode.Attribute("Name").Value);
            baseTypeGuid  = this.DeserializeIDRef("baseTypeID", parentNode, context, true);

            XAttribute baseTypeAttribute = parentNode.Attribute("baseType");

            if (baseTypeAttribute != null)
            {
                if (context.TypeDict != null && context.TypeDict.ContainsKey(baseTypeAttribute.Value))
                {
                    baseTypeGuid = context.TypeDict[baseTypeAttribute.Value];
                }
            }

            XAttribute xsdAtomicAttribute = parentNode.Attribute("xsdAtomic");

            if (xsdAtomicAttribute != null)
            {
                this.XSDAtomic = SerializationContext.DecodeBool(xsdAtomicAttribute.Value);
            }

            componentGuid          = this.DeserializeIDRef("componentId", parentNode, context, true);
            representedPIMTypeGuid = this.DeserializeIDRef("representedPIMTypeID", parentNode, context, true);

            XElement xsdDefinitionElement = parentNode.Element(context.ExolutioNS + "XSDDefinition");

            if (xsdDefinitionElement != null)
            {
                this.XSDDefinition = ((XCData)xsdDefinitionElement.Nodes().First()).Value;
            }

            XAttribute xsdAtomicAtribute = parentNode.Attribute("XSDAtomic");

            if (xsdAtomicAtribute != null)
            {
                this.XSDAtomic = true;
            }

            XAttribute xsdDefinitionAttribute = parentNode.Attribute("XSDDefinition");

            if (xsdDefinitionAttribute != null)
            {
                this.XSDDefinition = xsdDefinitionAttribute.Value;
            }

            this.DeserializeWrappedCollection("Operations", Operations, ModelOperation.CreateInstance, parentNode, context, true);

            SetProjectVersion(context.CurrentProjectVersion);
        }
コード例 #3
0
        public override void Deserialize(XElement parentNode, SerializationContext context)
        {
            base.Deserialize(parentNode, context);

            this.DeserializeCardinality(parentNode, context);

            attributeTypeGuid = this.DeserializeAttributeType(parentNode, context);

            if (parentNode.Attribute("DefaultValue") != null)
            {
                DefaultValue = SerializationContext.DecodeString(parentNode.Attribute("DefaultValue").Value);
            }

            Element = SerializationContext.DecodeBool(parentNode.Attribute("Element").Value);

            psmClassGuid = this.DeserializeIDRef("psmClassID", parentNode, context, false);

            this.PSMSchema.PSMAttributes.Add(this);
        }