コード例 #1
0
        public virtual void FillTypeList(
            ClassOrStructBlock callingClass,
            IFillable <TextPictureInfo> typeListToFill)
        {
            foreach (string s in EmbeddedTypes)
            {
                TextPictureInfo result = new TextPictureInfo(s);
                if (s == "object" || s == "string")
                {
                    result.Picture = Icons.TypeClass;
                }
                else
                {
                    result.Picture = Icons.TypeStruct;
                }
                typeListToFill.Add(result);
            }

            CodeUnitBlock codeUnit = callingClass.Root as CodeUnitBlock;

            if (codeUnit != null && codeUnit.UsingSection != null)
            {
                foreach (UsingDirective u in codeUnit.UsingDirectives)
                {
                    CacheUsing(u);
                    IList <Type> types = null;
                    Types.TryGetValue(u.Text, out types);
                    if (types != null)
                    {
                        AddTypes(types, typeListToFill);
                    }
                }
            }
        }
コード例 #2
0
        public virtual void FillTypeList(
			ClassOrStructBlock callingClass,
			IFillable<TextPictureInfo> typeListToFill)
        {
            foreach (string s in EmbeddedTypes)
            {
                TextPictureInfo result = new TextPictureInfo(s);
                if (s == "object" || s == "string")
                {
                    result.Picture = Icons.TypeClass;
                }
                else
                {
                    result.Picture = Icons.TypeStruct;
                }
                typeListToFill.Add(result);
            }

            CodeUnitBlock codeUnit = callingClass.Root as CodeUnitBlock;
            if (codeUnit != null && codeUnit.UsingSection != null)
            {
                foreach (UsingDirective u in codeUnit.UsingDirectives)
                {
                    CacheUsing(u);
                    IList<Type> types = null;
                    Types.TryGetValue(u.Text, out types);
                    if (types != null)
                    {
                        AddTypes(types, typeListToFill);
                    }
                }
            }
        }
コード例 #3
0
        public IEnumerable <TextPictureInfo> GetTypeList(
            ClassOrStructBlock callingClass)
        {
            ListSet <TextPictureInfo> results = new ListSet <TextPictureInfo>();

            FillTypeList(callingClass, results);
            return(results);
        }
コード例 #4
0
        public void FillTypeItems(
			ClassOrStructBlock callingClass,
			ICompletionListBuilder items)
        {
            ListSet<TextPictureInfo> result = new ListSet<TextPictureInfo>();
            FillTypeList(callingClass, result);
            foreach (TextPictureInfo t in result)
            {
                items.AddText(t.Text, t.Picture);
            }
        }
コード例 #5
0
        public void FillTypeItems(
            ClassOrStructBlock callingClass,
            ICompletionListBuilder items)
        {
            ListSet <TextPictureInfo> result = new ListSet <TextPictureInfo>();

            FillTypeList(callingClass, result);
            foreach (TextPictureInfo t in result)
            {
                items.AddText(t.Text, t.Picture);
            }
        }
コード例 #6
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;
        }
コード例 #7
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);
                }
            }
        }
コード例 #8
0
        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);
                    }
                }
            }
        }
コード例 #9
0
        public IEnumerable<TextPictureInfo> GetTypeList(
			ClassOrStructBlock callingClass)
        {
            ListSet<TextPictureInfo> results = new ListSet<TextPictureInfo>();
            FillTypeList(callingClass, results);
            return results;
        }