public override void Run(ResolveResult symbol) { if (symbol == null) return; var trr = symbol as TypeResolveResult; var def = symbol.Type.GetDefinition(); if (trr != null && def != null && def.Parts.Count > 1) { ShowPopupWithPartialClasses(def); return; } DomRegion pos = symbol.GetDefinitionRegion(); if (string.IsNullOrEmpty(pos.FileName)) { IEntity entity = GetSymbol(symbol) as IEntity; if (entity != null) { NavigationService.NavigateTo(entity); } } else { try { if (pos.Begin.IsEmpty) FileService.OpenFile(pos.FileName); else FileService.JumpToFilePosition(pos.FileName, pos.BeginLine, pos.BeginColumn); } catch (Exception ex) { MessageService.ShowException(ex, "Error jumping to '" + pos.FileName + "'."); } } }
public override bool CanExecute(ResolveResult symbol) { if (symbol == null) return false; return !symbol.GetDefinitionRegion().IsEmpty; }