Example #1
0
 public LineTestResultsDto(XElement lineTestResultsElement)
 {
     CompleteDate = lineTestResultsElement.GetElementValue("completeDate");
     CompleteTime = lineTestResultsElement.GetElementValue("completeTime");
     LineCircuit = new LineCircuitDto(lineTestResultsElement.GetElement("LineCircuit"));
     Summary = new SummaryDto(lineTestResultsElement.GetElement("Summary"));
 }
        public ResourceDiagnosticDetailsDto(XElement resourceDiagnosticDetailsElement)
        {
            var headerElement = resourceDiagnosticDetailsElement.GetElement("Header");
            var payloadElement = resourceDiagnosticDetailsElement.GetElement("Payload");

            CorrelationId = headerElement.GetElementValue("CorrelationId_T");
            ExecutionStatusMessage = new ExecutionStatusMessageDto(headerElement.GetElement("ExecutionStatusMessage"));
            PhysicalResources = new PhysicalResourcesDto(payloadElement);
            LineTestResults = new LineTestResultsDto(payloadElement.GetElement("LineTestResults"));
        }
 private ComponentProject LoadComponent(XElement XComponent)
 {
     return new ComponentProject(XComponent.Elements("Target")
                                           .Select(xTarget =>
                                                   new ComponentProjectTarget(xTarget.GetAttribute<int>("Cell"),
                                                                              xTarget.GetAttribute<int>("Modification"),
                                                                              xTarget.GetAttribute<int>("Module"),
                                                                              xTarget.GetAttribute<int>("Channel")))
                                           .ToList(),
                                 LoadBootloaderRequirement(XComponent.GetElement("BootloaderRequirement")),
                                 XComponent.GetElement("Files").Elements().Select(LoadFileMap).ToList());
 }
Example #4
0
    public void Parse(XElement e)
    {
      XElement no = e.GetElement("north");
      if (no != null) North = Convert.ToDouble(no.Value, CultureInfo.InvariantCulture);

      XElement so = e.GetElement("south");
      if (so != null) South = Convert.ToDouble(so.Value, CultureInfo.InvariantCulture);

      XElement ea = e.GetElement("east");
      if (ea != null) East = Convert.ToDouble(ea.Value, CultureInfo.InvariantCulture);

      XElement we = e.GetElement("west");
      if (we != null) West = Convert.ToDouble(we.Value, CultureInfo.InvariantCulture);
    }
Example #5
0
		public static Fault ParseXml(XElement fault_el)
		{
			XElement element = fault_el.GetElement("value");
			Struct @struct = (Struct)Value.ParseXml(element);
			int faultCode = -1;
			Value value = @struct.Get("faultCode");
			if (value != null)
			{
				if (value is StringValue)
				{
					StringValue stringValue = (StringValue)value;
					faultCode = int.Parse(stringValue.String);
				}
				else
				{
					if (!(value is IntegerValue))
					{
						string message = string.Format("Fault Code value is not int or string {0}", element.ToString());
						throw new MetaWeblogException(message);
					}
					IntegerValue integerValue = (IntegerValue)value;
					faultCode = integerValue.Integer;
				}
			}
			string @string = @struct.Get<StringValue>("faultString").String;
			return new Fault
			{
				FaultCode = faultCode,
				FaultString = @string,
				RawData = fault_el.Document.ToString()
			};
		}
Example #6
0
 public DigResults2Dto(XElement digResults2Element)
 {
     NFullCount = digResults2Element.GetElementValue("nfullCount");
     LoopbackCount = digResults2Element.GetElementValue("loopbackCount");
     PerResCount = digResults2Element.GetElementValue("perresCount");
     RfcADslDigRes = new RfcADslDigResDto(digResults2Element.GetElement("rfc_a_dsldig_res"));
 }
Example #7
0
 public KmlPoint(XElement e)
 {
   if (e != null)
   {
     XElement el = e.GetElement("coordinates");
     Coordinates = el.Value;
   }
 }
Example #8
0
 public static void ReadProperties(IHasProperties owner, XElement root)
 {
     var element = root.GetElement("properties");
     if (element != null)
     {
         foreach (var property in element.GetElements("property"))
         {
             var key = property.ReadAttribute("name", string.Empty);
             var value = property.ReadAttribute("value", string.Empty);
             owner.Properties.Add(key, value);
         }
     }
 }
Example #9
0
 private static TiledImage ReadImage(XElement root)
 {
     var imageElement = root.GetElement("image");
     if (imageElement != null)
     {
         var image = new TiledImage();
         image.Source = imageElement.ReadAttribute("source", String.Empty);
         image.Width = imageElement.ReadAttribute("width", 0);
         image.Height = imageElement.ReadAttribute("height", 0);
         return image;
     }
     return null;
 }
