当前位置: 首页>>代码示例>>C#>>正文


C# VariableReference.Resolve方法代码示例

本文整理汇总了C#中Mono.Cecil.Cil.VariableReference.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# VariableReference.Resolve方法的具体用法?C# VariableReference.Resolve怎么用?C# VariableReference.Resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Cecil.Cil.VariableReference的用法示例。


在下文中一共展示了VariableReference.Resolve方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsStackVariable

 private bool IsStackVariable(VariableReference varRef)
 {
     return methodContext.StackData.VariableToDefineUseInfo.ContainsKey(varRef.Resolve());
 }
开发者ID:juancarlosbaezpozos,项目名称:JustDecompileEngine,代码行数:4,代码来源:IntegerTypesHierarchyBuilder.cs

示例2: GetVariableName

		protected string GetVariableName(VariableReference variable)
		{
			VariableDefinition variableDefinition = variable.Resolve();

			string result;
			if (!GetCurrentMethodContext().VariableDefinitionToNameMap.TryGetValue(variableDefinition, out result))
			{
				result = variableDefinition.Name;
			}

			return result;
		}
开发者ID:GiGatR00n,项目名称:JustDecompileEngine,代码行数:12,代码来源:BaseImperativeLanguageWriter.cs

示例3: RemoveVariable

		public void RemoveVariable (VariableReference reference)
		{
			RemoveVariable (reference.Resolve ());
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:DecompilationContext.cs

示例4: TryResolve

 /// <summary>
 /// A cecil variable reference will be directed to this method.
 /// </summary>
 /// <param name="item">Cecil reference.</param>
 /// <param name="resolvedItem">Output parameter that will be populated with the resolved cecil definition.</param>
 /// <returns><c>true</c></returns>
 private static bool TryResolve(VariableReference item, out object resolvedItem)
 {
     resolvedItem = item.Resolve();
     return true;
 }
开发者ID:rileywhite,项目名称:Cilador,代码行数:11,代码来源:DynamicResolver.cs

示例5: IsTempVariable

        private bool IsTempVariable(VariableReference variable)
        {
            var name = methodContext.VariableDefinitionToNameMap[variable.Resolve()];

            if (name.StartsWith("CS$") ||
				name.StartsWith("VB$") ||
				name.IndexOf("__init") > 0 ||
				name.StartsWith("stackVariable") ||
				name.StartsWith("exception_"))
            {
                return true;
            }
            return false;
        }
开发者ID:juancarlosbaezpozos,项目名称:JustDecompileEngine,代码行数:14,代码来源:RenameVariables.cs

示例6: RemoveVariable

 internal void RemoveVariable(VariableReference reference)
 {
     RemoveVariable(reference.Resolve());
 }
开发者ID:Feng2012,项目名称:JustDecompileEngine,代码行数:4,代码来源:MethodSpecificContext.cs

示例7: GetIdentifierReference

 private Expression GetIdentifierReference(VariableReference identifierReference, ref Expression target)
 {
     MethodInvocationExpression targetInvocation = target as MethodInvocationExpression;
     if (targetInvocation != null && targetInvocation.MethodExpression.MethodDefinition != null &&
         targetInvocation.MethodExpression.MethodDefinition.IsStatic &&
         (targetInvocation.MethodExpression.MethodDefinition.DeclaringType.FullName == "System.Linq.Enumerable" ||
         targetInvocation.MethodExpression.MethodDefinition.DeclaringType.FullName == "System.Linq.Queryable") &&
         targetInvocation.MethodExpression.Method.Name == "Cast")
     {
         target = targetInvocation.Arguments[0];
         methodContext.UndeclaredLinqVariables.Remove(identifierReference.Resolve());
         return new VariableDeclarationExpression(identifierReference.Resolve(), null);
     }
     return new VariableReferenceExpression(identifierReference, null);
 }
开发者ID:Feng2012,项目名称:JustDecompileEngine,代码行数:15,代码来源:RebuildLinqQueriesStep.cs


注:本文中的Mono.Cecil.Cil.VariableReference.Resolve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。