public bool GoToLocation(object @ref) { if (@ref == null) { return(false); } var member = @ref as IMemberDef; if (member != null) { var refSeg = references.FirstOrDefault(a => a.IsLocalTarget && a.Reference == member); return(GoToTarget(refSeg, false, false)); } var codeRef = @ref as CodeReference; if (codeRef != null) { var refSeg = references.FirstOrDefault(a => a.Equals(codeRef)); return(GoToTarget(refSeg, false, false)); } Debug.Fail(string.Format("Unknown type: {0} = {1}", @ref.GetType(), @ref)); return(false); }