Beispiel #1
0
        //bool attributesAdded = false;

        //protected override void OnRootChanged(RootBlock oldRoot, RootBlock newRoot)
        //{
        //    base.OnRootChanged(oldRoot, newRoot);
        //    if (newRoot != null && !attributesAdded)
        //    {
        //        attributesAdded = true;
        //        AttributeBlock.AddAttributes(this);
        //    }
        //}

        #region Items

        protected virtual void FillItems()
        {
            ReplaceBlocksItem usingItem = Completion.AddReplaceBlocksItem <UsingBlock, EmptyNamespaceBlock>("using");

            usingItem.Picture = Icons.CodeSnippet;
            usingItem.VisibilityConditions.Add
            (
                new DelegateCondition(
                    delegate
            {
                return(this.Prev == null);
            }
                    )
            );

            AddItem <NamespaceBlock>("namespace");

            AddItem <ClassBlock>("class");
            AddItem <StructBlock>("struct");
            AddItem <InterfaceBlock>("interface");
            AddItem <EnumBlock>("enum");
            AddItem <DelegateBlock>("delegate");

            AddEmptyItem("public");
            AddEmptyItem("internal");
            AddEmptyItem("abstract");
            AddEmptyItem("sealed");
            AddEmptyItem("static");
            AddEmptyItem("partial");

            AttributeBlock.AddAttributes(this);
        }
Beispiel #2
0
        public virtual void AddControlStructure <T>(string text, ICompletionListBuilder items)
        {
            ReplaceBlocksItem item = ReplaceBlocksItem.Create <T>(text);

            item.Picture = Icons.Keyword;
            items.Add(item);
        }