示例#1
0
        public static bool NavigateTo(FrameWork.Dom.IEntity entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            var cu = entity.CompilationUnit;

            FrameWork.Dom.DomRegion region;
            if (entity is FrameWork.Dom.IClass)
            {
                region = ((FrameWork.Dom.IClass)entity).Region;
            }
            else if (entity is FrameWork.Dom.IMember)
            {
                region = ((FrameWork.Dom.IMember)entity).Region;
            }
            else
            {
                region = FrameWork.Dom.DomRegion.Empty;
            }

            if (cu == null || string.IsNullOrEmpty(cu.FileName) || region.IsEmpty)
            {
                foreach (var item in AddInTree.BuildItems <INavigateToEntityService>("/SharpDevelop/Services/NavigateToEntityService", null, false))
                {
                    if (item.NavigateToEntity(entity))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            else
            {
                return(FileService.JumpToFilePosition(cu.FileName, region.BeginLine, region.BeginColumn) != null);
            }
        }
示例#2
0
 public override bool IsReferenceTo(FrameWork.Dom.IEntity entity)
 {
     return(targetRR.IsReferenceTo(entity));
 }