예제 #1
0
        // Token: 0x06001F5F RID: 8031 RVA: 0x00094AEC File Offset: 0x00092CEC
        internal override void Copy(BamlRecord record)
        {
            base.Copy(record);
            BamlPropertyComplexStartRecord bamlPropertyComplexStartRecord = (BamlPropertyComplexStartRecord)record;

            bamlPropertyComplexStartRecord._attributeId = this._attributeId;
        }
예제 #2
0
        // Read the start of a complex property section.  Determine the property to set
        // with the object that will be constructed from the following records.
        protected virtual void ReadPropertyComplexStartRecord( 
            BamlPropertyComplexStartRecord bamlPropertyRecord)
        { 
            if (null == CurrentContext || 
                !(ReaderFlags.ClrObject == CurrentContext.ContextType ||
                  ReaderFlags.DependencyObject == CurrentContext.ContextType)) 
            {
                ThrowException(SRID.ParserUnexpInBAML, "PropertyComplexStart");
            }
 
            short attributeId = bamlPropertyRecord.AttributeId;
 
            WpfPropertyDefinition propertyDefinition = new WpfPropertyDefinition( 
                                    this,
                                    attributeId, 
                                    ReaderFlags.DependencyObject == CurrentContext.ContextType /*targetIsDependencyObject*/ );

            // Try DependencyProperty optimization.
            if (propertyDefinition.DependencyProperty != null) 
            {
                // For the case of a DependencyProperty, store the BamlAttributeInfo on the 
                // stack, because we may need to know the actual added owner type for the DP 
                // to use in error messages.  This is not available in the DP if there
                // are multiple owners. 
                PushContext(ReaderFlags.PropertyComplexDP, propertyDefinition.AttributeInfo, propertyDefinition.PropertyType, 0);
            }
            else if (propertyDefinition.PropertyInfo != null)
            { 
                // Regular case for clr property
                PushContext(ReaderFlags.PropertyComplexClr, propertyDefinition.PropertyInfo, propertyDefinition.PropertyType, 0); 
            } 
            else if (propertyDefinition.AttachedPropertySetter != null)
            { 
                // Assignable Attached property
                PushContext(ReaderFlags.PropertyComplexClr, propertyDefinition.AttachedPropertySetter, propertyDefinition.PropertyType, 0);
            }
            else if (propertyDefinition.AttachedPropertyGetter != null) 
            {
                // Readonly Attached property 
                PushContext(ReaderFlags.PropertyComplexClr, propertyDefinition.AttachedPropertyGetter, propertyDefinition.PropertyType, 0); 
            }
            else 
            {
                ThrowException(SRID.ParserCantGetDPOrPi, GetPropertyNameFromAttributeId(attributeId));
            }
 
            // Set the name of the property into the context
            CurrentContext.ElementNameOrPropertyName = propertyDefinition.Name; 
        }