public ExecutionStatusMessageDto(XElement executionStatusMessageElement) { ExecutionStatusSeverity = executionStatusMessageElement.GetElementValue("ExecutionStatusSeverity"); ExecutionStatusSourceOperation = executionStatusMessageElement.GetElementValue("ExecutionStatusSourceOperation"); ExecutionStatusDescription = executionStatusMessageElement.GetElementValue("ExecutionStatusDescription"); ExecutionStatusRecommendation = executionStatusMessageElement.GetElementValue("ExecutionStatusText"); }
public override void LoadFromXml(XElement xElement) { base.LoadFromXml(xElement); MininumVolume = xElement.GetElementValue<decimal>("MinimumVolume"); UnitOfMeasure = xElement.GetElementValue<string>("UnitOfMeasure"); }
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")); }
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 void LoadFromXml(XElement xmlElement) { Street = xmlElement.GetElementValue<string>("Street"); City = xmlElement.GetElementValue<string>("City"); State = xmlElement.GetElementValue<string>("State"); Zip = xmlElement.GetElementValue<string>("Zip"); }
public FlickrAuthInfo(XElement element) { Token = element.GetElementValue("token"); Permission = element.GetElementValue("perms"); XElement user = element.Element("user"); UserID = user.GetAttributeValue("nsid"); Username = user.GetAttributeValue("username"); Fullname = user.GetAttributeValue("fullname"); }
internal void LoadUserData(XElement node) { bool tryParseBool; TilesetView.TileIndexDrawMode tryParseTileIndices; if (node.GetElementValue("DarkBackground", out tryParseBool)) this.buttonBrightness.Checked = tryParseBool; if (node.GetElementValue("DisplayTileIndices", out tryParseTileIndices)) this.tileIndexDrawMode = tryParseTileIndices; this.ApplyBrightness(); this.ApplyTileIndexDrawMode(); }
internal static File FromXml(XElement file) { File f = new File(); f.FormatCode = file.GetAttribute("formatCode"); f.Url = new Uri(file.GetElementValue(XName.Get("uri", Video.NamespaceMsnVideoCatalog))); return f; }
internal static VideoFile FromXml(XElement videoFile) { VideoFile v = new VideoFile(); v.FormatCode = videoFile.GetAttribute("formatCode"); v.MsnFileId = videoFile.GetAttribute("msnFileId"); v.Url = new Uri(videoFile.GetElementValue(XName.Get("uri", Video.NamespaceMsnVideoCatalog))); return v; }
public MultiModeDto(XElement multiModeElement) { T1413ModeStatus = multiModeElement.GetElementValue("t1413"); GdmtModeStatus = multiModeElement.GetElementValue("gdmt"); GliteModeStatus = multiModeElement.GetElementValue("glite"); Adsl2ModeStatus = multiModeElement.GetElementValue("adsl2"); Adsl2PlusModeStatus = multiModeElement.GetElementValue("adsl2P"); Adsl2AnnexMModeStatus = multiModeElement.GetElementValue("adsl2Axm"); Readsl2ModeStatus = multiModeElement.GetElementValue("readsl2"); Vdsl2ModeStatus = multiModeElement.GetElementValue("vdsl2"); }
public void LoadFromXml(XElement xElement) { Id = xElement.GetAttributeValue<string>("Id"); //throw new NotImplementedException(); Name = xElement.GetElementValue<string>("Name"); PointOfContact = xElement.GetElementValue<string>("PointOfContact"); PhoneNumber = xElement.GetElementValue<string>("PhoneNumber"); Comments = xElement.GetElementValue<string>("Comments"); foreach (XElement addressesElement in xElement.Elements("Addresses")) { foreach (XElement addressElement in addressesElement.Elements("Address")) { Address address = new Address(); address.LoadFromXml(addressElement); Addresses.Add(address); } } }
internal void LoadUserData(XElement node) { bool tryParseBool; if (node.GetElementValue("ShowMessages", out tryParseBool)) this.buttonMessages.Checked = tryParseBool; if (node.GetElementValue("ShowWarnings", out tryParseBool)) this.buttonWarnings.Checked = tryParseBool; if (node.GetElementValue("ShowErrors", out tryParseBool)) this.buttonErrors.Checked = tryParseBool; if (node.GetElementValue("ShowCore", out tryParseBool)) this.buttonCore.Checked = tryParseBool; if (node.GetElementValue("ShowEditor", out tryParseBool)) this.buttonEditor.Checked = tryParseBool; if (node.GetElementValue("ShowGame", out tryParseBool)) this.buttonGame.Checked = tryParseBool; if (node.GetElementValue("AutoClear", out tryParseBool)) this.checkAutoClear.Checked = tryParseBool; if (node.GetElementValue("PauseOnError", out tryParseBool)) this.buttonPauseOnError.Checked = tryParseBool; this.logEntryList.SetFilterFlag(LogEntryList.MessageFilter.SourceCore, this.buttonCore.Checked); this.logEntryList.SetFilterFlag(LogEntryList.MessageFilter.SourceEditor, this.buttonEditor.Checked); this.logEntryList.SetFilterFlag(LogEntryList.MessageFilter.SourceGame, this.buttonGame.Checked); this.logEntryList.SetFilterFlag(LogEntryList.MessageFilter.TypeMessage, this.buttonMessages.Checked); this.logEntryList.SetFilterFlag(LogEntryList.MessageFilter.TypeWarning, this.buttonWarnings.Checked); this.logEntryList.SetFilterFlag(LogEntryList.MessageFilter.TypeError, this.buttonErrors.Checked); }
public static YouTubeChannelVideo Parse(XElement xItem) { // Get namespaces XNamespace atom = xItem.GetNamespaceOfPrefix("atom"); XNamespace media = xItem.GetNamespaceOfPrefix("media"); XNamespace yt = xItem.GetNamespaceOfPrefix("yt"); // Some pre-parsing XElement xMedia = xItem.Element(media + "group"); XElement xDuration = xMedia.Element(yt + "duration"); // Initialize and return the object return new YouTubeChannelVideo { Id = Regex.Match(xItem.GetElementValue("link"), "v=([v-]{11})").Groups[1].Value, Published = xItem.GetElementValue<DateTime>("pubDate"), LastUpdated = xItem.GetElementValue<DateTime>(atom + "updated"), Title = xItem.GetElementValue("title"), Description = xMedia.GetElementValue(media + "description"), Link = xItem.GetElementValue("link"), Author = xItem.GetElementValue("author"), Duration = xDuration.GetAttributeValue<int>("seconds") }; }
public virtual void LoadFromXml(XElement xElement) { Id = xElement.GetAttributeValue<string>("Id"); _vendorId = xElement.GetAttributeValue<string>("VendorId"); VendorAssignedProductId = xElement.GetAttributeValue<string>("VendorAssignedProductId"); Comments = xElement.GetElementValue<string>("Comments"); Description = xElement.GetElementValue<string>("Description"); UnitCost = xElement.GetElementValue<decimal>("UnitCost"); }
internal void LoadUserData(XElement node) { bool tryParseBool; if (node.GetElementValue("AutoRefresh", out tryParseBool)) this.buttonAutoRefresh.Checked = tryParseBool; if (node.GetElementValue("Locked", out tryParseBool)) this.buttonLock.Checked = tryParseBool; if (node.GetElementValue("DebugMode", out tryParseBool)) this.buttonDebug.Checked = tryParseBool; this.Text = node.GetElementValue("TitleText", this.Text); }
private static YouTubeVideo ParseItem(XElement xItem) { // Get namespaces XNamespace atom = xItem.GetNamespaceOfPrefix("atom"); XNamespace media = xItem.GetNamespaceOfPrefix("media"); XNamespace yt = xItem.GetNamespaceOfPrefix("yt"); XNamespace gd = xItem.GetNamespaceOfPrefix("gd"); // Some pre-parsing XElement xMedia = xItem.Element(media + "group"); XElement xDuration = xMedia.Element(yt + "duration"); // Get the <yt:statistics> element describing the number of favorites and // number of views XElement xStatistics = xItem.Element(yt + "statistics"); // Get the <yt:rating> element describing the number of lines and // number of dislikes (may not always be present) XElement xYouTubeRating = xItem.Element(yt + "rating"); // Get the <gd:rating> element describing the video rating and // number of raters XElement xGoogleRating = xItem.Element(gd + "rating"); // Initialize and return the object YouTubeVideo video = new YouTubeVideo(); video.Id = GetVideoId(xItem); video.Published = xItem.GetElementValue<DateTime>("pubDate"); video.LastUpdated = xItem.GetElementValue<DateTime>(atom + "updated"); video.Title = xItem.GetElementValue("title"); video.Description = xItem.GetElementValue("description"); video.Link = xItem.GetElementValue("link"); video.Author = xItem.GetElementValue("author"); video.Duration = TimeSpan.FromSeconds(xDuration.GetAttributeValue<int>("seconds")); video.FavoriteCount = xStatistics == null ? 0 : xStatistics.GetAttributeValue<int>("favoriteCount"); video.ViewCount = xStatistics == null ? 0 : xStatistics.GetAttributeValue<int>("viewCount"); video.Likes = xYouTubeRating == null ? 0 : xYouTubeRating.GetAttributeValue<int>("numLikes"); video.Dislikes = xYouTubeRating == null ? 0 : xYouTubeRating.GetAttributeValue<int>("numDislikes"); video.Rating = xGoogleRating == null ? 0 : xGoogleRating.GetAttributeValue<int>("average"); video.NumberOfRaters = xGoogleRating == null ? 0 : xGoogleRating.GetAttributeValue<int>("numRaters"); return video; }
private static YouTubeVideo ParseEntry(XElement xEntry) { // Get namespaces XNamespace atom = xEntry.GetDefaultNamespace(); XNamespace media = xEntry.GetNamespaceOfPrefix("media"); XNamespace yt = xEntry.GetNamespaceOfPrefix("yt"); XNamespace gd = xEntry.GetNamespaceOfPrefix("gd"); // Some pre-parsing XElement xAuthor = xEntry.Element(atom + "author"); XElement xMedia = xEntry.Element(media + "group"); XElement xDuration = xMedia.Element(yt + "duration"); XElement xLink = xEntry.Elements(atom + "link").FirstOrDefault(x => x.GetAttributeValue("rel") == "alternate"); // Get the <yt:statistics> element describing the number of favorites and // number of views XElement xStatistics = xEntry.Element(yt + "statistics"); // Get the <yt:rating> element describing the number of lines and // number of dislikes (may not always be present) XElement xYouTubeRating = xEntry.Element(yt + "rating"); // Get the <gd:rating> element describing the video rating and // number of raters XElement xGoogleRating = xEntry.Element(gd + "rating"); // Initialize and return the object YouTubeVideo video = new YouTubeVideo(); video.Id = xLink == null ? null : Regex.Match(xLink.GetAttributeValue("href"), "v=([\\w-]{11})").Groups[1].Value; video.Published = xEntry.GetElementValue<DateTime>(atom + "published"); video.LastUpdated = xEntry.GetElementValue<DateTime>(atom + "updated"); video.Title = xEntry.GetElementValue(atom + "title"); video.Description = xMedia.GetElementValue(media + "description"); video.Link = xLink == null ? null : xLink.GetAttributeValue("href"); video.Author = xAuthor.GetElementValue(atom + "name"); video.Duration = TimeSpan.FromSeconds(xDuration.GetAttributeValue<int>("seconds")); video.FavoriteCount = xStatistics == null ? 0 : xStatistics.GetAttributeValue<int>("favoriteCount"); video.ViewCount = xStatistics == null ? 0 : xStatistics.GetAttributeValue<int>("viewCount"); video.Likes = xYouTubeRating == null ? 0 : xYouTubeRating.GetAttributeValue<int>("numLikes"); video.Dislikes = xYouTubeRating == null ? 0 : xYouTubeRating.GetAttributeValue<int>("numDislikes"); video.Rating = xGoogleRating == null ? 0 : xGoogleRating.GetAttributeValue<double>("average", CultureInfo.InvariantCulture); video.NumberOfRaters = xGoogleRating == null ? 0 : xGoogleRating.GetAttributeValue<int>("numRaters"); return video; }
private void GetHeaderDetailsInvoiceFrom(XElement invoiceFromElement) { headerDetails.Add("carrname", invoiceFromElement.GetElementValue("Name")); headerDetails.Add("scac", invoiceFromElement.GetElementValue("VATNumber")); }
internal void LoadUserData(XElement node) { bool tryParseBool; if (node.GetElementValue("ShowComponents", out tryParseBool)) this.buttonShowComponents.Checked = tryParseBool; }
public static VimeoVideo GetVideoFromXElement(XElement xVideo) { // Check whether xVideo is NULL if (xVideo == null) throw new ArgumentNullException("xVideo"); // Some parsing return new VimeoVideo { BaseElement = xVideo, Id = xVideo.GetElementValue<int>("id"), Title = xVideo.GetElementValue<string>("title"), Description = xVideo.GetElementValue<string>("description"), Url = xVideo.GetElementValue<string>("url"), MobileUrl = xVideo.GetElementValue<string>("mobile_url"), UploadDate = xVideo.GetElementValue<DateTime>("upload_date"), ThumbnailSmall = xVideo.GetElementValue<string>("thumbnail_small"), ThumbnailMedium = xVideo.GetElementValue<string>("thumbnail_medium"), ThumbnailLarge = xVideo.GetElementValue<string>("thumbnail_large"), UserId = xVideo.GetElementValue<string>("user_id"), UserName = xVideo.GetElementValue<string>("user_name"), UserUrl = xVideo.GetElementValue<string>("user_url"), UserPortraitSmall = xVideo.GetElementValue<string>("user_portrait_small"), UserPortraitMedium = xVideo.GetElementValue<string>("user_portrait_medium"), UserPortraitLarge = xVideo.GetElementValue<string>("user_portrait_large"), UserPortraitHuge = xVideo.GetElementValue<string>("user_portrait_huge"), Likes = xVideo.GetElementValue<int>("stats_number_of_likes"), Plays = xVideo.GetElementValue<int>("stats_number_of_plays"), Comments = xVideo.GetElementValue<int>("stats_number_of_comments"), Duration = TimeSpan.FromSeconds(xVideo.GetElementValue<int>("duration")), Width = xVideo.GetElementValue<int>("width"), Height = xVideo.GetElementValue<int>("height"), Tags = (xVideo.GetElementValue<string>("tags") ?? "").Split(new [] { ", " }, StringSplitOptions.RemoveEmptyEntries) }; }
internal void LoadUserData(XElement node) { decimal tryParseDecimal; if (node.GetElementValue("FocusDist", out tryParseDecimal)) { this.focusDist.Value = Math.Abs(tryParseDecimal); } XElement bgColorElement = node.Element("BackgroundColor"); if (bgColorElement != null) { ColorRgba color = ColorRgba.Black; bgColorElement.TryGetElementValue("R", ref color.R); bgColorElement.TryGetElementValue("G", ref color.G); bgColorElement.TryGetElementValue("B", ref color.B); bgColorElement.TryGetElementValue("A", ref color.A); this.oldColorDialogColor = Color.FromArgb(color.A, color.R, color.G, color.B); this.selectedColorDialogColor = this.oldColorDialogColor; } this.loadTempPerspective = node.GetElementValue("Perspective", this.loadTempPerspective); this.loadTempState = node.GetElementValue("ActiveState", this.loadTempState); XElement snapToGridSizeElement = node.Element("SnapToGridSize"); if (snapToGridSizeElement != null) { Vector3 size; snapToGridSizeElement.GetElementValue("X", out size.X); snapToGridSizeElement.GetElementValue("Y", out size.Y); snapToGridSizeElement.GetElementValue("Z", out size.Z); this.editingUserGuides.GridSize = size; } XElement stateListNode = node.Element("States"); if (stateListNode != null) { Dictionary<string,XElement> stateElementMap = new Dictionary<string,XElement>(); foreach (XElement stateElement in stateListNode.Elements("State")) { string type = stateElement.GetAttributeValue("type"); if (!string.IsNullOrEmpty(type)) stateElementMap.Add(type, stateElement); } foreach (var pair in this.availStates) { XElement stateNode; if (!stateElementMap.TryGetValue(pair.Key.GetTypeId(), out stateNode)) continue; pair.Value.LoadUserData(stateNode); } } XElement layerListNode = node.Element("Layers"); if (layerListNode != null) { Dictionary<string,XElement> layerElementMap = new Dictionary<string,XElement>(); foreach (XElement layerElement in stateListNode.Elements("Layer")) { string type = layerElement.GetAttributeValue("type"); if (!string.IsNullOrEmpty(type)) layerElementMap.Add(type, layerElement); } foreach (var pair in this.availLayers) { XElement layerNode; if (!layerElementMap.TryGetValue(pair.Key.GetTypeId(), out layerNode)) continue; pair.Value.LoadUserData(layerNode); } } }
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")); }
private void GetHeaderDetailsFromInvoiceSummary(XElement element) { headerDetails.Add("mastinvno", element.GetElementValue("InvoiceNumber")); headerDetails.Add("inv_date", element.GetElementValue("InvoiceDate")); headerDetails.Add("paid_flag", element.GetElementValue("Currency")); }
private void GetHeaderDetailsFromInvoiceTo(XElement element) { headerDetails.Add("scac_client", element.GetElementValue("VATNumber")); }
public LoginInfo(XElement element) { SessionKey = element.GetElementValue("session_key"); Username = element.GetElementValue("user_name"); EMail = element.GetElementValue("email"); MembershipType = element.GetElementValue("membership_type"); MembershipEnds = element.GetElementValue("membership_ends"); CapableUpload = element.GetElementValue("capable_upload") != "0"; CapableDownload = element.GetElementValue("capable_download") != "0"; CapableFolders = element.GetElementValue("capable_folders") != "0"; CapableFiles = element.GetElementValue("capable_files") != "0"; CapableHTTPS = element.GetElementValue("capable_https") != "0"; CapableAddressBook = element.GetElementValue("capable_addressbook") != "0"; BandwidthLeft = element.GetElementValue("bandwidth_left"); DiskSpaceLeft = element.GetElementValue("diskspace_left"); DiskSpaceUsed = element.GetElementValue("diskspace_used"); Points = element.GetElementValue("points"); }
public override void LoadFromXml(XElement xElement) { base.LoadFromXml(xElement); BoxCost = xElement.GetElementValue<decimal>("BoxCost"); UnitsInBox = xElement.GetElementValue<int>("UnitsInBox"); }
public AtuEventHistoryDto(XElement atuEventHistoryElement) { TimeElapsed = atuEventHistoryElement.GetElementValue("timeElapsed"); FrameEventsCount = atuEventHistoryElement.GetElementValue("frameEvents"); SignalEventsCount = atuEventHistoryElement.GetElementValue("signalEvents"); LinkEventsCount = atuEventHistoryElement.GetElementValue("linkEvents"); PowerEventsCount = atuEventHistoryElement.GetElementValue("powerEvents"); ErroredSecondsCount = atuEventHistoryElement.GetElementValue("erroredSecs"); LineIntitializationsCount = atuEventHistoryElement.GetElementValue("lineInit"); SeverelyErroredSeconds = atuEventHistoryElement.GetElementValue("severroredSecs"); UnavailableSeconds = atuEventHistoryElement.GetElementValue("unAvailSecs"); CrcAnomalies = atuEventHistoryElement.GetElementValue("crcAnomalies"); FecSeconds = atuEventHistoryElement.GetElementValue("fecSecs"); FecEvents = atuEventHistoryElement.GetElementValue("fecEvents"); }
/// <summary> /// If the video is retrieved as part of a channel, it is described by /// an <item> element.If the video is retrieved directly, it is /// instead described by an <entry> element. This also affects /// how the URL (and ID) can be found. /// </summary> /// <param name="xElement"></param> /// <returns></returns> private static string GetVideoId(XElement xElement) { if (xElement == null) return null; if (xElement.Name == "item") return Regex.Match(xElement.GetElementValue("link"), "v=([\\w-]{11})").Groups[1].Value; if (xElement.Name == "entry") { var link = xElement.XPathSelectElement("link[@rel=alternate]"); return link == null ? null : link.GetAttributeValue("href"); } return null; }
public SummaryDto(XElement summaryElement) { Code = summaryElement.GetElementValue("code"); Description = new DescriptionDto(summaryElement.GetElement("description")); }
private void GetShipmentDetails(XElement shipmentElement) { shipment.Add("pro_number", shipmentElement.GetElementValue("FileNumber")); shipment.Add("mode", shipmentElement.GetElementValue("TransportType")); shipment.Add("wieght", shipmentElement.GetElementValue("Weight")); shipment.Add("dim_wt", shipmentElement.GetElementValue("ChargeableWeight")); shipment.Add("org_apt", shipmentElement.GetElementValue("PortOfDeparture")); shipment.Add("org_city", shipmentElement.GetElementValue("LoadingPlace")); shipment.Add("dest_apt", shipmentElement.GetElementValue("PortOfArrival")); shipment.Add("dest_city", shipmentElement.GetElementValue("FinalDestination")); shipment.Add("dest_cty", shipmentElement.GetElementValue("IsoCountryCode")); shipment.Add("rccode", shipmentElement.GetElementValue("DocumentReference")); }