CustomStrokes.RemoveAt 方法
移除 CustomStrokes 集合中指定索引处的 Strokes 集合。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink(在 Microsoft.Ink.dll 中)
语法
声明
Public Sub RemoveAt ( _
i As Integer _
)
用法
Dim instance As CustomStrokes
Dim i As Integer
instance.RemoveAt(i)
public void RemoveAt(
int i
)
public:
void RemoveAt(
int i
)
public void RemoveAt(
int i
)
public function RemoveAt(
i : int
)
参数
- i
类型:System.Int32
要从 CustomStrokes 集合中移除的 Strokes 集合的索引。
备注
CustomStrokes 集合是对墨迹数据的引用,不是实际数据本身。此方法仅从墨迹数据的快照或对墨迹数据的引用中移除相关的集合,不移除实际墨迹数据。若要从实际墨迹数据中删除集合,请调用 Ink.DeleteStrokes 方法。
如果 index 与 CustomStrokes 集合的现有成员不匹配,则会引发 System.ArgumentOutOfRangeException。如果出于开发目的正在使用安装了 Tablet PC SDK 的 Windows XP(非 Tablet 版本),并且 index 与 CustomStrokes 集合的现有成员不匹配,则会引发 System.Runtime.InteropServices。
示例
在此示例中,将移除 CustomStrokes 集合中指定索引处的 Strokes 集合。如果在指定索引处没有 Strokes 集合,则会引发异常。
Private Sub RemoveCustomStrokes(ByVal mIndex As Integer, ByVal mInk As Ink)
Try
' if the indexed position does not exist, an exception will be raised
mInk.CustomStrokes.RemoveAt(mIndex)
Catch E As System.Runtime.InteropServices.COMException
' For Windows XP (not Tablet Edition) with Tablet PC SDK installed for development purposes
' this exception is raised when the indexed collection does not exist
Catch E As ArgumentOutOfRangeException
' For Windows XP Tablet Edition and Vista
' this exception is raised when the indexed collection does not exist
End Try
End Sub
private void RemoveCustomStrokes(int mIndex, Ink mInk)
{
try
{
// if the indexed position does not exist, an exception will be raised
mInk.CustomStrokes.RemoveAt(mIndex);
}
catch (System.Runtime.InteropServices.COMException)
{
// For Windows XP (not Tablet Edition) with Tablet PC SDK installed for development purposes
// this exception is raised when the indexed collection does not exist
}
catch (ArgumentOutOfRangeException)
{
// For Windows XP Tablet Edition and Vista
// this exception is raised when the indexed collection does not exist
}
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0