本文整理匯總了C#中Activity.ToXml方法的典型用法代碼示例。如果您正苦於以下問題:C# Activity.ToXml方法的具體用法?C# Activity.ToXml怎麽用?C# Activity.ToXml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Activity
的用法示例。
在下文中一共展示了Activity.ToXml方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CanSerialize
public void CanSerialize()
{
Activity a = new Activity();
a.At = DateTime.Parse("2008-07-01T19:19:36-04:00").ToUniversalTime();
a.Guid = "152623406";
a.Type = "dugg";
a.Uid = "joe";
Assert.AreEqual(@"<?xml version=""1.0"" encoding=""utf-8""?>
<activity xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" uid=""joe"" at=""2008-07-01T23:19:36Z"" guid=""152623406"" type=""dugg"" />",
a.ToXml());
Activities activities = new Activities();
activities.Add(a);
Assert.AreEqual(@"<?xml version=""1.0"" encoding=""utf-8""?>
<activities xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<activity uid=""joe"" at=""2008-07-01T23:19:36Z"" guid=""152623406"" type=""dugg"" />
</activities>",
activities.ToXml());
}