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


CustomStrokes.Add - метод

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

Adds a Strokes collection to the CustomStrokes collection.

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

Синтаксис

'Декларация
Public Sub Add ( _
    name As String, _
    strokes As Strokes _
)
'Применение
Dim instance As CustomStrokes
Dim name As String
Dim strokes As Strokes

instance.Add(name, strokes)
public void Add(
    string name,
    Strokes strokes
)
public:
void Add(
    String^ name, 
    Strokes^ strokes
)
public void Add(
    String name,
    Strokes strokes
)
public function Add(
    name : String, 
    strokes : Strokes
)

Параметры

Заметки

ms568649.alert_note(ru-ru,VS.90).gifПримечание.

If you call this method with the name parameter set to a name that already exists in the CustomStrokes collection, an exception is thrown.

Примеры

In this example, the Strokes collection of the passed Ink object is added the CustomStrokes collection of the same passed Ink object using the specified name. If the named CustomStrokes collection already exists, an exception is raised.

Private Sub AddCustomStrokes(ByVal mName As String, ByVal mInk As Ink)
    Try
        ' if the name already exists, an exception will be raised
        mInk.CustomStrokes.Add(mName, mInk.Strokes)
    Catch E As ArgumentException
        ' this exception is raised when the named collection already exists
    End Try
End Sub
private void AddCustomStrokes(string mName, Ink mInk)
{
    try
    {
        // if the name already exists, an exception will be raised
        mInk.CustomStrokes.Add(mName, mInk.Strokes);
    }
    catch (ArgumentException)
    {
        // this exception is raised when the named collection already exists
    }
}

Платформы

Windows Vista

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

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

.NET Framework

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

См. также

Ссылки

CustomStrokes Класс

CustomStrokes - члены

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

Strokes

Ink