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); } }
public TutorialEmptyBlock() { Completion.AddCreateBlocksItem <TutorialUniversalBlock, TutorialEmptyBlock>("universal"); CreateBlocksItem createText = Completion.AddCreateBlocksItem <TextBoxBlock>("text"); MoreThan3TextBlocksCondition createTextVisible = new MoreThan3TextBlocksCondition(this); createText.VisibilityConditions.Add(createTextVisible); }