public static IEnumerable<TreeViewItemViewModel> CreateViewModels(ISourceExplorerViewModelHost host, FileEntryViewModel parent, FileSystemEntryData data)
        {
            var positionsData = data as FilePositionsData;
              if (positionsData != null)
            return positionsData.Positions.Select(x => new FilePositionViewModel(host, parent, x));

              return Enumerable.Empty<TreeViewItemViewModel>();
        }
 public FilePositionViewModel(ISourceExplorerViewModelHost host, FileEntryViewModel parentFile, FilePositionSpan position)
     : base(host, parentFile, false)
 {
     _parentFile = parentFile;
       _position = position;
 }
        public static IEnumerable <TreeViewItemViewModel> CreateViewModels(ISourceExplorerViewModelHost host, FileEntryViewModel parent, FileSystemEntryData data)
        {
            var positionsData = data as FilePositionsData;

            if (positionsData != null)
            {
                return(positionsData.Positions.Select(x => new FilePositionViewModel(host, parent, x)));
            }

            return(Enumerable.Empty <TreeViewItemViewModel>());
        }
 public void NavigateToFile(FileEntryViewModel fileEntry, Span? span)
 {
     // Using "Post" is important: it allows the newly opened document to
       // receive the focus.
       SynchronizationContextProvider.UIContext.Post(() =>
     OpenDocumentHelper.OpenDocument(fileEntry.Path, _ => span));
 }
示例#5
0
 public FilePositionViewModel(ISourceExplorerViewModelHost host, FileEntryViewModel parentFile, FilePositionSpan position)
     : base(host, parentFile, false)
 {
     _parentFile = parentFile;
     _position   = position;
 }