當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlNode.GetIntSafe方法代碼示例

本文整理匯總了C#中System.Xml.XmlNode.GetIntSafe方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlNode.GetIntSafe方法的具體用法?C# XmlNode.GetIntSafe怎麽用?C# XmlNode.GetIntSafe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.XmlNode的用法示例。


在下文中一共展示了XmlNode.GetIntSafe方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Contact

 /// <summary>
 /// Initializes a new instance of the <see cref="Contact" /> class.
 /// </summary>
 /// <param name="node">The XML node to initialize from</param>
 /// <param name="namespaceManager">The namespace manager</param>
 public Contact(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     this.AccountManagerFullName = node.GetStringSafe("tlp:AccountManagerFullName", namespaceManager);
     this.AccountManagerID = node.GetIntSafe("tlp:AccountManagerID", namespaceManager);
     this.Address1 = node.GetStringSafe("tlp:Address1", namespaceManager);
     this.Address2 = node.GetStringSafe("tlp:Address2", namespaceManager);
     this.Birthday = node.GetStringSafe("tlp:Birthday", namespaceManager);
     this.City = node.GetStringSafe("tlp:City", namespaceManager);
     this.Comment = node.GetStringSafe("tlp:Comment", namespaceManager);
     this.Country = node.GetStringSafe("tlp:Country", namespaceManager);
     this.CustomerID = node.GetIntSafe("tlp:CustomerID", namespaceManager);
     this.CustomerName = node.GetStringSafe("tlp:CustomerName", namespaceManager);
     this.CustomerNo = node.GetStringSafe("tlp:CustomerNo", namespaceManager);
     this.Email = node.GetStringSafe("tlp:Email", namespaceManager);
     this.FirstName = node.GetStringSafe("tlp:FirstName", namespaceManager);
     this.FullName = node.GetStringSafe("tlp:FullName", namespaceManager);
     this.Id = int.Parse(node.Attributes["ID"].InnerText);
     this.LastName = node.GetStringSafe("tlp:LastName", namespaceManager);
     this.Mobile = node.GetStringSafe("tlp:Mobile", namespaceManager);
     this.Phone = node.GetStringSafe("tlp:Phone", namespaceManager);
     this.PrivatePhone = node.GetStringSafe("tlp:PrivatePhone", namespaceManager);
     this.State = node.GetStringSafe("tlp:State", namespaceManager);
     this.Title = node.GetStringSafe("tlp:Title", namespaceManager);
     this.ZipCode = node.GetStringSafe("tlp:ZipCode", namespaceManager);
 }
開發者ID:maxwalter,項目名稱:TimeLogApiSdk,代碼行數:30,代碼來源:Contact.cs

