Exemplo n.º 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);
        }
Exemplo n.º 2
0
 protected override void OnRootChanged(RootBlock oldRoot, RootBlock newRoot)
 {
     base.OnRootChanged(oldRoot, newRoot);
     if (newRoot != null && !attributesAdded)
     {
         attributesAdded = true;
         AttributeBlock.AddAttributes(this);
     }
 }