本文整理匯總了C#中OpenLiveWriter.Mshtml.MarkupRange.RemoveContent方法的典型用法代碼示例。如果您正苦於以下問題:C# MarkupRange.RemoveContent方法的具體用法?C# MarkupRange.RemoveContent怎麽用?C# MarkupRange.RemoveContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenLiveWriter.Mshtml.MarkupRange
的用法示例。
在下文中一共展示了MarkupRange.RemoveContent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DeleteContent
/// <summary>
/// Delete the content between a markup range from the document.
/// </summary>
/// <param name="selection"></param>
private void DeleteContent(MarkupRange selection)
{
//there is nothing being deleted, so just return
//Note: this avoids overhead associated with needlessly notifying that the content changed
if (selection.Start.IsEqualTo(selection.End))
{
return;
}
IUndoUnit undo = CreateUndoUnit();
using (undo)
{
try
{
selection.RemoveContent();
}
catch (Exception e)
{
Trace.Fail("error while deleting selection: " + e.Message, e.StackTrace);
throw e;
}
undo.Commit();
}
}