This topic has not yet been rated - Rate this topic

Properties Property

IIS 7.0

Gets the System.Collections..::..IDictionary member of the class.

Namespace:  Microsoft.Web.Management.Client
Assembly:  Microsoft.Web.Management (in Microsoft.Web.Management.dll)
public IDictionary Properties { get; }

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

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


Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.