本文整理汇总了C#中System.Reflection.Emit.TypeBuilder.GetField方法的典型用法代码示例。如果您正苦于以下问题:C# TypeBuilder.GetField方法的具体用法?C# TypeBuilder.GetField怎么用?C# TypeBuilder.GetField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.TypeBuilder
的用法示例。
在下文中一共展示了TypeBuilder.GetField方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateMSIL
public override void GenerateMSIL(ILGenerator ilGenerator, TypeBuilder typeBuilder)
{
//a[i] = value
FieldInfo fb = typeBuilder.GetField(RecordExpression.ExpressionID);
ilGenerator.Emit(OpCodes.Ldsfld, fb);
PropertyExpression.GenerateMSIL(ilGenerator, typeBuilder);
RightHandExpression.GenerateMSIL(ilGenerator, typeBuilder);
ilGenerator.Emit(OpCodes.Stelem_I4);
}
示例2: GenerateMSIL
public override void GenerateMSIL(ILGenerator ilGenerator, TypeBuilder typeBuilder)
{
FieldInfo fb = typeBuilder.GetField(Variable.ExpressionID);
ilGenerator.Emit(OpCodes.Ldsfld, fb);
foreach (var argument in Arguments)
{
argument.GenerateMSIL(ilGenerator, typeBuilder);
}
Type type = fb.GetType();
ilGenerator.Emit(OpCodes.Callvirt, type.GetMethod(MethodName));
}
示例3: GenerateMSIL
public override void GenerateMSIL(ILGenerator ilGenerator, TypeBuilder typeBuilder)
{
RightHandSide.GenerateMSIL(ilGenerator, typeBuilder);
FieldInfo fb = typeBuilder.GetField(LeftHandSide);
ilGenerator.Emit(OpCodes.Stsfld, fb);
}
示例4: GenerateMSIL
public override void GenerateMSIL(ILGenerator ilGenerator, TypeBuilder typeBuilder)
{
FieldInfo fb = typeBuilder.GetField(ExpressionID);
ilGenerator.Emit(OpCodes.Ldsfld, fb);
}
示例5: GenerateMSIL
//.........这里部分代码省略.........
// CUDD.Ref(valueBddEncoding.ExpressionDDs[j], expressionDD);
// CUDDNode assignmentDD = CUDD.Function.Equal(valueBddEncoding.ExpressionDDs[j], expressionDD);
// guardDD = CUDD.Function.And(guardDD, assignmentDD);
// result.AddNodeToGuard(guardDD);
// }
// CUDD.Deref(expressionDD);
// }
// //remove unused expression
// variableBddEncoding.DeRef();
// valueBddEncoding.DeRef();
// return result;
//}
///// <summary>
///// [ REFS: 'result', DEREFS: 'resultBefore' ]
///// </summary>
//public override ExpressionBDDEncoding TranslateStatementToBDD(ExpressionBDDEncoding resultBefore, Model model)
//{
// ExpressionBDDEncoding newUpdate = this.TranslateExpressionToBDD(model);
// ExpressionBDDEncoding tempResult = new ExpressionBDDEncoding();
// List<List<int>> updatedVariablesInNewUpdate = new List<List<int>>();
// for (int index = 0; index < newUpdate.Count(); index++)
// {
// updatedVariablesInNewUpdate.Add(model.GetColSupportedVars(newUpdate.GuardDDs[index]));
// }
// List<List<int>> usedVariableInNewUpdate = new List<List<int>>();
// for (int index = 0; index < newUpdate.Count(); index++)
// {
// usedVariableInNewUpdate.Add(model.GetRowSupportedVars(newUpdate.GuardDDs[index]));
// }
// List<List<int>> updatedVariablesBefore = new List<List<int>>();
// for (int index = 0; index < resultBefore.Count(); index++)
// {
// updatedVariablesBefore.Add(model.GetColSupportedVars(resultBefore.GuardDDs[index]));
// }
// for (int j1 = 0; j1 < resultBefore.Count(); j1++)
// {
// for (int j2 = 0; j2 < newUpdate.Count(); j2++)
// {
// //a variable is already updated, now is updated again and it also apprears in the value expression
// if (Assignment.IsComplexUpdate(updatedVariablesBefore[j1], updatedVariablesInNewUpdate[j2], usedVariableInNewUpdate[j2]))
// {
// model.CreateTemporaryVar();
// Expression newUpdate1;
// Expression newUpdate2;
// PropertyAssignment assignment = this as PropertyAssignment;
// newUpdate1 = new Assignment(Model.TEMPORARY_VARIABLE, this.RightHandExpression);
// newUpdate2 = new PropertyAssignment(this.RecordExpression, this.PropertyExpression, new Variable(Model.TEMPORARY_VARIABLE));
// resultBefore.Ref();
// ExpressionBDDEncoding tempResult1 = newUpdate1.TranslateStatementToBDD(resultBefore, model);
// ExpressionBDDEncoding tempResult2 = newUpdate2.TranslateStatementToBDD(tempResult1, model);
// //Remove the temporary variable from transition
// for (int i = 0; i < tempResult2.Count(); i++)
// {
// tempResult2.GuardDDs[i] = CUDD.Abstract.ThereExists(tempResult2.GuardDDs[i], model.GetRowVars(model.GetVarIndex(Model.TEMPORARY_VARIABLE)));
// tempResult2.GuardDDs[i] = CUDD.Abstract.ThereExists(tempResult2.GuardDDs[i], model.GetColVars(model.GetVarIndex(Model.TEMPORARY_VARIABLE)));
// tempResult.AddNodeToGuard(tempResult2.GuardDDs[i]);
// }
// }
// else
// {
// //swap row, col updated variable in result in the new update command expression
// CUDDNode update2 = newUpdate.GuardDDs[j2];
// CUDD.Ref(update2);
// foreach (int index in updatedVariablesBefore[j1])
// {
// if (usedVariableInNewUpdate[j2].Contains(index))
// {
// update2 = CUDD.Variable.SwapVariables(update2, model.GetColVars(index), model.GetRowVars(index));
// }
// }
// //Restrict updated variable in new update of the old update
// CUDDNode update1 = resultBefore.GuardDDs[j1];
// CUDD.Ref(update1);
// foreach (int index in updatedVariablesInNewUpdate[j2])
// {
// if (updatedVariablesBefore[j1].Contains(index))
// {
// update1 = CUDD.Abstract.ThereExists(update1, model.GetColVars(index));
// }
// }
// CUDDNode transition = CUDD.Function.And(update1, update2);
// tempResult.AddNodeToGuard(transition);
// }
// }
// }
// resultBefore.DeRef();
// newUpdate.DeRef();
// return tempResult;
//}
public override void GenerateMSIL(ILGenerator ilGenerator, TypeBuilder typeBuilder)
{
FieldInfo fb = typeBuilder.GetField(ClassProperty.Variable.ExpressionID);
ilGenerator.Emit(OpCodes.Ldsfld, fb);
RightHandExpression.GenerateMSIL(ilGenerator, typeBuilder);
Type type = fb.GetType();
FieldInfo property = typeBuilder.GetField(ClassProperty.PropertyName);
ilGenerator.Emit(OpCodes.Stsfld, property);
}