public void Add(TKey key, TValue value) { //This is multicast delegate create contiuation var val = DictionaryUtils.CreatePromise(stateManager, ((Delegate)(object)value)); internalDictCase5.Add(key, new CollectionStateObjectReference((IStateObject)val)); AddReferenceIntoStateObjectSurrogate(val); }
public TValue this [TKey key] { get { var entry5 = internalDictCase5[key]; TValue retEntry5 = (TValue)DictionaryUtils.RetrieveDelegateFromPromise(typeof(TValue), (IPromise)entry5.Target); return(retEntry5); } set { //Erase old reference CollectionStateObjectReference internalValue; if (internalDictCase5.TryGetValue(key, out internalValue) /*&& internalValue !=null*/) { if (!internalValue.IsNull) { stateManager.RemoveObject(internalValue.TargetUniqueID, mustDetach: true, deep: true); RemoveReferenceFromStateObjectSurrogate(internalValue); } } //This is multicast delegate create contiuation var val = DictionaryUtils.CreatePromise(stateManager, ((Delegate)(object)value)); internalDictCase5 [key] = new CollectionStateObjectReference((IStateObject)val); AddReferenceIntoStateObjectSurrogate(val); } }