Using TaggedValue
Click an association element.
Select the TaggedValue tab.
Enter "collection_kind" in the Name and a collection type in the Value. The following collection types can be entered. If this TaggedValue is not set, it is the same as setting "List".
List
LinkedList
HashSet
SortedSet
Stack
Queue
Select the Association End tab.
Enter “*” for the upper limit in the Multiplicity.
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public class Foo
{
// ˅
// ˄
private LinkedList<Bar> bars;
// ˅
// ˄
}
// ˅
// ˄
Using Stereotype
Click an association element.
Select the Stereotype tab.
Enter "collection_kind=(Collection type)" in the Name. The following collection types can be entered. If this Stereotype is not set, it is the same as setting "List".
List
LinkedList
HashSet
SortedSet
Stack
Queue
Select the Association End tab.
Enter “*” for the upper limit in the Multiplicity.
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public class Foo
{
// ˅
// ˄
private LinkedList<Bar> bars;
// ˅
// ˄
}
// ˅
// ˄
Using TaggedValue
Click an association element with the qualifier.
Select the TaggedValue tab.
Enter "collection_kind" in the Name and a collection type in the Value. The following collection types can be entered. If this TaggedValue is not set, it is the same as setting "Dictionary".
Dictionary
SortedDictionary
SortedList
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public class Foo
{
// ˅
// ˄
private SortedDictionary<int, Bar> bars;
// ˅
// ˄
}
// ˅
// ˄
Using Stereotype
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public class Foo
{
// ˅
// ˄
private SortedDictionary<int, Bar> bars;
// ˅
// ˄
}
// ˅
// ˄
C# Example Code
class Foo {
public:
int sum;
};
Click a model element.
Select the Stereotype tab.
Enter "(Modifier)" in the Name. The following modifiers can be entered.
static
sealed
new
volatile
virtual
override
extern
async
abstract
implicit
explicit
Alternatively, the following modifiers can also be set in the Language tab.
sealed
volatile
virtual
override
extern
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public sealed class Foo
{
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
[Serializable]
public class Foo
{
// ˅
// ˄
// ˅
// ˄
}
// ˅
// ˄
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public class Foo
{
// ˅
// ˄
public void Sum(params int[] values)
{
// ˅
throw new NotImplementedException();
// ˄
}
// ˅
// ˄
}
// ˅
// ˄
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public class Foo
{
// ˅
// ˄
public void Sum(out int values)
{
// ˅
throw new NotImplementedException();
// ˄
}
// ˅
// ˄
}
// ˅
// ˄
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public class Foo
{
// ˅
// ˄
private int Max
{
// ˅
get => default;
set
{
}
// ˄
}
// ˅
// ˄
}
// ˅
// ˄
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public class Foo
{
// ˅
// ˄
public static void operator ++()
{
// ˅
throw new NotImplementedException();
// ˄
}
// ˅
// ˄
}
// ˅
// ˄
Write indexers, events, and delegates in the User Code Area - which is an area quoted with “˅” and “˄”.
C# Example Code
// ˅
using System;
using System.Collections.Generic;
using System.Text;
// ˄
public class Foo
{
// ˅
// ˄
// ˅
// Indexer
public int this[int index]
{
}
// ˄
}
// ˅
// ˄