Esempio n. 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);
            }
        }
Esempio n. 2
0
        public void RecacheCompletion()
        {
            LanguageService service = LanguageService.Get(this);

            if (service != null)
            {
                service.CacheUsing(this);
            }
        }
Esempio n. 3
0
        public IEnumerable <string> GetNamespaces(string ns)
        {
            LanguageService service = LanguageService.Get(this);

            if (service != null)
            {
                return(service.GetNamespaces(ns));
            }
            return(Strings.EmptyArray);
        }
Esempio n. 4
0
        public void FillTypes(CustomItemsRequestEventArgs e)
        {
            LanguageService    ls          = LanguageService.Get(this);
            ClassOrStructBlock parentClass = ClassNavigator.FindContainingClassOrStruct(this);

            if (ls != null)
            {
                ls.FillTypeItems(parentClass, e.Items);
            }
            e.ShouldCallFillItems = false;
            e.ShowOnlyCustomItems = true;
        }
Esempio n. 5
0
        public void Reparse()
        {
            LanguageService ls = LanguageService.Get(this);

            if (ls != null && ls.Parser != null)
            {
                StatementInfo = ls.Parser.ParseStatement(this.Text);
            }
            else
            {
                StatementInfo = null;
            }
        }
Esempio n. 6
0
        protected override void FillItems(CustomItemsRequestEventArgs e)
        {
            LanguageService    ls          = LanguageService.Get(this);
            ClassOrStructBlock parentClass = ClassNavigator.FindContainingClassOrStruct(this);

            if (ls != null && parentClass != null)
            {
                IEnumerable <TextPictureInfo> types = ls.GetTypeList(parentClass);
                foreach (TextPictureInfo t in types)
                {
                    AddEmptyItem(t.Text, t.Picture, e.Items);
                }
            }
        }
        public override void FillItems(CustomItemsRequestEventArgs e)
        {
            LanguageService    ls     = LanguageService.Get(this);
            ClassOrStructBlock parent = ClassNavigator.FindContainingClassOrStruct(this);

            if (ls != null && parent != null)
            {
                ListSet <TextPictureInfo> result = new ListSet <TextPictureInfo>();
                AddItems(e.Items, ItemStrings);

                ls.FillTypeList(parent, result);
                foreach (TextPictureInfo s in result)
                {
                    CompletionListItem item = CreateItem(s.Text);
                    if (item.ShouldShow(this.Completion))
                    {
                        item.Picture = s.Picture;
                        e.Items.Add(item);
                    }
                }
            }
        }