public static string GetRelatedFilePath(this DocumentView documentView) { var firstPipe = documentView.Name.IndexOf('|'); var secondPipe = documentView.Name.IndexOf('|', firstPipe + 1); var thirdPipe = documentView.Name.IndexOf('|', secondPipe + 1); var fileName = documentView.Name.Substring(secondPipe + 1, thirdPipe - secondPipe - 1); return(DocumentPaths.GetCorrectCase(fileName)); }
public static IEnumerable <string> GetTextDocumentFilePaths(this ITextBuffer textBuffer) { if (textBuffer.Properties.TryGetProperty(typeof(ITextDocument), out ITextDocument textDoc)) { return(new[] { DocumentPaths.GetFullPath(textDoc.FilePath) }); } else if (textBuffer is IProjectionBufferBase ProjBuffer && ProjBuffer.SourceBuffers.Count != 0) { return(GetTextDocumentFilePaths(ProjBuffer.SourceBuffers)); }
public static string GetWindowsFilePath(this Document document) { return(DocumentPaths.GetCorrectCase(document.FullName)); }