Exemple #1
0
        private IList <ContextMenuItem> createRegionMenuItems()
        {
            if (_regionList != null && _regionList.Any())
            {
                var ret = new List <ContextMenuItem>();
                // show unique reginos by name
                var uniqueRegions =
                    _regionList.GroupBy(x => x.Name).Select(y => new { Name = y.Key, LineNumber = y.First().LineNumber });

                foreach (var r in uniqueRegions)
                {
                    var m = new ContextMenuItem();
                    m.Caption = r.Name;
                    m.Command = new GotoCodeLocationCommand(r.LineNumber, (linenumber) => fireGotoCodeLocation(linenumber));

                    /*
                     * if (r.Children != null)
                     * {
                     *
                     *
                     *  addChildMenus(r.Children, m);
                     * }
                     */

                    ret.Add(m);
                }

                return(ret);
            }
            return(null);
        }
Exemple #2
0
        private IList <ContextMenuItem> createViewMenuItems()
        {
            if (_views == null)
            {
                fireUpdateViews();
            }

            if (_views != null && _views.Any())
            {
                var ret = new List <ContextMenuItem>();

                foreach (var usage in _views)
                {
                    var m = new ContextMenuItem();

                    m.Caption     = usage.ViewTypeName;
                    m.Command     = new GotoViewCommand((ce, linenumber) => fireOpenProjectItem(usage.CodeElement(), linenumber), usage.CodeElement, usage.ViewTypeName);
                    m.ToolTipText = usage.ViewTypeName;

                    ret.Add(m);
                }

                return(ret);
            }
            return(null);
        }
Exemple #3
0
        private void addChildMenus(List <Region> children, ContextMenuItem parentContextMenuItem)
        {
            foreach (var r in children)
            {
                var m = new ContextMenuItem();
                m.Caption = r.Name;

                addChildMenus(r.Children, m);
                parentContextMenuItem.MenuItems.Add(m);
            }
        }
Exemple #4
0
        private IList <ContextMenuItem> createMethodMenuItems()
        {
            if (_methodList != null && _methodList.Any())
            {
                var ret = new List <ContextMenuItem>();

                foreach (var methodGroup in _methodList.OrderBy(x => x.SortOrder).OrderBy(x => x.LineNumber).GroupBy(x => x.Name))
                {
                    if (methodGroup.Count() > 1)
                    {
                        foreach (var method in methodGroup)
                        {
                            var m = new ContextMenuItem();
                            m.Caption     = method.Signature;
                            m.Command     = new GotoCodeLocationCommand(method.LineNumber, (linenumber) => fireGotoCodeLocation(linenumber));
                            m.ToolTipText = method.Comment;

                            ret.Add(m);
                        }
                    }
                    else
                    {
                        var method = methodGroup.First();
                        var m      = new ContextMenuItem();
                        m.Caption     = method.Name;
                        m.Command     = new GotoCodeLocationCommand(method.LineNumber, (linenumber) => fireGotoCodeLocation(linenumber));
                        m.ToolTipText = method.Comment;

                        ret.Add(m);
                    }
                }

                return(ret);
            }
            return(null);
        }
        private void addChildMenus(List<Region> children, ContextMenuItem parentContextMenuItem)
        {
            foreach (var r in children)
            {
                var m = new ContextMenuItem();
                m.Caption = r.Name;

                addChildMenus(r.Children, m);
                parentContextMenuItem.MenuItems.Add(m);

            }
        }
        private IList<ContextMenuItem> createRegionMenuItems()
        {
            if (_regionList != null && _regionList.Any())
            {

                var ret = new List<ContextMenuItem>();
                // show unique reginos by name
                var uniqueRegions =
                    _regionList.GroupBy(x => x.Name).Select(y => new { Name = y.Key, LineNumber = y.First().LineNumber });

                foreach (var r in uniqueRegions)
                {
                    var m = new ContextMenuItem();
                    m.Caption = r.Name;
                    m.Command = new GotoCodeLocationCommand(r.LineNumber, (linenumber) => fireGotoCodeLocation(linenumber));
                    /*
                    if (r.Children != null)
                    {


                        addChildMenus(r.Children, m);
                    }
                    */

                    ret.Add(m);
                }

                return ret;
            }
            return null;
        }
        private IList<ContextMenuItem> createMethodMenuItems()
        {
            if (_methodList != null && _methodList.Any())
            {

                var ret = new List<ContextMenuItem>();

                foreach (var methodGroup in _methodList.OrderBy(x => x.SortOrder ).OrderBy(x => x.LineNumber ).GroupBy(x => x.Name ))
                {
                    
                    if (methodGroup.Count() > 1)
                    {
                        foreach (var method in methodGroup)
                        {
                            var m = new ContextMenuItem();
                            m.Caption = method.Signature ;
                            m.Command = new GotoCodeLocationCommand(method.LineNumber,(linenumber)=>fireGotoCodeLocation(linenumber ));
                            m.ToolTipText = method.Comment;

                            ret.Add(m);

                        }
                    }
                    else
                    {
                        var method = methodGroup.First();
                        var m = new ContextMenuItem();
                        m.Caption = method.Name;
                        m.Command = new GotoCodeLocationCommand(method.LineNumber, (linenumber) => fireGotoCodeLocation(linenumber));
                        m.ToolTipText = method.Comment;

                        ret.Add(m);


                    }

                }

                return ret;
            }
            return null;
        }
        private IList<ContextMenuItem> createViewMenuItems()
        {
            if (_views == null ) fireUpdateViews();

            if (_views != null && _views.Any())
            {

                var ret = new List<ContextMenuItem>();

                foreach (var usage in _views)
                {
                    var m = new ContextMenuItem();

                    m.Caption = usage.ViewTypeName;
                    m.Command = new GotoViewCommand((ce,linenumber)=> fireOpenProjectItem(usage.CodeElement(),linenumber), usage.CodeElement, usage.ViewTypeName );
                    m.ToolTipText = usage.ViewTypeName;

                    ret.Add(m);
                }

                return ret;
            }
            return null;
        }