G
Guest
Hi ,
I use VS 2005 beta1 to do some thing as follows.
declare a Dictionary<ulong,DelegateTyep> dictionary = new ...
and use dictionary object such as
dictionary [aUlongNumber] += aDelegateTyepObject;
then compiler is ok ,but throw KeyNotFoundException at run-time.
OK,I think just a missed initailization,thne add it like
dictionary[aUlongNumber] = null;
It becomes to be vary strange.It doesn't throw exception any more.
What's difference between '=' and '+=' on Dictionary's indexer operation?
Them are also assigning value to indexing entry,right?
Or some thiing compiler do for '+=' operator(Delegate.Combine)?
Thanks for your help
I use VS 2005 beta1 to do some thing as follows.
declare a Dictionary<ulong,DelegateTyep> dictionary = new ...
and use dictionary object such as
dictionary [aUlongNumber] += aDelegateTyepObject;
then compiler is ok ,but throw KeyNotFoundException at run-time.
OK,I think just a missed initailization,thne add it like
dictionary[aUlongNumber] = null;
It becomes to be vary strange.It doesn't throw exception any more.
What's difference between '=' and '+=' on Dictionary's indexer operation?
Them are also assigning value to indexing entry,right?
Or some thiing compiler do for '+=' operator(Delegate.Combine)?
Thanks for your help