我最近在https://msdn.microsoft.com/en-us/library/ee372314.aspx上跟随了演练并成功设法让它继续使用包含的列表,我可以添加简单的字符串值来完成我输入的任何内容串。
void ICompletionSource.AugmentCompletionSession(ICompletionSession session, IList<CompletionSet> completionSets)
{
List<string> strList = new List<string>();
strList.Add("addition_test");
strList.Add("adaptation");
strList.Add("subtraction");
m_compList = new List<Completion>();
foreach (string str in strList)
m_compList.Add(new Completion(str, str, str, null, null));
如图所示,我显示了标准字符串,&#34; addition_test&#34;,&#34; adaptation&#34; 和&#34;减法&#34;。他们都工作。
但是我想知道我是否可以在其前面放置特殊字符。如
strList.Add(&#34;#适应&#34);
strList.Add(&#34; adapt_nation&#34);
strList.Add(&#34; /#@ adapt_entity&#34);
我无法让它显示带有特殊字符的声明,我想知道是否有办法做到这一点以及如何操作?
干杯
答案 0 :(得分:0)
回答@Keyur PATEL
我从未遇到过这个,所以我只能推测,但尝试更改
&& char.IsLetterOrDigit(typedChar)
以强>
&& (char.IsLetterOrDigit(typedChar) || char.IsPunctuation(typedChar))
中的
public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) function.