Esempio n. 1
0
		protected object[] InstantiateMixins(MixinDefinitionCollection mixins)
		{
			object[] instances = new object[mixins.Count];

			for (int i = 0; i < mixins.Count; i++)
			{
				MixinDefinition definition = mixins[i];
				Type mixinType = definition.TypeReference.ResolvedType;

				try
				{
					instances[i] = Activator.CreateInstance(mixinType);
				}
				catch (Exception e)
				{
					throw new ProxyFactoryException("Could not instantiate mixin " + mixinType.FullName, e);
				}
			}

			return instances;
		}
Esempio n. 2
0
		public void AddRange( MixinDefinitionCollection mixins )
		{
			InnerList.AddRange( mixins );
		}
Esempio n. 3
0
		private void CheckIncludes( MixinDefinitionCollection includes )
		{
			IDictionary names = new Hashtable();

			foreach( MixinDefinition type in includes )
			{
				AssertNotNull( type, type.TypeReference.ToString(), "Type name must be specified as as 'Typename in AssemblyName' or as a reference to a global type declared" );

				if (type.TypeReference.TargetType == TargetTypeEnum.Link)
				{
					AssertKeyExists( _globalMixins, type, type.TypeReference.LinkRef, "The referenced mixin is not declared in the global mixins section" );
				}

				AssertUnique( names, type, type.TypeReference.ToString(), "You shouldn't include the same mixin more than one time" );
			}
		}
Esempio n. 4
0
 public void AddRange(MixinDefinitionCollection mixins)
 {
     InnerList.AddRange(mixins);
 }