Prebuild.Core.Kernel.CacheTargets C# (CSharp) Method

CacheTargets() private method

private CacheTargets ( Assembly assm ) : void
assm System.Reflection.Assembly
return void
		private void CacheTargets(Assembly assm)
		{
			foreach(Type t in assm.GetTypes())
			{
				TargetAttribute ta = (TargetAttribute)Helper.CheckType(t, typeof(TargetAttribute), typeof(ITarget));

				if(ta == null)
					continue;
				
				if (t.IsAbstract)
					continue;
				
				ITarget target = (ITarget)assm.CreateInstance(t.FullName);
				if (target == null)
				{
					throw new MissingMethodException("Could not create ITarget instance");
				}

				m_Targets[ta.Name] = target;
			}
		}