本文整理匯總了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");
}
}