public void AddInstruction(FLInstructionCreator creator) { if (creator == null) { throw new FLInstructionCreatorIsNullException("Trying to add an Instruction container that is null"); } creators.Add(creator); }
public void AddInstructionCreatorsFromAssembly(Assembly asm) { Type[] ts = asm.GetExportedTypes(); Type target = typeof(FLInstructionCreator); for (int i = 0; i < ts.Length; i++) { if (target != ts[i] && target.IsAssignableFrom(ts[i])) { FLInstructionCreator creator = (FLInstructionCreator)Activator.CreateInstance(ts[i]); AddInstruction(creator); } } }