Esempio n. 1
0
 public void Fail_Type()
 {
     ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("arg", typeof(object), typeof(string));
 }
 public SearchAvailableObjectsServiceTypeAttribute(Type type)
 {
     ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("type", type, typeof(ISearchAvailableObjectsService));
     _type = type;
 }
Esempio n. 3
0
 public void Fail_Null()
 {
     ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("arg", null, typeof(string));
 }
        /// <summary>
        /// Creates a new instance of the <see cref="SecurityContext"/> type initialized for a stateless scenario, i.e. before an actual instance of the
        /// specified <paramref name="type"/> is available to supply state information. One such occurance would be the creation of a new instance of
        /// specified <paramref name="type"/>.
        /// </summary>
        /// <param name="type">
        /// The <see cref="Type"/> of the securable class for which this <see cref="SecurityContext"/> is created.
        /// Must implement the <see cref="ISecurableObject"/> interface and not be <see langword="null" />.
        /// </param>
        /// <returns>A new instance of the <see cref="SecurityContext"/> type.</returns>
        public static SecurityContext CreateStateless(Type type)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("type", type, typeof(ISecurableObject));

            return(new SecurityContext(type, null, null, null, true, new Dictionary <string, EnumWrapper>(), new EnumWrapper[0]));
        }
Esempio n. 5
0
        protected IResourceManager GetResourceManager(Type resourceEnumType)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("resourceEnumType", resourceEnumType, typeof(Enum));

            return(ResourceManagerSet.Create(GlobalizationService.GetResourceManager(TypeAdapter.Create(resourceEnumType)), GetResourceManager()));
        }
Esempio n. 6
0
        public Tuple <Type[], Type> GetSignature(Type delegateType)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("delegateType", delegateType, typeof(Delegate));

            return(DelegateFactory.GetSignature(delegateType));
        }
        protected virtual object GetCacheKey(Type delegateType)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("delegateType", delegateType, typeof(Delegate));

            return(new Tuple <Type, Type> (_definingType, delegateType));
        }
Esempio n. 8
0
 public DefaultValueServiceTypeAttribute(Type type)
 {
     ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("type", type, typeof(IDefaultValueService));
     _type = type;
 }
Esempio n. 9
0
 public GetObjectServiceTypeAttribute(Type type)
 {
     ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("type", type, typeof(IGetObjectService));
     _type = type;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeAssemblyLoaderFilter"/> class.
 /// </summary>
 /// <param name="attributeType">The attribute type to filter assemblies with.</param>
 public AttributeAssemblyLoaderFilter(Type attributeType)
 {
     ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("attributeType", attributeType, typeof(Attribute));
     _attributeType = attributeType;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DisableExtensibleEnumValuesAttribute"/> class with a custom filter type.
 /// </summary>
 /// <param name="filterType">The type of the filter to use, must implement <see cref="IEnumerationValueFilter"/>.</param>
 public DisableExtensibleEnumValuesAttribute(Type filterType)
 {
     ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("filterType", filterType, typeof(IEnumerationValueFilter));
     _filter = (IEnumerationValueFilter)Activator.CreateInstance(filterType);
 }
Esempio n. 12
0
        public Delegate GetFastInvoker(Type delegateType)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("delegateType", delegateType, typeof(Delegate));

            return(DynamicMethodBasedMethodCallerFactory.CreateMethodCallerDelegate(_methodInfo, delegateType));
        }
Esempio n. 13
0
        // types

        // static members

        // member fields

        // construction and disposing

        public WxeDemandCreatePermissionAttribute(Type securableClass)
            : base(MethodType.Constructor)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("securableClass", securableClass, typeof(ISecurableObject));
            SecurableClass = securableClass;
        }
        public static bool IsTypeIgnoredForMappingConfiguration(Type type)
        {
            ArgumentUtility.CheckNotNullAndTypeIsAssignableFrom("type", type, typeof(DomainObject));

            return(AttributeUtility.IsDefined <IgnoreForMappingConfigurationAttribute> (type, false));
        }