現在、Visual Studioの拡張機能としてカスタムツールヒントを追加しようとしています。辞書値をNewLineに置き換えます。
しかし、(私は非常に長い説明があるので、\ r \ nを使ってみましたが、明らかに機能せず、ツールチップに\ r \ nとして表示されます)
//var reader = new StreamReader(File.OpenRead(@"C:\xx\QuickInfo.csv"));
/*while (!reader.EndOfStream)
{
var line = reader.ReadLine();
var values = line.Split(',');
//add in values in position 0 and 1
m_dictionary.Add(values[0], values[1].Replace("<br>", Environment.NewLine));
}*/
それを短くするEnvironment.Newlineで、すべての "< BR>" を交換することでスペース
internal class VCLToolTipSource: IQuickInfoSource
{
private VCLToolTipSourceProvider m_provider;
private ITextBuffer m_subjectBuffer;
private Dictionary<string, string> m_dictionary;
public VCLToolTipSource(VCLToolTipSourceProvider provider, ITextBuffer subjectBuffer)
{
m_provider = provider;
m_subjectBuffer = subjectBuffer;
m_dictionary = new Dictionary<string, string>();
//CSV for Quick Info
//var reader = new StreamReader(File.OpenRead(@"C:\xx\QuickInfo.csv"));
//For going through CSV positions 0,1//
/*while (!reader.EndOfStream)
{
var line = reader.ReadLine();
var values = line.Split(',');
//add in values in position 0 and 1
m_dictionary.Add(values[0], values[1].Replace("<br>", Environment.NewLine));
}*/
//List of all tool tips//
m_dictionary.Add("keyword", "value");
m_dictionary.Add("adapt", " - Process given file <br>Syntax: #adapt[(-samelevel|-continue|-samelevel-continue|-copy)][:] path [output-folder] [output-file](vcl-command)*[#endadapt]<br>Variations:<br><br> -samelevel : The scope of the adapted file will be raised to the current level which makes it possible to override variables<br> -continue : If the adaptable file is not found continue processing. (warning message instead of stop processing with error)<br>Note: #adapt-continue will open the file and process it. Unlike #adapt-copy.<br> -copy : Instead of processing the file");
。
しかし、今私は、データをインポートするCSVファイルを使用しないことを、私は辞書からデータを読み込み、改行で< BR>を置き換える方法?
は、文字列の末尾にyourstring.Replace( "<br>
"、Environment.NewLine)を追加しようとしたんでした
あなたは全体の値を新しい行に置き換えたいですか?または
タグのみですか? –
にタグが付いているときはいつでも、新しい行が必要です。 –