本文整理汇总了C#中ICSharpCode.Close方法的典型用法代码示例。如果您正苦于以下问题:C# ICSharpCode.Close方法的具体用法?C# ICSharpCode.Close怎么用?C# ICSharpCode.Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode
的用法示例。
在下文中一共展示了ICSharpCode.Close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessTextEntered
public void ProcessTextEntered(object sender, System.Windows.Input.TextCompositionEventArgs e, ref ICSharpCode.AvalonEdit.CodeCompletion.CompletionWindow completionWindow)
{
if (HasThrownException) return; // exit here if intellisense has previous thrown and exception
try
{
if (completionWindow != null)
{
// close the completion window if it has no items
if (!completionWindow.CompletionList.ListBox.HasItems)
{
completionWindow.Close();
return;
}
// close the completion window if the current text is a 100% match for the current item
var txt = ((TextArea)sender).Document.GetText(new TextSegment() { StartOffset = completionWindow.StartOffset, EndOffset = completionWindow.EndOffset });
var selectedItem = completionWindow.CompletionList.SelectedItem;
if (string.Compare(selectedItem.Text, txt, true) == 0 || string.Compare(selectedItem.Content.ToString(), txt, true) == 0) completionWindow.Close();
return;
}
if (char.IsLetterOrDigit(e.Text[0]) || "\'[".Contains(e.Text[0]))
{
// exit if the completion window is already showing
if (completionWindow != null) return;
// exit if we are inside a string or comment
_daxState = ParseLine();
var lineState = _daxState.LineState;
if (lineState == LineState.String || _editor.IsInComment()) return;
// don't show intellisense if we are in the measure name of a DEFINE block
if (DaxLineParser.IsLineMeasureDefinition(GetCurrentLine())) return;
// TODO add insights window for Function parameters
//InsightWindow insightWindow = new InsightWindow(sender as ICSharpCode.AvalonEdit.Editing.TextArea);
completionWindow = new CompletionWindow(sender as ICSharpCode.AvalonEdit.Editing.TextArea);
completionWindow.CloseAutomatically = false;
completionWindow.CompletionList.BorderThickness = new System.Windows.Thickness(1);
if (char.IsLetterOrDigit(e.Text[0]))
{
// if the window was opened by a letter or digit include it in the match segment
//completionWindow.StartOffset -= 1;
completionWindow.StartOffset = _daxState.StartOffset;
System.Diagnostics.Debug.WriteLine("Setting Completion Offset: {0}", _daxState.StartOffset);
}
IList<ICompletionData> data = completionWindow.CompletionList.CompletionData;
switch (e.Text)
{
case "[":
string tableName = GetPreceedingTableName();
if (string.IsNullOrWhiteSpace(tableName))
{
PopulateCompletionData(data, IntellisenseMetadataTypes.Measures);
}
else
{
PopulateCompletionData(data, IntellisenseMetadataTypes.Columns, tableName);
}
break;
case "'":
PopulateCompletionData(data, IntellisenseMetadataTypes.Tables);
break;
default:
switch (_daxState.LineState)
{
case LineState.Column:
PopulateCompletionData(data, IntellisenseMetadataTypes.Columns, _daxState.TableName);
break;
case LineState.Table:
PopulateCompletionData(data, IntellisenseMetadataTypes.Tables);
break;
case LineState.Measure:
PopulateCompletionData(data, IntellisenseMetadataTypes.Measures);
break;
case LineState.Dmv:
PopulateCompletionData(data, IntellisenseMetadataTypes.DMV);
break;
default:
PopulateCompletionData(data, IntellisenseMetadataTypes.ALL);
break;
}
break;
}
if (data.Count > 0)
{
//var line = GetCurrentLine();
//System.Diagnostics.Debug.Assert(line.Length >= _daxState.EndOffset);
var txt = _editor.Document.GetText(new TextSegment() { StartOffset = _daxState.StartOffset, EndOffset = _daxState.EndOffset });
//var txt = line.Substring(_daxState.StartOffset,_daxState.EndOffset - _daxState.StartOffset);
completionWindow.CompletionList.SelectItem(txt);
//.........这里部分代码省略.........