예제 #1
0
 private bool RequiresMemberAccessForCreate(SecurityException securityException)
 {
     if (!DataContract.IsTypeVisible(base.UnderlyingType))
     {
         if (securityException != null)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityException(System.Runtime.Serialization.SR.GetString("PartialTrustIXmlSerializableTypeNotPublic", new object[] { DataContract.GetClrTypeFullName(base.UnderlyingType) }), securityException));
         }
         return(true);
     }
     if (!DataContract.ConstructorRequiresMemberAccess(this.GetConstructor()))
     {
         return(false);
     }
     if (securityException != null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityException(System.Runtime.Serialization.SR.GetString("PartialTrustIXmlSerialzableNoPublicConstructor", new object[] { DataContract.GetClrTypeFullName(base.UnderlyingType) }), securityException));
     }
     return(true);
 }