本文整理汇总了C#中System.Operation.CreateObject方法的典型用法代码示例。如果您正苦于以下问题:C# Operation.CreateObject方法的具体用法?C# Operation.CreateObject怎么用?C# Operation.CreateObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Operation
的用法示例。
在下文中一共展示了Operation.CreateObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddParameter
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: AddParameter
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");
}
}