/// <summary> /// /// </summary> /// <param name="originalAuthor">Original author of this resource, with all relevant details, including organisation.</param> /// <param name="lifecycleState">Lifecycle state of the resource, typically including states such as: initial, submitted, experimental, /// awaiting_approval, approved, superseded, obsolete.</param> /// <param name="details">Details of all parts of resource description that are natural language-dependent, keyed by language code.</param> /// <param name="resourcePackageUri">URI of package to which this resource belongs.</param> /// <param name="otherContributors">Other contributors to the resource, probably listed in “name <email>” form.</param> /// <param name="otherDetails">Additional non language-senstive resource meta-data, as a list of name/value pairs.</param> /// <param name="parentResource">Reference to owning resource.</param> public ResourceDescription(AssumedTypes.Hash <string, string> originalAuthor, string lifecycleState, AssumedTypes.Hash <ResourceDescriptionItem, string> details, string resourcePackageUri, AssumedTypes.List <string> otherContributors, AssumedTypes.Hash <string, string> otherDetails, AuthoredResource parentResource) : this(originalAuthor, lifecycleState, details) { this.resourcePackageUri = resourcePackageUri; this.otherContributors = otherContributors; this.otherDetails = otherDetails; this.parentResource = parentResource; }
/// <summary> /// /// </summary> /// <param name="originalAuthor">Original author of this resource, with all relevant details, including organisation.</param> /// <param name="lifecycleState">Lifecycle state of the resource, typically including states such as: initial, submitted, experimental, /// awaiting_approval, approved, superseded, obsolete.</param> /// <param name="details">Details of all parts of resource description that are natural language-dependent, keyed by language code.</param> /// <param name="resourcePackageUri">URI of package to which this resource belongs.</param> /// <param name="otherContributors">Other contributors to the resource, probably listed in “name <email>” form.</param> /// <param name="otherDetails">Additional non language-senstive resource meta-data, as a list of name/value pairs.</param> /// <param name="parentResource">Reference to owning resource.</param> public ResourceDescription(AssumedTypes.Hash<string, string> originalAuthor, string lifecycleState, AssumedTypes.Hash<ResourceDescriptionItem, string> details, string resourcePackageUri, AssumedTypes.List<string> otherContributors, AssumedTypes.Hash<string, string> otherDetails, AuthoredResource parentResource) : this(originalAuthor, lifecycleState, details) { this.resourcePackageUri = resourcePackageUri; this.otherContributors = otherContributors; this.otherDetails = otherDetails; this.parentResource = parentResource; }
internal void ReadXml(System.Xml.XmlReader reader) { reader.ReadStartElement(); reader.MoveToContent(); Check.Assert(reader.LocalName == "original_author", "Expected local name is 'original_author', not " + reader.LocalName); this.originalAuthor = GetHashData(reader, "original_author"); reader.MoveToContent(); string otherContributors = "other_contributors"; if (reader.LocalName == otherContributors) { this.otherContributors = new OpenEhr.AssumedTypes.List<string>(); do { this.otherContributors.Add(reader.ReadElementString(otherContributors, RmXmlSerializer.OpenEhrNamespace)); reader.MoveToContent(); } while (reader.LocalName == otherContributors); } string lifeCycle = "lifecycle_state"; Check.Assert(reader.LocalName == lifeCycle, "Expected reader.LocalName is " + lifeCycle + ", not " + reader.LocalName); this.lifecycleState = reader.ReadElementString(lifeCycle, RmXmlSerializer.OpenEhrNamespace); reader.MoveToContent(); string resourcePackageUriNodeName = "resource_package_uri"; if (reader.LocalName == resourcePackageUriNodeName) { this.resourcePackageUri = reader.ReadElementString(resourcePackageUriNodeName, RmXmlSerializer.OpenEhrNamespace); reader.MoveToContent(); } string otherDetailsNodeName = "other_details"; if (reader.LocalName == otherDetailsNodeName) { this.otherDetails = GetHashData(reader, otherDetailsNodeName); } string detailsNodeName = "details"; if (reader.LocalName == detailsNodeName) { System.Collections.Generic.Dictionary<string, ResourceDescriptionItem> detailsDic = new System.Collections.Generic.Dictionary<string, ResourceDescriptionItem>(); do { ResourceDescriptionItem item = new ResourceDescriptionItem(); item.ReadXml(reader); detailsDic.Add(item.Language.CodeString, item); } while (reader.LocalName == detailsNodeName); if (detailsDic.Count > 0) this.details = new OpenEhr.AssumedTypes.Hash<ResourceDescriptionItem, string>(detailsDic); } string parentResourceNodeName = "parent_resource"; if (reader.LocalName == parentResourceNodeName) { string resourceType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace); this.parentResource = RmFactory.Instance.AuthoredResource(resourceType); DesignByContract.Check.Assert(parentResource != null, "must have an object with the type of "+resourceType); this.parentResource.ReadXml(reader); } if (!reader.IsStartElement()) { reader.ReadEndElement(); reader.MoveToContent(); } }
internal void ReadXml(System.Xml.XmlReader reader) { reader.ReadStartElement(); reader.MoveToContent(); Check.Assert(reader.LocalName == "original_author", "Expected local name is 'original_author', not " + reader.LocalName); this.originalAuthor = GetHashData(reader, "original_author"); reader.MoveToContent(); string otherContributors = "other_contributors"; if (reader.LocalName == otherContributors) { this.otherContributors = new OpenEhr.AssumedTypes.List <string>(); do { this.otherContributors.Add(reader.ReadElementString(otherContributors, RmXmlSerializer.OpenEhrNamespace)); reader.MoveToContent(); } while (reader.LocalName == otherContributors); } string lifeCycle = "lifecycle_state"; Check.Assert(reader.LocalName == lifeCycle, "Expected reader.LocalName is " + lifeCycle + ", not " + reader.LocalName); this.lifecycleState = reader.ReadElementString(lifeCycle, RmXmlSerializer.OpenEhrNamespace); reader.MoveToContent(); string resourcePackageUriNodeName = "resource_package_uri"; if (reader.LocalName == resourcePackageUriNodeName) { this.resourcePackageUri = reader.ReadElementString(resourcePackageUriNodeName, RmXmlSerializer.OpenEhrNamespace); reader.MoveToContent(); } string otherDetailsNodeName = "other_details"; if (reader.LocalName == otherDetailsNodeName) { this.otherDetails = GetHashData(reader, otherDetailsNodeName); } string detailsNodeName = "details"; if (reader.LocalName == detailsNodeName) { System.Collections.Generic.Dictionary <string, ResourceDescriptionItem> detailsDic = new System.Collections.Generic.Dictionary <string, ResourceDescriptionItem>(); do { ResourceDescriptionItem item = new ResourceDescriptionItem(); item.ReadXml(reader); detailsDic.Add(item.Language.CodeString, item); } while (reader.LocalName == detailsNodeName); if (detailsDic.Count > 0) { this.details = new OpenEhr.AssumedTypes.Hash <ResourceDescriptionItem, string>(detailsDic); } } string parentResourceNodeName = "parent_resource"; if (reader.LocalName == parentResourceNodeName) { string resourceType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace); this.parentResource = RmFactory.Instance.AuthoredResource(resourceType); DesignByContract.Check.Assert(parentResource != null, "must have an object with the type of " + resourceType); this.parentResource.ReadXml(reader); } if (!reader.IsStartElement()) { reader.ReadEndElement(); reader.MoveToContent(); } }