Example #10
0
        internal static Array XmlToValue(SXL.XElement typeEl)
        {
            var data_el = typeEl.GetElement("data");

            var value_els = data_el.Elements("value").ToList();
            var list      = new XmlRpc.Array();

            foreach (var value_el2 in value_els)
            {
                var o = Value.ParseXml(value_el2);
                list.Add(o);
            }
            return(list);
        }
Example #11
0
 public RfcADslDigResDto(XElement rfcDslDigResElement)
 {
     ServiceType = rfcDslDigResElement.GetElementValue("serviceType");
     AtucStatus = rfcDslDigResElement.GetElementValue("atuc");
     AturStatus = rfcDslDigResElement.GetElementValue("atur");
     LineCoding = rfcDslDigResElement.GetElementValue("lineCoding");
     LineLatency = rfcDslDigResElement.GetElementValue("lineLatency");
     PortAdminStatus = rfcDslDigResElement.GetElementValue("portAdminStatus");
     AtmStatus = rfcDslDigResElement.GetElementValue("atmStatus");
     LastStatusChange = rfcDslDigResElement.GetElementValue("lastStatusChange");
     ConfiguredBandwidthPlan = rfcDslDigResElement.GetElementValue("confBandPlan");
     CurrentBandwidthPlan = rfcDslDigResElement.GetElementValue("currBandPlan");
     ServiceMode = rfcDslDigResElement.GetElementValue("serviceMode");
     FramingMode = rfcDslDigResElement.GetElementValue("framingMode");
     EstimatedLength = rfcDslDigResElement.GetElementValue("estimatedLength");
     Downstream = new StreamParametersDto(rfcDslDigResElement.GetElement("downstream"));
     Upstream = new StreamParametersDto(rfcDslDigResElement.GetElement("upstream"));
     AtucEventHistory15 = new AtuEventHistoryDto(rfcDslDigResElement.GetElement("atuc_15"));
     AtucEventHistoryDay = new AtuEventHistoryDto(rfcDslDigResElement.GetElement("atuc_day"));
     AturEventHistory15 = new AtuEventHistoryDto(rfcDslDigResElement.GetElement("atur_15"));
     AturEventHistoryDay = new AtuEventHistoryDto(rfcDslDigResElement.GetElement("atur_day"));
     MultiModeNearEnd = new MultiModeDto(rfcDslDigResElement.GetElement("mmode_ne"));
     MultiModeFarEnd = new MultiModeDto(rfcDslDigResElement.GetElement("mmode_fe"));
 }
Example #12
0
 public SummaryDto(XElement summaryElement)
 {
     Code = summaryElement.GetElementValue("code");
     Description = new DescriptionDto(summaryElement.GetElement("description"));
 }
Example #13
0
 public DescriptionDto(XElement descriptionElement)
 {
     DigResults2 = new DigResults2Dto(descriptionElement.GetElement("dig_results_2"));
 }
Example #14
0
        public override void FromXml(XElement element, string directoryName)
        {
            Id = element.GetGuid("id");
            Name = element.GetString("name", string.Empty);
            Layer = element.GetString("layer", string.Empty);
            ConnectionStringFull = element.GetString("connection", string.Empty);
            ConnectionStringReference = element.GetString("connectionReference", string.Empty);
            Query = (string)element.GetElement("Query");
            PoiTypeId = element.GetString("poiTypeId", string.Empty);
            IsEnabled = element.GetBool("isEnabled");
            UpdateType = (UpdateTypes)Enum.Parse(typeof(UpdateTypes), element.GetString("updateType", string.Empty));

            var options = element.GetElement("Options");
            if (options != null)
            {
                var relationShip = options.GetString("relationship", string.Empty);
                Options = new SqlQueryOptions
                {
                    ControlInputParameterIndex = options.GetInt("controlInputParameterIndex"),
                    DesiredResultFormula = options.GetString("desiredResultFormula"),
                    DesiredResultLabel = options.GetString("desiredResultLabel"),
                    DesiredAccuracyInputParameterIndex = options.GetInt("desiredAccuracyInputParameterIndex"),
                    MaxTriesInputParameterIndex = options.GetInt("maxTriesInputParameterIndex", 5),
                    ActualResultOutputParameterIndex = options.GetInt("actualResultOutputParameterIndex"),
                    Relationship = string.IsNullOrEmpty(relationShip) ? SqlInputOutputRelationship.Linear : (SqlInputOutputRelationship)Enum.Parse(typeof(SqlInputOutputRelationship), relationShip)
                };
            }
            var inputs = element.Element("Inputs");
            if (inputs != null)
                foreach (var input in inputs.Elements())
                {
                    InputParameters.Add(new SqlInputParameter
                    {
                        LabelName = input.GetString("labelName", string.Empty),
                        Type = (SqlParameterTypes)Enum.Parse(typeof(SqlParameterTypes), input.GetString("type", string.Empty))
                    });
                }
            var outputs = element.Element("Outputs");
            if (outputs == null) return;
            foreach (var output in outputs.Elements())
            {
                OutputParameters.Add(new SqlOutputParameter
                {
                    Name = output.GetString("name", string.Empty),
                    OutputType = (SqlOutputType)Enum.Parse(typeof(SqlOutputType), output.GetString("type", string.Empty))
                });
            }
        }
