Share via


TaskItem.Properties Property

Definition

Gets the IDictionary member of the class.

public:
 property System::Collections::IDictionary ^ Properties { System::Collections::IDictionary ^ get(); };
public System.Collections.IDictionary Properties { get; }
member this.Properties : System.Collections.IDictionary
Public ReadOnly Property Properties As IDictionary

Property Value

The IDictionary member of the class.

Examples

The following example creates a MethodTaskItem object and populates the dictionary. The trace listener output is as follows:

Dumping MTI dictionary

One First

two second

three third

MethodTaskItem mti = GetMTI("NavData",
                   "Navigate Demo with Data",
                   sDemoCat);

IDictionary dic = mti.Properties;
Trace.WriteLine("Dumping MTI dictionary");
foreach (DictionaryEntry de in dic)
    Trace.WriteLine(de.Key.ToString() + "   " + de.Value.ToString());

items.Add(mti);
MethodTaskItem GetMTI(string methodName, string menu, string category) {

    MethodTaskItem mti = new MethodTaskItem(methodName, menu, category);
    IDictionary d = mti.Properties;
    d.Add("One", "First");
    d.Add("two", "second");
    d.Add("three", "third");

    return mti;
}

Remarks

The dictionary can be used to store key/value pairs that are associated with the task item. The Properties dictionary is a System.Collections.Specialized.HybridDictionary object.

Applies to