public IPeekResultPresentation TryCreatePeekResultPresentation(IPeekResult result) { var review = result as InlineCommentPeekResult; return(review != null ? new InlineCommentPeekResultPresentation(review.ViewModel) : null); }
public IPeekResultPresentation TryCreatePeekResultPresentation(IPeekResult result) { F1PeekResult f1Result = result as F1PeekResult; if (f1Result != null) { return(new F1PeekResultPresentation(f1Result)); } return(null); }
public void FindResults(string relationshipName, IPeekResultCollection resultCollection, System.Threading.CancellationToken cancellationToken, IFindPeekResultsCallback callback) { if (relationshipName == PredefinedPeekRelationships.Definitions.Name) { foreach (var location in _locations) { IPeekResult result = CreatePeekResult(location); if (result != null) { resultCollection.Add(result); } } } }
private IPeekResult CreatePeekResult(LocationInfo location) { IPeekResult result = null; var path = location.FilePath; if (!string.IsNullOrWhiteSpace(path)) { var fi = new FileInfo(path); var displayInfo = new PeekResultDisplayInfo(BuildLabel(location), path, BuildTitle(location), path); // TODO: the location stuff doesn't work 100% correctly. This needs to be fixed string contentType = null; var extension = Path.GetExtension(path); if (extension != null) { switch (extension.ToLower()) { case ".4gl": contentType = VSGeneroConstants.ContentType4GL; break; case ".inc": contentType = VSGeneroConstants.ContentTypeINC; break; case ".per": contentType = VSGeneroConstants.ContentTypePER; break; } } if (contentType != null) { ITextDocument textDoc = null; int line = location.Line - 1; if (line < 0) { textDoc = this._factory.TextDocumentFactoryService.CreateAndLoadTextDocument(path, this._factory.ContentTypeRegistryService.GetContentType(contentType)); line = textDoc.TextBuffer.CurrentSnapshot.GetLineNumberFromPosition(location.Index); } int character = location.Column - 1; // start index if (character < 0) { character = 0; } //EditorExtensions.EditorExtensions.GetLineAndColumnOfFile(path, location.Position, out line, out character); int endLine = line + 10; // end line int endIndex = 0; // end index int positionLine = 0; // id line int positionChar = 0; // id index bool isReadOnly = fi.IsReadOnly; // TODO: determine the stuff above. result = this._factory.PeekResultFactory.Create(displayInfo, path, line, character, endLine, endIndex, positionLine, positionChar, isReadOnly); result.Disposed += (x, y) => { if (textDoc != null) { textDoc.Dispose(); } }; } } else if (!string.IsNullOrWhiteSpace(location.DefinitionURL)) { #if DEV14_OR_LATER return(new UrlPeekResult(location.GetUrlString(_languageVersion))); #endif } return(result); }
public bool TryOpen(IPeekResult otherResult) => false;
public bool TryOpen(IPeekResult otherResult) { // Cannot open other results return false; }
public RotPeekResultPresentation(IPeekResult result) { var rotResult = result as RotPeekResult; _expandedTactic = rotResult?.ExpandedTactic ?? "Failed to Expand Tactic"; }
public bool TryOpen(IPeekResult otherResult) { var other = otherResult as RotPeekResult; return(_expandedTactic == other?.ExpandedTactic); }
public IPeekResultPresentation TryCreatePeekResultPresentation(IPeekResult result) { return(new RotPeekResultPresentation(result)); }
public bool TryOpen(IPeekResult otherResult) { // Cannot open other results return(false); }
public bool TryOpen(IPeekResult otherResult) { var other = otherResult as RotPeekResult; return _expandedTactic==other?.ExpandedTactic; }
public IPeekResultPresentation TryCreatePeekResultPresentation(IPeekResult result) { return new RotPeekResultPresentation(result); }