Example #15
0
 private static Tuple<int, int> ReadTileOffset(XElement root)
 {
     var element = root.GetElement("tileoffset");
     if (element != null)
     {
         var x = element.ReadAttribute("x", 0);
         var y = element.ReadAttribute("y", 0);
         return new Tuple<int, int>(x, y);
     }
     return new Tuple<int, int>(0, 0);
 }
Example #16
0
        private Tuple<int, int, int> GetPubMedDate(XElement pubMedPubDate, string pmid)
        {
            var year = Convert.ToInt32(pubMedPubDate.GetElement("Year", pmid).Value);
            var month = Convert.ToInt32(pubMedPubDate.GetElement("Month", pmid).Value);
            var day = Convert.ToInt32(pubMedPubDate.GetElement("Day", pmid).Value);

            return new Tuple<int, int, int>(year, month, day);
        }
Example #17
0
 public void Resolve(XElement el)
 {
     Position = el.GetElement("Position").AttributeAsVector2("x", "y");
     ScaleFactor = el.GetElement("ScaleFactor").AttributeAsFloat("value");
     Rotation = el.GetElement("Rotation").AttributeAsFloat("value");
 }
Example #18
0
        private PubMedArticle GetPublication(XElement pubmedArticle, string pmid)
        {
            var publication = new PubMedArticle();

            var medlineCitation = pubmedArticle.GetElement("MedlineCitation", pmid);
            publication.PubMedId = medlineCitation.GetElement("PMID", pmid).Value;
            if (pmid.IsNullOrEmpty()) pmid = publication.PubMedId;

            var article = medlineCitation.GetElement("Article", pmid);
            var journal = article.GetElement("Journal", pmid);
            var issnElement = journal.GetElement("ISSN", pmid);
            var history = pubmedArticle.GetElement("PubmedData/History", pmid);

            publication.Issn = issnElement.Value;
            publication.IssnType = issnElement.GetAttribute("IssnType", pmid).Value;
            publication.Volume = journal.GetOptionalElementValue("JournalIssue/Volume");
            publication.Issue = journal.GetOptionalElementValue("JournalIssue/Issue");
            publication.PublicationMonth = journal.GetOptionalElementValue("JournalIssue/PubDate/Month");
            publication.PublicationYear = journal.GetOptionalElementValue("JournalIssue/PubDate/Year");
            publication.JournalTitle = journal.GetOptionalElementValue("Title");
            publication.IsoAbbreviation = journal.GetOptionalElementValue("ISOAbbreviation");
            publication.ArticleTitle = article.GetOptionalElementValue("ArticleTitle");
            publication.MedlinePgn = article.GetOptionalElementValue("Pagination/MedlinePgn");
            publication.Abstract = article.GetOptionalElementValue("Abstract/AbstractText");
            publication.Authors = GetAuthors(article.GetElement("AuthorList", pmid));
            publication.PublicationTypes = GetPublicationTypes(article.GetElement("PublicationTypeList", pmid));

            var pubMedPublishInfo = GetPubMedDate(history.GetElement("PubMedPubDate[@PubStatus='pubmed']", pmid), pmid);
            publication.PubMedPublishYear = pubMedPublishInfo.Item1;
            publication.PubMedPublishMonth = pubMedPublishInfo.Item2;
            publication.PubMedPublishDay = pubMedPublishInfo.Item3;

            var entrezPublishInfo = GetPubMedDate(history.GetElement("PubMedPubDate[@PubStatus='entrez']", pmid), pmid);
            publication.EntrezPublishYear = entrezPublishInfo.Item1;
            publication.EntrezPublishMonth = entrezPublishInfo.Item2;
            publication.EntrezPublishDay = entrezPublishInfo.Item3;

            var medlinePublishInfo = GetPubMedDate(history.GetElement("PubMedPubDate[@PubStatus='medline']", pmid), pmid);
            publication.MedlinePublishYear = medlinePublishInfo.Item1;
            publication.MedlinePublishMonth = medlinePublishInfo.Item2;
            publication.MedlinePublishDay = medlinePublishInfo.Item3;

            var accessionNumberList = article.GetOptionalElement("DataBankList/DataBank/AccessionNumberList");
            if (accessionNumberList != null)
                publication.NctNumbers = GetAccessionNumbers(accessionNumberList);

            return publication;
        }