internal RadPropertyValue(RadObject owner, RadProperty property) { this.owner = owner; this.property = property; bool found; this.metadata = property.GetMetadata(this.owner.RadObjectType, out found); if (!found) { RadObjectType radObjectType = RadObjectType.FromSystemType(property.OwnerType); this.metadata = property.GetMetadata(radObjectType); } this.valueSource = ValueSource.Unknown; }
internal RadPropertyValue(RadObject owner, RadProperty property) { this.owner = owner; this.property = property; //check which metadata to cache //there are two options: //1. Property is declared by owner's class hierarchy. // In this case we retrieve the metadata for the owner itself. //2. Property is NOT declared by owner's class hierarchy. // In this case if we request metadata for our owner, we will get the default one, // so we need to reflect this by getting the metadata for the declaring type. bool metadataFound; this.metadata = property.GetMetadata(this.owner.RadObjectType, out metadataFound); if (!metadataFound) { RadObjectType declaringType = RadObjectType.FromSystemType(property.OwnerType); this.metadata = property.GetMetadata(declaringType); } this.valueSource = ValueSource.Unknown; }