コード例 #1
0
        public static void AddAttributes(EmptyBlock self)
        {
            LanguageService ls = LanguageService.Get(self);

            if (ls == null)
            {
                return;
            }
            if (!(self.Next is ITypeDeclaration) && !(self.Next is IClassLevel))
            {
                return;
            }
            foreach (var attributeType in ls.GetAttributeTypes())
            {
                var name = attributeType.Name.Replace("Attribute", "");
                CreateBlocksItem item = new CreateBlocksItem(
                    name,
                    () => new AttributeBlock()
                {
                    Text = name
                }
                    );
                item.Picture = Icons.TypeClass;
                self.Completion.Items.Add(item);
            }
        }
コード例 #2
0
        public TutorialEmptyBlock()
        {
            Completion.AddCreateBlocksItem <TutorialUniversalBlock, TutorialEmptyBlock>("universal");

            CreateBlocksItem             createText        = Completion.AddCreateBlocksItem <TextBoxBlock>("text");
            MoreThan3TextBlocksCondition createTextVisible = new MoreThan3TextBlocksCondition(this);

            createText.VisibilityConditions.Add(createTextVisible);
        }
コード例 #3
0
ファイル: AttributeBlock.cs プロジェクト: Ju2ender/csharp-e
 public static void AddAttributes(EmptyBlock self)
 {
     LanguageService ls = LanguageService.Get(self);
     if (ls == null)
     {
         return;
     }
     if (!(self.Next is ITypeDeclaration) && !(self.Next is IClassLevel))
     {
         return;
     }
     foreach (var attributeType in ls.GetAttributeTypes())
     {
         var name = attributeType.Name.Replace("Attribute", "");
         CreateBlocksItem item = new CreateBlocksItem(
             name,
             () => new AttributeBlock() { Text = name }
         );
         item.Picture = Icons.TypeClass;
         self.Completion.Items.Add(item);
     }
 }