Enyim.Caching.Configuration.ConfigurationHelper.CheckForInterface C# (CSharp) Method

CheckForInterface() public static method

public static CheckForInterface ( Type type, Type interfaceType ) : void
type System.Type
interfaceType System.Type
return void
		public static void CheckForInterface(Type type, Type interfaceType)
		{
			if (type == null || interfaceType == null) return;

			if (Array.IndexOf<Type>(type.GetInterfaces(), interfaceType) == -1)
				throw new System.Configuration.ConfigurationErrorsException("The type " + type.AssemblyQualifiedName + " must implement " + interfaceType.AssemblyQualifiedName);
		}

Usage Example

Beispiel #1
0
 public override void Validate(object value)
 {
     if (value != null)
     {
         ConfigurationHelper.CheckForInterface((Type)value, this.interfaceType);
     }
 }
All Usage Examples Of Enyim.Caching.Configuration.ConfigurationHelper::CheckForInterface