本文整理汇总了C#中System.Xml.XmlNode.GetStringSafe方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.GetStringSafe方法的具体用法?C# XmlNode.GetStringSafe怎么用?C# XmlNode.GetStringSafe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlNode
的用法示例。
在下文中一共展示了XmlNode.GetStringSafe方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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);
}
示例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);
}