GetTypeID() public static method

public static GetTypeID ( Type stageOperationType ) : string
stageOperationType System.Type
return string
示例#1
0
文件: Main.cs 项目: radtek/CatEye
        public static IStageOperationParametersEditor StageOperationParametersEditorFactory(StageOperationParameters sop)
        {
            Type paramType       = sop.GetType();
            Type paramWidgetType = StageOperationIDAttribute.FindTypeByID(
                mStageOperationParametersWidgetTypes,
                StageOperationIDAttribute.GetTypeID(sop.GetType())
                );
            StageOperationParametersWidget pwid = (StageOperationParametersWidget)(
                paramWidgetType.GetConstructor(new Type[] { paramType }).Invoke(new object[] { sop })
                );

            return(pwid);
        }
示例#2
0
文件: Main.cs 项目: radtek/CatEye
        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);
        }