Exemple #1
0
        public static bool IsValidParameter(Type type, ICustomAttributeProvider attributeProvider, bool allowReferences)
        {
            foreach (MarshalAsAttribute attribute in ServiceReflector.GetCustomAttributes(attributeProvider, typeof(MarshalAsAttribute), true))
            {
                switch (attribute.Value)
                {
                case UnmanagedType.IDispatch:
                case UnmanagedType.Interface:
                case UnmanagedType.IUnknown:
                    return(allowReferences);
                }
            }
            XsdDataContractExporter exporter = new XsdDataContractExporter();

            if (!exporter.CanExport(type))
            {
                return(false);
            }
            return(true);
        }
 private bool NoCoClassAttributeOnType(ICustomAttributeProvider attrProvider)
 {
     return(ServiceReflector.GetCustomAttributes(attrProvider, typeof(CoClassAttribute), false).Length == 0);
 }