Example #1
0
 private void AddStatementItems(ICompletionListBuilder items)
 {
     if (this.Text.Length <= 1 && this.Context == CompletionContext.Statement)
     {
         CompletionAddStatements(items);
     }
 }
Example #2
0
        public virtual void AddControlStructure <T>(string text, ICompletionListBuilder items)
        {
            ReplaceBlocksItem item = ReplaceBlocksItem.Create <T>(text);

            item.Picture = Icons.Keyword;
            items.Add(item);
        }
Example #3
0
 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);
     }
 }
Example #4
0
        protected void AddEmptyItem(string keyword, Image picture, ICompletionListBuilder items)
        {
            EmptyBlockItem item = new EmptyBlockItem(
                keyword,
                emptyBlockFactory);

            item.Picture = picture;
            items.Add(item);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #9
0
        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);
            }
        }
Example #11
0
 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);
            }
        }
Example #13
0
        public static void GetCompletion(
            TextBoxBlockWithCompletion textBox,
            ICompletionListBuilder items,
            CompletionContext context)
        {
            LanguageService ls = Get(textBox);

            if (ls != null)
            {
                ls.RaiseProvideCompletion(textBox, items, context);
            }
        }
Example #14
0
 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;
 }
Example #16
0
 public ItemBuilder(ICompletionListBuilder items)
 {
     Items = items;
 }
Example #17
0
        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);
            }
        }
Example #18
0
 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);
         }
     }
 }
Example #19
0
 public virtual void CompletionAddStatements(ICompletionListBuilder items)
 {
     items.AddText("return", Icons.Keyword);
     items.AddText("throw", Icons.Keyword);
     CompletionAddControlStructures(items);
 }
Example #20
0
 public ItemBuilder(ICompletionListBuilder items)
 {
     Items = items;
 }