Esempio n. 1
0
		public void GetMethodInfo(SerializedDnToken key, out Parameter[] parameters, out Local[] locals, out IILVariable[] decLocals) {
			parameters = null;
			locals = null;
			decLocals = null;

			foreach (var tab in fileTabManager.VisibleFirstTabs) {
				if (parameters != null && decLocals != null)
					break;

				var uiContext = tab.UIContext as ITextEditorUIContext;
				var cm = uiContext.TryGetCodeMappings();
				if (cm == null)
					continue;
				var mapping = cm.TryGetMapping(key);
				if (mapping == null)
					continue;
				var method = mapping.Method;
				if (mapping.LocalVariables != null && method.Body != null) {
					locals = method.Body.Variables.ToArray();
					decLocals = new IILVariable[method.Body.Variables.Count];
					foreach (var v in mapping.LocalVariables) {
						if (v.GeneratedByDecompiler)
							continue;
						if (v.OriginalVariable == null)
							continue;
						if ((uint)v.OriginalVariable.Index >= decLocals.Length)
							continue;
						decLocals[v.OriginalVariable.Index] = v;
					}
				}

				parameters = method.Parameters.ToArray();
			}
		}
Esempio n. 2
0
        public static void Set(this ILGenerator gen, IILVariable variable, IILPointer value)
        {
            if (value == null)
            {
                value = ILPointer.Null;
            }

            variable.PreSet(gen);
            value.Load(gen);
            variable.Set(gen);
        }
Esempio n. 3
0
        public void GetMethodInfo(SerializedDnToken key, out Parameter[] parameters, out Local[] locals, out IILVariable[] decLocals)
        {
            parameters = null;
            locals     = null;
            decLocals  = null;

            foreach (var tab in fileTabManager.VisibleFirstTabs)
            {
                if (parameters != null && decLocals != null)
                {
                    break;
                }

                var uiContext = tab.UIContext as ITextEditorUIContext;
                var cm        = uiContext.TryGetCodeMappings();
                if (cm == null)
                {
                    continue;
                }
                var mapping = cm.TryGetMapping(key);
                if (mapping == null)
                {
                    continue;
                }
                var method = mapping.Method;
                if (mapping.LocalVariables != null && method.Body != null)
                {
                    locals    = method.Body.Variables.ToArray();
                    decLocals = new IILVariable[method.Body.Variables.Count];
                    foreach (var v in mapping.LocalVariables)
                    {
                        if (v.GeneratedByDecompiler)
                        {
                            continue;
                        }
                        if (v.OriginalVariable == null)
                        {
                            continue;
                        }
                        if ((uint)v.OriginalVariable.Index >= decLocals.Length)
                        {
                            continue;
                        }
                        decLocals[v.OriginalVariable.Index] = v;
                    }
                }

                parameters = method.Parameters.ToArray();
            }
        }
 object Create(IToolTipContentCreatorContext context, IILVariable local)
 {
     return Create(context, local.OriginalVariable, local.Name);
 }
 object Create(IToolTipContentCreatorContext context, IILVariable local)
 {
     return(Create(context, local.OriginalVariable, local.Name));
 }