Esempio n. 1
0
        internal static ExperimentStep FromXElement(XElement experimentStepElement)
        {
            ExperimentStep experimentStep = new ExperimentStep();

            //// Import attributes for the implemented interfaces
            experimentStep.ImportISignableItemWithName(experimentStepElement);
            experimentStep.ImportISourceDataLocation(experimentStepElement);

            //// Import all other attributes
            experimentStep.ExperimentStepId = experimentStepElement.Attribute("experimentStepID").Value;
            experimentStep.TemplateUsed     = experimentStepElement.Attribute("templateUsed")?.Value;
            experimentStep.Comment          = experimentStepElement.Attribute("comment")?.Value;

            //// Import the child elements of the current object
            XElement tagSetElement = experimentStepElement.Elements(NamespaceHelper.GetXName("TagSet")).SingleOrDefault();

            if (tagSetElement != null)
            {
                experimentStep.TagSet = TagSet.FromXElement(tagSetElement);
            }

            XElement techniqueElement = experimentStepElement.Elements(NamespaceHelper.GetXName("Technique")).SingleOrDefault();

            if (techniqueElement != null)
            {
                experimentStep.Technique = Technique.FromXElement(techniqueElement);
            }

            XElement infrastructureElement = experimentStepElement.Elements(NamespaceHelper.GetXName("Infrastructure")).SingleOrDefault();

            if (infrastructureElement != null)
            {
                experimentStep.Infrastructure = Infrastructure.FromXElement(infrastructureElement);
            }

            XElement methodElement = experimentStepElement.Elements(NamespaceHelper.GetXName("Method")).SingleOrDefault();

            if (methodElement != null)
            {
                experimentStep.Method = Method.FromXElement(methodElement);
            }

            experimentStep.Results.AddRange(experimentStepElement.Elements(NamespaceHelper.GetXName("Result")).Select(Result.FromXElement));

            return(experimentStep);
        }
Esempio n. 2
0
        internal static Template FromXElement(XElement templateElement)
        {
            Template template = new Template();

            //// Import attributes for the implemented interfaces
            template.ImportISignableItemWithName(templateElement);
            template.ImportISourceDataLocation(templateElement);

            //// Import all other attributes
            template.TemplateId = templateElement.Attribute("templateId").Value;

            //// Import the child elements of the current object
            XElement tagSetElement = templateElement.Element(NamespaceHelper.GetXName("TagSet"));

            if (tagSetElement != null)
            {
                template.TagSet = TagSet.FromXElement(tagSetElement);
            }

            XElement techniqueElement = templateElement.Element(NamespaceHelper.GetXName("Technique"));

            if (techniqueElement != null)
            {
                template.Technique = Technique.FromXElement(techniqueElement);
            }

            XElement infrastructureElement = templateElement.Element(NamespaceHelper.GetXName("Infrastructure"));

            if (infrastructureElement != null)
            {
                template.Infrastructure = Infrastructure.FromXElement(infrastructureElement);
            }

            XElement methodElement = templateElement.Element(NamespaceHelper.GetXName("Method"));

            if (methodElement != null)
            {
                template.Method = Method.FromXElement(methodElement);
            }

            template.Results.AddRange(templateElement.Elements(NamespaceHelper.GetXName("Result")).Select(Result.FromXElement));

            return(template);
        }
Esempio n. 3
0
        internal static Infrastructure FromXElement(XElement infrastructureElement)
        {
            Infrastructure infrastructure = new Infrastructure();

            //// Import attributes for the implemented interfaces
            infrastructure.ImportISignableItem(infrastructureElement);

            //// Import the child elements of the current object
            XElement sampleReferenceSetElement = infrastructureElement.Element(NamespaceHelper.GetXName("SampleReferenceSet"));

            if (sampleReferenceSetElement != null)
            {
                infrastructure.SampleReferencetSet = SampleReferenceSet.FromXElement(sampleReferenceSetElement);
            }

            XElement parentDataPointReferenceSetElement = infrastructureElement.Element(NamespaceHelper.GetXName("ParentDataPointReferenceSet"));

            if (parentDataPointReferenceSetElement != null)
            {
                infrastructure.ParentDataPointReferenceSet = ParentDataPointReferenceSet.FromXElement(parentDataPointReferenceSetElement);
            }

            XElement experimentDataReferenceSetElement = infrastructureElement.Element(NamespaceHelper.GetXName("ExperimentDataReferenceSet"));

            if (experimentDataReferenceSetElement != null)
            {
                infrastructure.ExperimentDataReferenceSet = ExperimentDataReferenceSet.FromXElement(experimentDataReferenceSetElement);
            }

            XElement timestampElement = infrastructureElement.Element(NamespaceHelper.GetXName("Timestamp"));

            if (timestampElement != null)
            {
                infrastructure.Timestamp = XmlConvert.ToDateTime(timestampElement.Value, XmlDateTimeSerializationMode.Utc);
            }

            return(infrastructure);
        }