コード例 #1
0
        public void AddInstruction(FLInstructionCreator creator)
        {
            if (creator == null)
            {
                throw new FLInstructionCreatorIsNullException("Trying to add an Instruction container that is null");
            }

            creators.Add(creator);
        }
コード例 #2
0
        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);
                }
            }
        }