Share via


CustomStrokes.Add Method

Adds a Strokes collection to the CustomStrokes collection.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Sub Add ( _
    name As String, _
    strokes As Strokes _
)
'Usage
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 function Add(
    name : String, 
    strokes : Strokes
)

Parameters

Remarks

Note

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

Examples

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
    }
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

CustomStrokes Class

CustomStrokes Members

Microsoft.Ink Namespace

Strokes

Ink