public override void Click(CompletionFunctionality hostItemList)
        {
            Block reference = emptyBlock;

            ReadOnlyCollection <Block> blocksToInsert = Factory.CreateBlocks();

            if (reference != null &&
                blocksToInsert != null &&
                blocksToInsert.Count > 0)
            {
                string        modifiers = emptyBlock.Modifiers.GetModifierString();
                IHasModifiers result    = blocksToInsert[0] as IHasModifiers;
                if (result != null)
                {
                    result.Modifiers.SetMany(modifiers);
                    if (this.Text == "void")
                    {
                        result.Modifiers.Set("void");
                    }
                }
                IHasName named = blocksToInsert[0] as IHasName;
                if (named != null)
                {
                    named.Name = emptyBlock.Name;
                }

                reference.Replace(blocksToInsert);
            }
        }
예제 #2
0
        public override void Click(CompletionFunctionality hostItemList)
        {
            List <Block>  blocks   = new List <Block>(this.Factory.CreateBlocks());
            IHasModifiers newEmpty = blocks[0] as IHasModifiers;

            if (newEmpty != null)
            {
                newEmpty.Modifiers.SetMany(this.Text);
            }
            hostItemList.HostBlock.AppendBlocks(blocks);
        }