当前位置: 首页>>代码示例>>C#>>正文


C# XContainer.ToString方法代码示例

本文整理汇总了C#中System.Xml.Linq.XContainer.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# XContainer.ToString方法的具体用法?C# XContainer.ToString怎么用?C# XContainer.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.Linq.XContainer的用法示例。


在下文中一共展示了XContainer.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteTo

 private void WriteTo(XContainer markupSource, Control targetControl)
 {
     targetControl.Controls.Add(new LiteralControl(markupSource.ToString()));
 }
开发者ID:valendo,项目名称:YO,代码行数:4,代码来源:functioncalleditor.aspx.cs

示例2: SaveWithPath

 public static void SaveWithPath(XContainer x, string path)
 {
     SaveWithPath(x.ToString(SaveOptions.OmitDuplicateNamespaces), path);
 }
开发者ID:simonegli8,项目名称:Silversite,代码行数:4,代码来源:Files.cs

示例3: RemoveEmptyPropertyElements

		private static bool RemoveEmptyPropertyElements(IDomainObjectDTORepository dtoRepos, DomainObjectDTO currentDto, XContainer rtElement)
		{
			var propertyElements = (rtElement.Element("CmObject") != null)
											? rtElement.Elements().Elements() // Two levels for old stuff before DM15
											: rtElement.Elements();
			// ToArray is required or Remove will end loop early.
			var emptyPropertyElements = (propertyElements.Where(propertyElement => !propertyElement.HasAttributes && !propertyElement.HasElements)).ToArray();
			foreach (var emptyPropertyElement in emptyPropertyElements)
			{
				emptyPropertyElement.Remove();
			}
			// Notify of update, if it changed.
			var results = false;
			if (emptyPropertyElements.Any())
			{
				UpdateDTO(dtoRepos, currentDto, rtElement.ToString());
				results = true;
			}
			return results;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:20,代码来源:DataMigrationServices.cs

示例4: FromXml

		/// <summary>
		/// Instantiates ViewTransactionResponse class.
		/// </summary>
		/// <param name="xml">
		/// View transaction operation response in XML format.
		/// </param>
		/// <returns>
		/// A <see cref="ViewTransactionResponse"/> object.
		/// </returns>
        public static ViewTransactionResponse FromXml(XContainer xml)
        {
            ViewTransactionResponse response = new ViewTransactionResponse()
            {
                MerchantId = xml.Element(MerchantIdNodeName).Value.Trim()
            };
			string status = xml.Element(StatusNodeName).Value.Trim();
			if (status.Equals(ActionStatus.Success))
			{
	            XElement transactionElement = xml.Element(TransactionNodeName);
	            if (transactionElement != null)
	            	response.TransactionInfo = ParseSuccessTransaction(transactionElement);
	            else
	                throw new LiqPayException(ErrorCode.ResponseIsNotWellFormed, "Transaction element is not found in the response.", xml.ToString());
			}
			else
				response.TransactionInfo = ParseFailureTransaction(xml);

            return response;
        }
开发者ID:T0lya,项目名称:LiqPayClient.Net,代码行数:29,代码来源:Response.cs


注:本文中的System.Xml.Linq.XContainer.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。