Ejemplo n.º 1
0
        public static bool MoveCaretTo(DecompilerTextView textView, MethodKey key, uint ilOffset)
        {
            if (textView == null)
            {
                return(false);
            }
            TextLocation location, endLocation;
            var          cm = textView.CodeMappings;

            if (cm == null || !cm.ContainsKey(key))
            {
                return(false);
            }
            if (!cm[key].GetInstructionByTokenAndOffset(ilOffset, out location, out endLocation))
            {
                //TODO: Missing IL ranges
                return(false);
            }
            else
            {
                textView.ScrollAndMoveCaretTo(location.Line, location.Column);
                return(true);
            }
        }
Ejemplo n.º 2
0
        public static bool JumpToStatement(MethodDef method, uint ilOffset, DecompilerTextView textView = null)
        {
            if (method == null)
            {
                return(false);
            }
            var key = MethodKey.Create(method);

            if (key == null)
            {
                return(false);
            }
            if (textView == null)
            {
                textView = MainWindow.Instance.SafeActiveTextView;
            }
            return(MainWindow.Instance.JumpToReference(textView, method, (success, hasMovedCaret) => {
                if (success)
                {
                    return MoveCaretTo(textView, key.Value, ilOffset);
                }
                return false;
            }));
        }
Ejemplo n.º 3
0
 public static bool GoToIL(string asmName, MethodKey key, uint ilOffset, bool newTab)
 {
     return(GoToIL(new SerializedDnModuleWithAssembly(asmName, key.Module), key.Token, ilOffset, newTab));
 }
Ejemplo n.º 4
0
 protected MarkedTextLine(MethodKey methodKey, uint ilOffset, IMarkedTextLine senderObj = null)
 {
     this.methodKey = methodKey;
     this.ilOffset  = ilOffset;
     this.senderObj = senderObj ?? this;
 }