private void Logic_AddToParentDictionary(ObjectWriterContext ctx, object key, object value) { if (ctx.CurrentKeyIsUnconverted && !ctx.ParentShouldNotConvertChildKeys) { if (!ctx.ParentShouldConvertChildKeys) { try { this.Runtime.AddToDictionary(ctx.ParentCollection, ctx.ParentType, value, ctx.CurrentType, key); ctx.ParentShouldNotConvertChildKeys = true; return; } catch (XamlObjectWriterException exception) { if (!(exception.InnerException is ArgumentException) && !(exception.InnerException is InvalidCastException)) { throw; } Debugger.IsLogging(); } ctx.ParentShouldConvertChildKeys = true; } ctx.CurrentProperty = XamlLanguage.Key; ctx.PushScope(); ctx.CurrentInstance = key; this.Logic_CreatePropertyValueFromValue(ctx); key = ctx.CurrentInstance; ctx.PopScope(); ctx.CurrentProperty = null; } this.Runtime.AddToDictionary(ctx.ParentCollection, ctx.ParentType, value, ctx.CurrentType, key); }
private object Logic_PushAndPopAProvideValueStackFrame(ObjectWriterContext ctx, XamlMember prop, MarkupExtension me, bool useIRME) { XamlMember currentProperty = ctx.CurrentProperty; ctx.CurrentProperty = prop; ctx.PushScope(); ctx.CurrentInstance = me; object obj2 = null; if (useIRME) { this.Logic_AssignProvidedValue(ctx); } else { obj2 = this.Runtime.CallProvideValue(me, ctx.ServiceProviderContext); } ctx.PopScope(); ctx.CurrentProperty = currentProperty; return obj2; }