本文整理汇总了C#中EditType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# EditType.ToString方法的具体用法?C# EditType.ToString怎么用?C# EditType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EditType
的用法示例。
在下文中一共展示了EditType.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateEdit
// Removed because it confusses the API.
//public Picture InsertPicture(int index, string imageID)
//{
// return InsertPicture(index, imageID, string.Empty, string.Empty);
//}
/// <summary>
/// Creates an Edit either a ins or a del with the specified content and date
/// </summary>
/// <param name="t">The type of this edit (ins or del)</param>
/// <param name="edit_time">The time stamp to use for this edit</param>
/// <param name="content">The initial content of this edit</param>
/// <returns></returns>
internal static XElement CreateEdit(EditType t, DateTime edit_time, object content)
{
if (t == EditType.del)
{
foreach (object o in (IEnumerable<XElement>)content)
{
if (o is XElement)
{
XElement e = (o as XElement);
IEnumerable<XElement> ts = e.DescendantsAndSelf(XName.Get("t", DocX.w.NamespaceName));
for (int i = 0; i < ts.Count(); i++)
{
XElement text = ts.ElementAt(i);
text.ReplaceWith(new XElement(DocX.w + "delText", text.Attributes(), text.Value));
}
}
}
}
return
(
new XElement(DocX.w + t.ToString(),
new XAttribute(DocX.w + "id", 0),
new XAttribute(DocX.w + "author", WindowsIdentity.GetCurrent().Name),
new XAttribute(DocX.w + "date", edit_time),
content)
);
}