Example #1
0
        public static StageOperation StageOperationFactory(StageOperationParameters parameters)
        {
            string id  = StageOperationIDAttribute.GetTypeID(parameters.GetType());
            Type   sot = StageOperationIDAttribute.FindTypeByID(mStageOperationTypes, id);

            if (sot == null)
            {
                throw new IncorrectNodeValueException("Can't find StageOperation type for the ID (" + id + ")");
            }

            // Creating stage operation
            StageOperation so = (StageOperation)sot.GetConstructor(
                new Type[] { typeof(StageOperationParameters) }
                ).Invoke(new object[] { parameters });

            return(so);
        }