var VarSelLyr = win.cboOutputL.SelectedItem;
Dictionary<string, SmallLayerObj> DictLyr = null;
KeyValuePair<string, SmallLayerObj> KVPLyr;
SmallLayerObj LyrObj = null;
if (VarSelLyr
is Dictionary
<string, SmallLayerObj
> == true) {
DictLyr = (Dictionary<string, SmallLayerObj>)VarSelLyr;
// The next one fails: IntelliSense writes
// Dictionary<string, SmallLayerObj> does not contain a definition for 'value'.
if (DictLyr
.Value is SmallLayerObj
== true) LyrObj = (SmallLayerObj)KVPLyr.Value;
}
if (VarSelLyr
is KeyValuePair
<string, SmallLayerObj
> == true) {
KVPLyr = (KeyValuePair<string, SmallLayerObj>)VarSelLyr;
// This works
if (KVPLyr
.Value is SmallLayerObj
== true) LyrObj = (SmallLayerObj)KVPLyr.Value;
}
acDoc.Editor.WriteMessage("Name value = " + LyrObj.Name.ToString());