Example #1
0
 public virtual void CompletionAddControlStructures(ICompletionListBuilder items)
 {
     AddControlStructure <IfBlock>("if", items);
     if (this.Prev is IfBlock || this.Prev is ElseBlock)
     {
         AddControlStructure <ElseBlock>("else", items);
     }
     AddControlStructure <WhileBlock>("while", items);
     AddControlStructure <DoWhileBlock>("do", items);
     AddControlStructure <ForBlock>("for", items);
     AddControlStructure <ForeachBlock>("foreach", items);
     AddControlStructure <LockBlock>("lock", items);
     AddControlStructure <TryBlock>("try", items);
     if (this.Prev is TryBlock || this.Prev is CatchBlock)
     {
         AddControlStructure <CatchBlock>("catch", items);
         AddControlStructure <FinallyBlock>("finally", items);
     }
     AddControlStructure <UsingStatementBlock>("using", items);
     if (this.Next == null && ClassNavigator.FindContainingControlStructure(this) != null)
     {
         AddControlStructure <BreakStatement>("break", items);
         AddControlStructure <ContinueStatement>("continue", items);
     }
 }
        void FillBreadcrumb()
        {
            Block         block   = CodeUnit.ActiveBlock;
            List <string> classes = new List <string>();

            foreach (ClassOrStructBlock c in ClassNavigator.FindContainingClassOrStructs(block))
            {
                classes.Insert(0, c.Name);
            }
            string[] classesArray  = classes.ToArray();
            string   classesString = "";

            if (classesArray.Length > 0)
            {
                classesString = string.Join(".", classesArray);
            }
            MethodBlock method       = ClassNavigator.FindContainingMethod(block);
            string      methodString = "";

            if (method != null)
            {
                methodString = method.Name;
            }

            Breadcrumb.Text = classesString + "." + methodString;
        }
Example #3
0
        public string GetFullName()
        {
            string path = ClassNavigator.GetFullPath(this);

            if (!string.IsNullOrEmpty(path))
            {
                path += ".";
            }
            path += Name;
            return(path);
        }
Example #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;
        }
Example #5
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);
                    }
                }
            }
        }
Example #7
0
 private ContainerBlock FindNearestControlStructureParent()
 {
     return(ClassNavigator.FindContainingControlStructure(this));
 }