示例2: WorkUnit

 /// <summary>
 ///     Initializes a new instance of the <see cref="WorkUnit" /> class.
 /// </summary>
 /// <param name="node">The XML node to initialize from</param>
 /// <param name="namespaceManager">The namespace manager</param>
 public WorkUnit(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     this.AdditionalTextField = node.GetStringSafe("tlp:AdditionalTextField", namespaceManager);
     this.AllocationID = node.GetIntSafe("tlp:AllocationID", namespaceManager);
     this.ApprovedStatus = node.GetIntSafe("tlp:ApprovedStatus", namespaceManager);
     this.Created = node.GetDateTimeSafe("tlp:Created", namespaceManager);
     this.CreatedBy = node.GetStringSafe("tlp:CreatedBy", namespaceManager);
     this.CreatedByEmployeeID = node.GetIntSafe("tlp:CreatedByEmployeeID", namespaceManager);
     this.CustomerID = node.GetIntSafe("tlp:CustomerID", namespaceManager);
     this.CustomerName = node.GetStringSafe("tlp:CustomerName", namespaceManager);
     this.Date = node.GetDateTimeSafe("tlp:Date", namespaceManager);
     this.DepartmentID = node.GetIntSafe("tlp:DepartmentID", namespaceManager);
     this.DepartmentName = node.GetStringSafe("tlp:DepartmentName", namespaceManager);
     this.EmployeeFirstName = node.GetStringSafe("tlp:EmployeeFirstName", namespaceManager);
     this.EmployeeID = node.GetIntSafe("tlp:EmployeeID", namespaceManager);
     this.EmployeeInitials = node.GetStringSafe("tlp:EmployeeInitials", namespaceManager);
     this.EmployeeLastName = node.GetStringSafe("tlp:EmployeeLastName", namespaceManager);
     this.EstimatedAmount = node.GetDoubleSafe("tlp:EstimatedAmount", namespaceManager);
     this.EstimatedHours = node.GetDoubleSafe("tlp:EstimatedHours", namespaceManager);
     this.Id = int.Parse(node.Attributes["ID"].InnerText);
     this.InvAmount = node.GetDoubleSafe("tlp:InvAmount", namespaceManager);
     this.InvHours = node.GetDoubleSafe("tlp:InvHours", namespaceManager);
     this.IsBillable = node.GetBoolTimeSafe("tlp:IsBillable", namespaceManager);
     this.LastModifiedAt = node.GetDateTimeSafe("tlp:LastModifiedAt", namespaceManager);
     this.LastModifiedBy = node.GetStringSafe("tlp:LastModifiedBy", namespaceManager);
     this.LastModifiedByEmployeeID = node.GetIntSafe("tlp:LastModifiedByEmployeeID", namespaceManager);
     this.Note = node.GetStringSafe("tlp:Note", namespaceManager).Trim('\r', '\n');
     this.ProjectID = node.GetIntSafe("tlp:ProjectID", namespaceManager);
     this.ProjectName = node.GetStringSafe("tlp:ProjectName", namespaceManager);
     this.RegAmount = node.GetDoubleSafe("tlp:RegAmount", namespaceManager);
     this.RegHours = node.GetDoubleSafe("tlp:RegHours", namespaceManager);
     this.TaskID = node.GetIntSafe("tlp:TaskID", namespaceManager);
     this.TaskName = node.GetStringSafe("tlp:TaskName", namespaceManager);
 }
開發者ID:maxwalter,項目名稱:TimeLogApiSdk,代碼行數:39,代碼來源:WorkUnit.cs

示例3: Customer

 /// <summary>
 /// Initializes a new instance of the <see cref="Customer"/> class.
 /// </summary>
 /// <param name="node">The XML node to initialize from</param>
 /// <param name="namespaceManager">The namespace manager</param>
 public Customer(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     this.AccountManagerFullName = node.GetStringSafe("tlp:AccountManagerFullName", namespaceManager);
     this.AccountManagerID = node.GetIntSafe("tlp:AccountManagerID", namespaceManager);
     this.Address1 = node.GetStringSafe("tlp:Address1", namespaceManager);
     this.Address2 = node.GetStringSafe("tlp:Address2", namespaceManager);
     this.Address3 = node.GetStringSafe("tlp:Address3", namespaceManager);
     this.City = node.GetStringSafe("tlp:City", namespaceManager);
     this.Country = node.GetStringSafe("tlp:Country", namespaceManager);
     this.CustomerStatus = node.GetStringSafe("tlp:CustomerStatus", namespaceManager);
     this.CustomerStatusID = node.GetIntSafe("tlp:CustomerStatusID", namespaceManager);
     this.Email = node.GetStringSafe("tlp:Email", namespaceManager);
     this.Fax = node.GetStringSafe("tlp:Fax", namespaceManager);
     this.Id = int.Parse(node.Attributes["ID"].InnerText);
     this.Name = node.GetStringSafe("tlp:Name", namespaceManager);
     this.NickName = node.GetStringSafe("tlp:NickName", namespaceManager);
     this.No = node.GetStringSafe("tlp:No", namespaceManager);
     this.Phone = node.GetStringSafe("tlp:Phone", namespaceManager);
     this.State = node.GetStringSafe("tlp:State", namespaceManager);
     this.VATNo = node.GetStringSafe("tlp:VATNo", namespaceManager);
     this.WebPage = node.GetStringSafe("tlp:WebPage", namespaceManager);
     this.ZipCode = node.GetStringSafe("tlp:ZipCode", namespaceManager);
 }
開發者ID:maxwalter,項目名稱:TimeLogApiSdk,代碼行數:28,代碼來源:Customer.cs


注:本文中的System.Xml.XmlNode.GetIntSafe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。