Поделиться через


Strokes.Remove - метод (Strokes)

Обновлен: Ноябрь 2007

Removes a Strokes collection from the Strokes collection.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Sub Remove ( _
    strokes As Strokes _
)
'Применение
Dim instance As Strokes
Dim strokes As Strokes

instance.Remove(strokes)
public void Remove(
    Strokes strokes
)
public:
void Remove(
    Strokes^ strokes
)
public void Remove(
    Strokes strokes
)
public function Remove(
    strokes : Strokes
)

Параметры

Заметки

Strokes collections are sets of references to ink data rather than actual data. The Remove method removes ink data references rather than actual ink data. To delete actual ink data, call the Ink.DeleteStrokes method.

After calling the Remove method, objects in the collection are reordered. For example, in Microsoft Visual Basic.NET, after calling Strokes.Remove(Strokes.Item(0)), what was Strokes.Item(1) becomes Strokes.Item(0); what was strokes.Item(2) becomes strokes.Item(1); and so forth.

Примеры

This C# example removes a Strokes collection, strokesToRemove, from a larger Strokes collection, theLeftToRightStokes, if the first point in the Stroke is not to the left of the last point in the Stroke. The original data in the Ink object are unaffected.

//...
Strokes strokesToRemove = theLeftToRightStrokes.Ink.CreateStrokes();
foreach (Stroke testStroke in theLeftToRightStrokes)
{
    Point ptStart = testStroke.GetPoint(0);
    Point ptEnd = testStroke.GetPoint(testStroke.PacketCount - 1);
    if (ptStart.X > ptEnd.X)
        strokesToRemove.Add(testStroke);
}
theLeftToRightStrokes.Remove(strokesToRemove);

This Visual Basic .NET example removes a Strokes collection, strokesToRemove, from a larger Strokes collection, theLeftToRightStokes, if the first point in the Stroke is not to the left of the last point in the Stroke. The original data in the Ink object are unaffected.

'...
Dim testStroke As Stroke
Dim strokesToRemove As Strokes = theLeftToRightStrokes.Ink.CreateStrokes()
For Each testStroke In theLeftToRightStrokes
    Dim ptStart As Point = testStroke.GetPoint(0)
    Dim ptEnd As Point = testStroke.GetPoint(testStroke.PacketCount - 1)
    If ptStart.X > ptEnd.X Then
       strokesToRemove.Add(testStroke)
    End If
Next
theLeftToRightStrokes.Remove(strokesToRemove)

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

Strokes Класс

Strokes - члены

Remove - перегрузка

Microsoft.Ink - пространство имен

Strokes.RemoveAt

Stroke

Strokes