System\Windows\Markup\BamlRecordReader.cs (134)
472CurrentContext.ElementNameOrPropertyName = contextXamlObjectIds.Name;
473CurrentContext.Uid = contextXamlObjectIds.Uid;
474CurrentContext.Key = dictionaryKey;
510CurrentContext.Key = dictionaryKey;
524data = CurrentContext.ObjectData;
525CurrentContext.ObjectData = null;
629CurrentContext.SetFlag(ReaderFlags.InjectedElement);
649if (CurrentContext.CheckFlag(ReaderFlags.InjectedElement))
651CurrentContext.ClearFlag(ReaderFlags.InjectedElement);
729Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType);
811Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType ||
812ReaderFlags.ClrObject == CurrentContext.ContextType ||
813ReaderFlags.PropertyComplexClr == CurrentContext.ContextType ||
814ReaderFlags.PropertyComplexDP == CurrentContext.ContextType);
817if (ReaderFlags.DependencyObject == CurrentContext.ContextType ||
818ReaderFlags.ClrObject == CurrentContext.ContextType ||
819ReaderFlags.PropertyComplexClr == CurrentContext.ContextType ||
820ReaderFlags.PropertyComplexDP == CurrentContext.ContextType)
834if (ReaderFlags.DependencyObject == CurrentContext.ContextType)
1012ReaderContextStackData currentContext = CurrentContext;
1118else if (CurrentContext.CheckFlag(ReaderFlags.IDictionary))
1126CurrentContext.MarkAddedToTree();
1187if (null == CurrentContext ||
1188(ReaderFlags.DependencyObject != CurrentContext.ContextType &&
1189ReaderFlags.ClrObject != CurrentContext.ContextType))
1219Debug.Assert(!CurrentContext.CheckFlag(ReaderFlags.NeedToAddToTree), "Failed to add Element to tree before popping stack");
1221ReaderFlags flags = CurrentContext.ContextFlags;
1231CurrentContext != null)
1233Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexClr );
1234Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexDP );
1236switch (CurrentContext.ContextType)
1240CurrentContext.ObjectData = currentElement;
1286Debug.Assert(CurrentContext.ContextType == ReaderFlags.ConstructorParams);
1383CurrentContext.ContentProperty = contentProperty;
1415if (CurrentContext.CheckFlag(ReaderFlags.SingletonConstructorParam))
1417param = CurrentContext.ObjectData;
1497paramList = (ArrayList)CurrentContext.ObjectData;
1690ResourceDictionary dictionary = GetDictionaryFromContext(CurrentContext, true /*toInsert*/) as ResourceDictionary;
1946if (null == CurrentContext ||
1947(ReaderFlags.DependencyObject != CurrentContext.ContextType &&
1948ReaderFlags.ClrObject != CurrentContext.ContextType))
1991if (CurrentContext != null)
1995if (CurrentContext.ContentProperty != null)
1997dpOrPi = CurrentContext.ContentProperty;
1998parent = CurrentContext.ObjectData;
2000else if ( (CurrentContext.ContextType == ReaderFlags.PropertyComplexClr)
2001|| (CurrentContext.ContextType == ReaderFlags.PropertyComplexDP) )
2003dpOrPi = CurrentContext.ObjectData;
2047if (null == CurrentContext ||
2048!(ReaderFlags.ClrObject == CurrentContext.ContextType ||
2049ReaderFlags.DependencyObject == CurrentContext.ContextType))
2059ReaderFlags.DependencyObject == CurrentContext.ContextType /*targetIsDependencyObject*/ );
2091CurrentContext.ElementNameOrPropertyName = propertyDefinition.Name;
2195if (null == CurrentContext ||
2196(ReaderFlags.DependencyObject != CurrentContext.ContextType &&
2197ReaderFlags.ClrObject != CurrentContext.ContextType))
2286if (null == CurrentContext ||
2287(ReaderFlags.DependencyObject != CurrentContext.ContextType &&
2288ReaderFlags.ClrObject != CurrentContext.ContextType))
2301if (null == CurrentContext ||
2302(ReaderFlags.DependencyObject != CurrentContext.ContextType &&
2303ReaderFlags.ClrObject != CurrentContext.ContextType))
2317if (null == CurrentContext ||
2318(ReaderFlags.DependencyObject != CurrentContext.ContextType &&
2319ReaderFlags.ClrObject != CurrentContext.ContextType))
2438if (null == CurrentContext ||
2439(ReaderFlags.DependencyObject != CurrentContext.ContextType &&
2440ReaderFlags.ClrObject != CurrentContext.ContextType))
2639if (null == CurrentContext ||
2640(ReaderFlags.DependencyObject != CurrentContext.ContextType &&
2641ReaderFlags.ClrObject != CurrentContext.ContextType))
2692if( CurrentContext.CreateUsingTypeConverter )
2940if( CurrentContext != null )
2942CurrentContext.ElementNameOrPropertyName = name;
2999CurrentContext.ElementNameOrPropertyName = holder.AttributeName;
3014InitPropertyCollection(holder, CurrentContext);
3058holder.Collection = CurrentContext.ObjectData;
3060expectedType = CurrentContext.ObjectData.GetType();
3072CurrentContext.ElementNameOrPropertyName = holder.AttributeName;
3079SetCollectionPropertyValue(CurrentContext);
3096CurrentContext.ElementNameOrPropertyName = holder.AttributeName;
3103SetCollectionPropertyValue(CurrentContext);
3299SetKeyOnContext(key, bamlDefAttributeRecord.Value, CurrentContext, ParentContext);
3310if( CurrentContext == null )
3313CurrentContext.Uid = bamlDefAttributeRecord.Value;
3320UIElement element = CurrentContext.ObjectData as UIElement;
3370SetKeyOnContext(keyType, XamlReaderHelper.DefinitionName, CurrentContext, ParentContext);
3425if (null == CurrentContext)
3450switch (CurrentContext.ContextType)
3456if (CurrentContext.CreateUsingTypeConverter)
3458Debug.Assert( CurrentContext.ObjectData == null && CurrentContext.ExpectedType != null,
3462object o = GetObjectFromString(CurrentContext.ExpectedType, bamlTextRecord.Value, converterTypeId);
3465CurrentContext.ObjectData = o;
3466CurrentContext.ExpectedType = null;
3471CurrentContext.ExpectedType.FullName);
3483ThrowException(nameof(SR.ParserCantCreateInstanceType), CurrentContext.ExpectedType.FullName);
3488IAddChild iacParent = GetIAddChildFromContext(CurrentContext);
3493else if (CurrentContext.ContentProperty != null)
3495AddToContentProperty(parent, CurrentContext.ContentProperty, bamlTextRecord.Value);
3511if (null == CurrentContext.ExpectedType)
3514GetPropNameFrom(CurrentContext.ObjectData));
3521BamlAttributeInfoRecord attribInfo = CurrentContext.ObjectData as BamlAttributeInfoRecord;
3544if (null == CurrentContext.ExpectedType)
3547GetPropNameFrom(CurrentContext.ObjectData));
3551object o = GetObjectFromString(CurrentContext.ExpectedType, bamlTextRecord.Value, converterTypeId);
3560CurrentContext.ExpectedType.FullName, bamlTextRecord.Value);
3568BamlCollectionHolder holder = GetCollectionHolderFromContext(CurrentContext, true);
3582BamlCollectionHolder holder = GetCollectionHolderFromContext(CurrentContext, true);
3643Debug.Assert(null != CurrentContext &&
3644ReaderFlags.PropertyComplexDP == CurrentContext.ContextType &&
3645null != CurrentContext.ExpectedType && null != ParentContext);
3751CurrentContext.ExpectedType = null;
3848Debug.Assert(null != CurrentContext &&
3849ReaderFlags.PropertyComplexClr == CurrentContext.ContextType &&
3850null != CurrentContext.ExpectedType);
3890CurrentContext.ExpectedType = null;
3897Debug.Assert(null != CurrentContext &&
3898ReaderFlags.ConstructorParams == CurrentContext.ContextType);
3908if (CurrentContext.ObjectData == null)
3910CurrentContext.ObjectData = o;
3911CurrentContext.SetFlag(ReaderFlags.SingletonConstructorParam);
3913else if (CurrentContext.CheckFlag(ReaderFlags.SingletonConstructorParam))
3916paramList.Add(CurrentContext.ObjectData);
3918CurrentContext.ObjectData = paramList;
3919CurrentContext.ClearFlag(ReaderFlags.SingletonConstructorParam);
3923ArrayList paramList = (ArrayList) CurrentContext.ObjectData;
3935DependencyObject e = CurrentContext.ObjectData as DependencyObject;
4274return GetObjectDataFromContext(CurrentContext);
4447if (CurrentContext == null)
4556CurrentContext.ObjectData = element;
4584ReaderContextStackData currentContext = CurrentContext;
4839CurrentContext.ObjectData = element;
4862ReaderContextStackData currentContext = CurrentContext;