本文整理汇总了C#中Mono.Cecil.TypeSystem类的典型用法代码示例。如果您正苦于以下问题:C# TypeSystem类的具体用法?C# TypeSystem怎么用?C# TypeSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeSystem类属于Mono.Cecil命名空间,在下文中一共展示了TypeSystem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: NegateBinaryExpression
private static Expression NegateBinaryExpression(Expression expression, TypeSystem typeSystem)
{
BinaryExpression binary = (BinaryExpression)expression;
if (IsLogicalOperator(binary.Operator))
{
BinaryOperator @operator = binary.Operator == BinaryOperator.LogicalAnd ?
BinaryOperator.LogicalOr
: BinaryOperator.LogicalAnd;
binary.Left = Negate(binary.Left, typeSystem);
binary.Operator = @operator;
binary.Right = Negate(binary.Right, typeSystem);
return binary;
}
BinaryOperator op;
if (TryGetInverseOperator(binary.Operator, out op))
{
binary.Operator = op;
}
return binary;
}
开发者ID:Feng2012,项目名称:JustDecompileEngine,代码行数:26,代码来源:Negator.cs
示例2: NegateConditionExpression
private static Expression NegateConditionExpression(Expression expression, TypeSystem typeSystem)
{
ConditionExpression condition = (ConditionExpression)expression;
condition.Then = Negate(condition.Then, typeSystem);
condition.Else = Negate(condition.Else, typeSystem);
return condition;
}
开发者ID:Feng2012,项目名称:JustDecompileEngine,代码行数:7,代码来源:Negator.cs
示例3: Process
public BlockStatement Process(DecompilationContext context, BlockStatement body)
{
this.context = context;
this.typeSystem = context.MethodContext.Method.Module.TypeSystem;
InsertTopLevelParameterAssignments(body);
return body;
}
开发者ID:Feng2012,项目名称:JustDecompileEngine,代码行数:7,代码来源:AssignOutParametersStep.cs
示例4: FilterInvocationResult
public static JSExpression FilterInvocationResult(
MethodReference methodReference, MethodInfo method,
JSExpression result,
ITypeInfoSource typeInfo, TypeSystem typeSystem
)
{
if (method == null)
return result;
var resultType = result.GetActualType(typeSystem);
var resultIsPackedArray = PackedArrayUtil.IsPackedArrayType(resultType);
var returnValueAttribute = method.Metadata.GetAttribute("JSIL.Meta.JSPackedArrayReturnValueAttribute");
if (returnValueAttribute != null) {
if (TypeUtil.IsOpenType(resultType)) {
// FIXME: We need to restrict substitution to when the result type is a generic parameter owned by the invocation...
resultType = JSExpression.SubstituteTypeArgs(typeInfo, resultType, methodReference);
}
if (!resultIsPackedArray)
return JSChangeTypeExpression.New(result, PackedArrayUtil.MakePackedArrayType(resultType, returnValueAttribute.Entries.First().Type), typeSystem);
}
return result;
}
开发者ID:kboga,项目名称:JSIL,代码行数:25,代码来源:PackedStructArray.cs
示例5: CheckInvocationSafety
public static void CheckInvocationSafety(MethodInfo method, JSExpression[] argumentValues, TypeSystem typeSystem)
{
if (method.Metadata.HasAttribute("JSIL.Meta.JSAllowPackedArrayArgumentsAttribute"))
return;
TypeReference temp;
string[] argumentNames = GetPackedArrayArgumentNames(method, out temp);
for (var i = 0; i < method.Parameters.Length; i++) {
if (i >= argumentValues.Length)
continue;
var valueType = argumentValues[i].GetActualType(typeSystem);
if (!IsPackedArrayType(valueType)) {
if ((argumentNames != null) && argumentNames.Contains(method.Parameters[i].Name))
throw new ArgumentException(
"Invalid attempt to pass a normal array as parameter '" + method.Parameters[i].Name + "' to method '" + method.Name + "'. " +
"This parameter must be a packed array."
);
} else {
if ((argumentNames == null) || !argumentNames.Contains(method.Parameters[i].Name))
throw new ArgumentException(
"Invalid attempt to pass a packed array as parameter '" + method.Parameters[i].Name + "' to method '" + method.Name + "'. " +
"If this is intentional, annotate the method with the JSPackedArrayArguments attribute."
);
}
}
}
开发者ID:jean80it,项目名称:JSIL,代码行数:29,代码来源:PackedStructArray.cs
示例6: Process
public BlockStatement Process(DecompilationContext context, BlockStatement body)
{
this.typeSystem = context.MethodContext.Method.Module.TypeSystem;
this.decompiledMethodReturnType = context.MethodContext.Method.ReturnType;
Visit(body);
return body;
}
开发者ID:besturn,项目名称:JustDecompileEngine,代码行数:7,代码来源:CastEnumsToIntegersStep.cs
示例7: GetTypeCode
public static TypeCode GetTypeCode(TypeSystem typeSystem, TypeReference type)
{
if (type == typeSystem.Boolean)
return TypeCode.Boolean;
else if (type == typeSystem.Byte)
return TypeCode.Byte;
else if (type == typeSystem.Char)
return TypeCode.Char;
else if (type == typeSystem.Double)
return TypeCode.Double;
else if (type == typeSystem.Int16)
return TypeCode.Int16;
else if (type == typeSystem.Int32)
return TypeCode.Int32;
else if (type == typeSystem.Int64)
return TypeCode.Int64;
else if (type == typeSystem.Single)
return TypeCode.Single;
else if (type == typeSystem.Double)
return TypeCode.Double;
else if (type == typeSystem.SByte)
return TypeCode.SByte;
else if (type == typeSystem.UInt16)
return TypeCode.UInt16;
else if (type == typeSystem.UInt32)
return TypeCode.UInt32;
else if (type == typeSystem.UInt64)
return TypeCode.UInt64;
else if (type == typeSystem.String)
return TypeCode.String;
else
return TypeCode.Object;
}
开发者ID:petr-k,项目名称:ILSpy,代码行数:33,代码来源:TypeAnalysis.cs
示例8: PropertyWeaver
public PropertyWeaver(ModuleWeaver moduleWeaver, PropertyData propertyData, TypeNode typeNode, TypeSystem typeSystem )
{
this.moduleWeaver = moduleWeaver;
this.propertyData = propertyData;
this.typeNode = typeNode;
this.typeSystem = typeSystem;
}
开发者ID:jbruening,项目名称:PropertyChanged,代码行数:7,代码来源:PropertyWeaver.cs
示例9: ExtractOffsetFromPointerExpression
public static bool ExtractOffsetFromPointerExpression(JSExpression pointer, TypeSystem typeSystem, out JSExpression newPointer, out JSExpression offset)
{
offset = null;
newPointer = pointer;
var boe = pointer as JSBinaryOperatorExpression;
if (boe == null)
return false;
var leftType = boe.Left.GetActualType(typeSystem);
var rightType = boe.Right.GetActualType(typeSystem);
var resultType = boe.GetActualType(typeSystem);
if (!resultType.IsPointer)
return false;
if (!TypeUtil.IsIntegral(rightType))
return false;
if (boe.Operator != JSOperator.Add)
return false;
newPointer = boe.Left;
offset = boe.Right;
return true;
}
开发者ID:rangerofthewest,项目名称:JSIL,代码行数:26,代码来源:UnsafeCodeTransforms.cs
示例10: DeconstructMutationAssignment
public static JSExpression DeconstructMutationAssignment (
JSNode parentNode, JSBinaryOperatorExpression boe, TypeSystem typeSystem, TypeReference intermediateType
) {
var assignmentOperator = boe.Operator as JSAssignmentOperator;
if (assignmentOperator == null)
return null;
JSBinaryOperator replacementOperator;
if (!IntroduceEnumCasts.ReverseCompoundAssignments.TryGetValue(assignmentOperator, out replacementOperator))
return null;
var leftType = boe.Left.GetActualType(typeSystem);
var newBoe = new JSBinaryOperatorExpression(
JSOperator.Assignment, MakeLhsForAssignment(boe.Left),
new JSBinaryOperatorExpression(
replacementOperator, boe.Left, boe.Right, intermediateType
),
leftType
);
var result = ConvertReadExpressionToWriteExpression(newBoe, typeSystem);
if (parentNode is JSExpressionStatement) {
return result;
} else {
var comma = new JSCommaExpression(
newBoe, boe.Left
);
return comma;
}
}
开发者ID:TukekeSoft,项目名称:JSIL,代码行数:31,代码来源:DecomposeMutationOperators.cs
示例11: ExpandCastExpressions
public ExpandCastExpressions (TypeSystem typeSystem, JSSpecialIdentifiers js, JSILIdentifier jsil, ITypeInfoSource typeInfo, MethodTypeFactory methodTypeFactory) {
TypeSystem = typeSystem;
JS = js;
JSIL = jsil;
TypeInfo = typeInfo;
MethodTypeFactory = methodTypeFactory;
}
开发者ID:Don191,项目名称:JSIL,代码行数:7,代码来源:ExpandCastExpressions.cs
示例12: Process
public BlockStatement Process(DecompilationContext context, BlockStatement block)
{
this.typeSystem = context.MethodContext.Method.Module.TypeSystem;
this.context = context;
BlockStatement newBlock = (BlockStatement)VisitBlockStatement(block);
return newBlock;
}
开发者ID:besturn,项目名称:JustDecompileEngine,代码行数:7,代码来源:RenameEnumValues.cs
示例13: Negate
/// <summary>
/// Swaps the then and else and negates the condition
/// </summary>
public void Negate(TypeSystem typeSystem)
{
this.Condition.Negate(typeSystem);
BlockLogicalConstruct temp = this.Then;
this.Then = this.Else;
this.Else = temp;
}
开发者ID:Feng2012,项目名称:JustDecompileEngine,代码行数:10,代码来源:IfLogicalConstruct.cs
示例14: EmulateStructAssignment
public EmulateStructAssignment(TypeSystem typeSystem, IFunctionSource functionSource, CLRSpecialIdentifiers clr, bool optimizeCopies)
{
TypeSystem = typeSystem;
FunctionSource = functionSource;
CLR = clr;
OptimizeCopies = optimizeCopies;
}
开发者ID:kyle1235,项目名称:JSIL,代码行数:7,代码来源:EmulateStructAssignment.cs
示例15: Process
public void Process()
{
typeSystem = TypeProcessor.ModuleWeaver.ModuleDefinition.TypeSystem;
CreateDisposeBoolMethod();
InjectIntoDispose();
TypeProcessor.AddFinalizer(DisposeBoolMethod);
}
开发者ID:petarvucetin,项目名称:Janitor,代码行数:7,代码来源:ManagedAndUnmanagedProcessor.cs
示例16: ExpandCastExpressions
public ExpandCastExpressions(TypeSystem typeSystem, JSSpecialIdentifiers js, JSILIdentifier jsil, ITypeInfoSource typeInfo)
{
TypeSystem = typeSystem;
JS = js;
JSIL = jsil;
TypeInfo = typeInfo;
}
开发者ID:shreedharcva,项目名称:JSIL,代码行数:7,代码来源:ExpandCastExpressions.cs
示例17: BinaryExpression
public BinaryExpression(BinaryOperator @operator, Expression left, Expression right,
TypeReference expressionType, TypeSystem typeSystem, IEnumerable<Instruction> instructions, bool isOverridenOperation = false)
: this(@operator, left, right, DetermineIsChecked(instructions), instructions, isOverridenOperation)
{
this.ExpressionType = expressionType;
this.typeSystem = typeSystem;
}
开发者ID:saravanaram,项目名称:JustDecompileEngine,代码行数:7,代码来源:BinaryExpression.cs
示例18: FixupThisArgument
protected JSExpression FixupThisArgument(JSExpression thisArgument, TypeSystem typeSystem)
{
var expectedType = thisArgument.GetActualType(typeSystem);
if (expectedType.FullName == "System.Type")
return new JSPublicInterfaceOfExpression(thisArgument);
return thisArgument;
}
开发者ID:shreedharcva,项目名称:JSIL,代码行数:8,代码来源:DynamicCallSites.cs
示例19: SynthesizePropertySetterReturnValues
public SynthesizePropertySetterReturnValues (
TypeSystem typeSystem, ITypeInfoSource typeInfo,
IFunctionSource functionSource
) {
TypeSystem = typeSystem;
TypeInfo = typeInfo;
FunctionSource = functionSource;
}
开发者ID:cbsistem,项目名称:JSIL,代码行数:8,代码来源:SynthesizePropertySetterReturnValues.cs
示例20: EmulateStructAssignment
public EmulateStructAssignment(QualifiedMemberIdentifier member, IFunctionSource functionSource, TypeSystem typeSystem, TypeInfoProvider typeInfo, CLRSpecialIdentifiers clr, bool optimizeCopies)
: base(member, functionSource)
{
TypeSystem = typeSystem;
TypeInfo = typeInfo;
CLR = clr;
OptimizeCopies = optimizeCopies;
}
开发者ID:simon-heinen,项目名称:JSIL,代码行数:8,代码来源:EmulateStructAssignment.cs
注:本文中的Mono.Cecil.TypeSystem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论