示例#1
0
 private void AddParameter(Operation aMethod, ObjectInfo aParam, PdOOM.BasePackage aPckg)
 {
     Parameter aPrm = (Parameter)aMethod.CreateObject(0x1811206d, "", -1, true);
     string str = "I";    // aParam.IsOut ? "O" : "I";
     ////Type parameterType = aParam.Type;
     ////if (parameterType.IsGenericType && !parameterType.IsGenericTypeDefinition)
     ////{
     ////    parameterType = parameterType.GetGenericTypeDefinition();
     ////}
     ////if (parameterType.IsByRef)
     ////{
     ////    if (str == "I")
     ////    {
     ////        str = "IO";
     ////    }
     ////    parameterType = parameterType.GetElementType();
     ////}
     ////if (parameterType.IsArray)
     ////{
     ////    aPrm.Array = true;
     ////    parameterType = parameterType.GetElementType();
     ////}
     ////this.ProcessType(parameterType, false);
     ////TypeMapping aType = TypeMapping.Retrieve(aParam.Type);
     ////if (aType.HasClassifier())
     ////{
     ////    PdOOM.BaseObject obj2 = ProperRef.Link(NamespaceMapping.Retrieve(aPckg), aParam.Type);
     ////    aPrm.UseQualifiedDataType = false;
     ////    aPrm.DataTypeObject = obj2;
     ////}
     ////else
     {
         aPrm.DataType = aParam.Name;
     }
     aPrm.ParameterType = str;
     aPrm.Name = aPrm.Code = aParam.Name;
     CustomHandlerParam param = new CustomHandlerParam(aParam, aPrm);
     param.Convert();
     if (param.Params)
     {
         aPrm.SetExtendedAttribute("C#.params", "true");
     }
 }
示例#2
0
        private void AddParameter(Operation aMethod, ObjectInfo aParam, PdOOM.BasePackage aPckg)
        {
            Parameter aPrm = (Parameter)aMethod.CreateObject(0x1811206d, "", -1, true);
            string str = "I";    // aParam.IsOut ? "O" : "I";
            ////Type parameterType = aParam.Type;
            ////if (parameterType.IsGenericType && !parameterType.IsGenericTypeDefinition)
            ////{
            ////    parameterType = parameterType.GetGenericTypeDefinition();
            ////}
            if (aParam.IsConst)
            {
                aPrm.SetExtendedAttribute("C++.const", "true");
            }
            if (aParam.IsByRef)
            {
                aPrm.SetExtendedAttribute("C++.ref", "true");
            }
            if (!aParam.IsConst && (aParam.IsByRef || aParam.IsPointer))
            {
                str = "IO";
            }
            if (aParam.IsArray)
            {
                aPrm.Array = true;
            }
            aPrm.SetExtendedAttribute("C++.init", aParam.Default);

            TypeInfo tiField = new TypeInfo();
            tiField.Code = tiField.Name = aParam.Type;
            tiField.IsClass = true;
            tiField.Comment = ((PdOOM.NamedObject)aMethod.Parent).Comment;
            this.AddClassifier(tiField, false);
            bool bCreate = true;
            TypeMapping aType = TypeMapping.Retrieve(tiField, ref bCreate);
            if (aType.HasClassifier())
            {
                PdOOM.BaseObject obj2 = ProperRef.Link(NamespaceMapping.Retrieve(aPckg), aType);
                aPrm.UseQualifiedDataType = false;
                aPrm.DataTypeObject = obj2;
            }
            aPrm.ParameterType = str;
            aPrm.DataType = aParam.FullType;
            aPrm.Name = aPrm.Code = aParam.Name;
            CustomHandlerParam param = new CustomHandlerParam(aParam, aPrm);
            param.Convert();
            if (param.Params)
            {
                aPrm.SetExtendedAttribute("C++.params", "true");
            }
        }