private static string GetRelativePath(string fullPath) { string currentDir = Directory.GetCurrentDirectory(); if (currentDir == null || currentDir.Length == 0) { return(fullPath); } System.Globalization.CompareInfo compInfo = System.Globalization.CultureInfo.InvariantCulture.CompareInfo; if (compInfo.IsPrefix(fullPath, currentDir, System.Globalization.CompareOptions.IgnoreCase)) { return(fullPath.Substring(currentDir.Length + 1)); } return(fullPath); }
private IList<ICompletionData> CheckAndAddCompletion(CompareInfo comparer, string word, IList<ICompletionData> data, string option) { if (comparer.IsPrefix(option, word)) { if (data == null) { completionWindow = new CompletionWindow(this.ScriptTextBox.TextArea); completionWindow.CompletionList.InsertionRequested += CompletionList_InsertionRequested; data = completionWindow.CompletionList.CompletionData; } data.Add(new PreposeSyntaxCompletionData(option)); } return data; }