Strokes コレクションを CustomStrokes コレクションに追加します。
名前空間 : 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
)
パラメータ
- name
型 : System.String
CustomStrokes コレクションに追加する Strokes の名前。
- strokes
型 : Microsoft.Ink.Strokes
CustomStrokes コレクションに追加する Strokes コレクション。
解説
![]() |
---|
既に CustomStrokes コレクションに存在する名前に設定された name パラメータでこのメソッドを呼び出すと、例外がスローされます。 |
例
この例では、渡された Ink オブジェクトの Strokes コレクションが、渡された同じ Ink オブジェクトの CustomStrokes コレクションに、指定した名前を使用して追加されます。名前の付いた CustomStrokes コレクションが既に存在する場合は、例外が発生します。
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