private void AddStatementItems(ICompletionListBuilder items) { if (this.Text.Length <= 1 && this.Context == CompletionContext.Statement) { CompletionAddStatements(items); } }
public virtual void AddControlStructure <T>(string text, ICompletionListBuilder items) { ReplaceBlocksItem item = ReplaceBlocksItem.Create <T>(text); item.Picture = Icons.Keyword; items.Add(item); }
public virtual void CompletionAddControlStructures(ICompletionListBuilder items) { AddControlStructure <IfBlock>("if", items); if (this.Prev is IfBlock || this.Prev is ElseBlock) { AddControlStructure <ElseBlock>("else", items); } AddControlStructure <WhileBlock>("while", items); AddControlStructure <DoWhileBlock>("do", items); AddControlStructure <ForBlock>("for", items); AddControlStructure <ForeachBlock>("foreach", items); AddControlStructure <LockBlock>("lock", items); AddControlStructure <TryBlock>("try", items); if (this.Prev is TryBlock || this.Prev is CatchBlock) { AddControlStructure <CatchBlock>("catch", items); AddControlStructure <FinallyBlock>("finally", items); } AddControlStructure <UsingStatementBlock>("using", items); if (this.Next == null && ClassNavigator.FindContainingControlStructure(this) != null) { AddControlStructure <BreakStatement>("break", items); AddControlStructure <ContinueStatement>("continue", items); } }
protected void AddEmptyItem(string keyword, Image picture, ICompletionListBuilder items) { EmptyBlockItem item = new EmptyBlockItem( keyword, emptyBlockFactory); item.Picture = picture; items.Add(item); }
private void PrepareItems() { ICompletionListBuilder CustomItems = Completion.Items; AddItem <ClassBlock>("class", CustomItems); AddItem <StructBlock>("struct", CustomItems); AddItem <InterfaceBlock>("interface", CustomItems); AddItem <EnumBlock>("enum", CustomItems); AddItem <DelegateBlock>("delegate", CustomItems); }
public void AddItem <T>(string s, ICompletionListBuilder itemsToAdd) { ReplaceTypeEmptyBlockItem item = new ReplaceTypeEmptyBlockItem( s, BlockActivatorFactory.Types <T>(), this); item.Picture = Icons.CodeSnippet; itemsToAdd.Add(item); }
protected CustomItemsRequestEventArgs RaiseCustomItemsRequested(ICompletionListBuilder items) { if (CustomItemsRequested != null) { CustomItemsRequestEventArgs e = new CustomItemsRequestEventArgs(items); CustomItemsRequested(e); return(e); } return(null); }
public void FillItems(ICompletionListBuilder items) { CustomItemsRequestEventArgs e = RaiseCustomItemsRequested(items); if (e != null && e.ShowOnlyCustomItems) { return; } items.AddRange(this.Items); }
public static void GetCompletion( TextBoxBlockWithCompletion textBox, ICompletionListBuilder items, CompletionContext context) { LanguageService ls = Get(textBox); if (ls != null) { ls.RaiseProvideCompletion(textBox, items, context); } }
public void FillTypeItems( ClassOrStructBlock callingClass, ICompletionListBuilder items) { ListSet<TextPictureInfo> result = new ListSet<TextPictureInfo>(); FillTypeList(callingClass, result); foreach (TextPictureInfo t in result) { items.AddText(t.Text, t.Picture); } }
protected void AddItems(ICompletionListBuilder items, IEnumerable <string> itemsToAdd) { foreach (string s in itemsToAdd) { CompletionListItem item = CreateItem(s); if (item.ShouldShow(this.Completion)) { items.Add(item); } } }
public void FillTypeItems( ClassOrStructBlock callingClass, ICompletionListBuilder items) { ListSet <TextPictureInfo> result = new ListSet <TextPictureInfo>(); FillTypeList(callingClass, result); foreach (TextPictureInfo t in result) { items.AddText(t.Text, t.Picture); } }
internal void RaiseProvideCompletion( TextBoxBlockWithCompletion statementBlock, ICompletionListBuilder items, CompletionContext context) { if (ProvideCompletion != null) { ProvideCompletionEventArgs e = new ProvideCompletionEventArgs( statementBlock); e.Items = items; e.Context = context; ProvideCompletion(statementBlock, e); } }
public CustomItemsRequestEventArgs(ICompletionListBuilder items) { mItems = items; }
public ItemBuilder(ICompletionListBuilder items) { Items = items; }
protected void AddItems(ICompletionListBuilder items, IEnumerable<string> itemsToAdd) { foreach (string s in itemsToAdd) { CompletionListItem item = CreateItem(s); if (item.ShouldShow(this.Completion)) { items.Add(item); } } }
public virtual void CompletionAddStatements(ICompletionListBuilder items) { items.AddText("return", Icons.Keyword); items.AddText("throw", Icons.Keyword); CompletionAddControlStructures(items); }