Beispiel #1
0
 private void SetupOverrideMetadata(Type forType, RadPropertyMetadata typeMetadata, out RadObjectType dType, out RadPropertyMetadata baseMetadata)
 {
     if (forType == null)
     {
         throw new ArgumentNullException("forType");
     }
     if (typeMetadata == null)
     {
         throw new ArgumentNullException("typeMetadata");
     }
     if (typeMetadata.Sealed)
     {
         throw new ArgumentException(string.Format("TypeMetadataAlreadyInUse", new object[0]));
     }
     if (!typeof(RadObject).IsAssignableFrom(forType))
     {
         object[] objArray1 = new object[] { forType.Name };
         throw new ArgumentException(string.Format("TypeMustBeRadObjectDerived {0}", objArray1));
     }
     if (typeMetadata.IsDefaultValueModified)
     {
         RadProperty.ValidateMetadataDefaultValue(typeMetadata, this.PropertyType, this.ValidateValueCallback);
     }
     dType        = RadObjectType.FromSystemType(forType);
     baseMetadata = this.GetMetadata(dType.BaseType);
     if (!baseMetadata.GetType().IsAssignableFrom(typeMetadata.GetType()))
     {
         throw new ArgumentException(string.Format("OverridingMetadataDoesNotMatchBaseMetadataType", new object[0]));
     }
 }