예제 #1
0
        private static void InitializeArgumentType(ISequenceManager sequenceManager,
                                                   DescriptionDataTable descriptionCollection, IArgumentDescription argumentDescription)
        {
            ArgumentDescription argDescription = (ArgumentDescription)argumentDescription;

            // 如果类型描述类为空且TypeData非空,则说明该argDescription已经被修改过,无需再执行处理
            if (argDescription.TypeDescription == null)
            {
                if (null == argDescription.Type)
                {
                    I18N i18N = I18N.GetInstance(Constants.I18nName);
                    throw new TestflowRuntimeException(ModuleErrorCode.TypeCannotLoad,
                                                       i18N.GetFStr("InvalidArgType", argDescription.Name));
                }
                return;
            }
            string fullName = GetFullName(argDescription.TypeDescription);

            if (descriptionCollection.ContainsType(fullName))
            {
                argDescription.Type = descriptionCollection.GetTypeData(fullName);
            }
            else
            {
                ITypeData typeData = sequenceManager.CreateTypeData(argDescription.TypeDescription);
                descriptionCollection.AddTypeData(fullName, typeData);
                argDescription.Type = typeData;
            }
            argDescription.TypeDescription = null;
        }
예제 #2
0
        public static ITypeData GetTypeDataByDescription(ISequenceManager sequenceManager,
                                                         DescriptionDataTable descriptionCollection, ITypeDescription typeDescription)
        {
            string    classFullName = GetFullName(typeDescription);
            ITypeData classType;

            if (!descriptionCollection.ContainsType(classFullName))
            {
                classType = sequenceManager.CreateTypeData(typeDescription);
                descriptionCollection.AddTypeData(classFullName, classType);
            }
            else
            {
                classType = descriptionCollection.GetTypeData(classFullName);
            }
            return(classType);
        }
예제 #3
0
        public ITypeData GetPropertyType(ITypeData typeData, string property, DescriptionDataTable descriptionCollection)
        {
            ITypeDescription propertyTypeDescription = _loader.GetPropertyType(typeData.AssemblyName,
                                                                               ModuleUtils.GetFullName(typeData),
                                                                               property);

            if (null == propertyTypeDescription)
            {
                CheckPropertyDescription(typeData, property);
            }
            string    fullName = ModuleUtils.GetFullName(propertyTypeDescription);
            ITypeData propertyType;

            if (descriptionCollection.ContainsType(fullName))
            {
                propertyType = descriptionCollection.GetTypeData(fullName);
            }
            else
            {
                propertyType = _sequenceManager.CreateTypeData(propertyTypeDescription);
                descriptionCollection.AddTypeData(fullName, propertyType);
            }
            return(propertyType);
        }