Exemplo n.º 1
0
        private void AddRegionsExtended(TreeNodeCollection tree, FileModel aFile)
        {
            int         endRegion = 0;
            int         index     = 0;
            MemberModel region    = null;
            MemberList  regions   = aFile.Regions;
            int         count     = regions.Count;

            for (index = 0; index < count; ++index)
            {
                region = regions[index];
                MemberTreeNode node = new MemberTreeNode(region, ICON_PACKAGE);
                tree.Add(node);

                endRegion = (index + 1 < count) ? regions[index + 1].LineFrom : int.MaxValue;

                MemberList regionMembers = new MemberList();
                foreach (MemberModel import in aFile.Imports)
                {
                    if (import.LineFrom >= region.LineFrom &&
                        import.LineTo <= endRegion)
                    {
                        regionMembers.Add(import);
                    }
                }

                foreach (MemberModel fileMember in aFile.Members)
                {
                    if (fileMember.LineFrom >= region.LineFrom &&
                        fileMember.LineTo <= endRegion)
                    {
                        regionMembers.Add(fileMember);
                    }
                }

                foreach (ClassModel cls in aFile.Classes)
                {
                    if (cls.LineFrom <= region.LineFrom)
                    {
                        foreach (MemberModel clsMember in cls.Members)
                        {
                            if (clsMember.LineFrom >= region.LineFrom &&
                                clsMember.LineTo <= endRegion)
                            {
                                regionMembers.Add(clsMember);
                            }
                        }
                    }
                    else if (cls.LineFrom >= region.LineFrom &&
                             cls.LineTo <= endRegion)
                    {
                        regionMembers.Add(cls);
                    }
                }
                AddMembers(node.Nodes, regionMembers);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Merge one item into the list
        /// </summary>
        /// <param name="item">Item to merge</param>
        public void Merge(MemberModel item)
        {
            MemberList list = new MemberList();

            list.Add(item);
            Merge(list, 0);
        }
Exemplo n.º 3
0
        public MemberList MultipleSearch(string name, FlagType mask)
        {
            MemberList result = new MemberList();

            foreach (MemberModel m in items)
            {
                if ((m.Name.Equals(name)) && ((m.Flags & mask) == mask))
                {
                    result.Add(m);
                }
            }
            return(result);
        }
Exemplo n.º 4
0
        private MemberList SelectMembers(MemberList list, FlagType mask)
        {
            MemberList filtered = new MemberList();
            Visibility acc      = Visibility.Public | Visibility.Internal;

            //MemberModel lastAdded = null;
            foreach (MemberModel item in list)
            {
                if ((item.Access & acc) > 0 && (item.Flags & mask) > 0)
                {
                    //if (lastAdded != null && lastAdded.Name == item.Name) continue;
                    //lastAdded = item;
                    filtered.Add(item);
                }
            }
            filtered.Sort();
            return(filtered);
        }
Exemplo n.º 5
0
        private void AddMembersSorted(TreeNodeCollection tree, MemberList members)
        {
            if (settings.SortingMode == OutlineSorting.None)
            {
                AddMembers(tree, members);
            }
            else if (settings.SortingMode == OutlineSorting.SortedGroup)
            {
                AddMembersGrouped(tree, members);
            }
            else
            {
                IComparer <MemberModel> comparer = null;
                if (settings.SortingMode == OutlineSorting.Sorted)
                {
                    comparer = null;
                }
                else if (settings.SortingMode == OutlineSorting.SortedByKind)
                {
                    comparer = new ByKindMemberComparer();
                }
                else if (settings.SortingMode == OutlineSorting.SortedSmart)
                {
                    comparer = new SmartMemberComparer();
                }
                else if (settings.SortingMode == OutlineSorting.SortedGroup)
                {
                    comparer = new ByKindMemberComparer();
                }

                MemberList copy = new MemberList();
                copy.Add(members);
                copy.Sort(comparer);
                AddMembers(tree, copy);
            }
        }
Exemplo n.º 6
0
        private void AddRegionsExtended(TreeNodeCollection tree, FileModel aFile)
        {
            int endRegion = 0;
            int index = 0;
            MemberModel region = null;
            MemberList regions = aFile.Regions;
            int count = regions.Count;
            for (index = 0; index < count; ++index)
            {
                region = regions[index];
                MemberTreeNode node = new MemberTreeNode(region, ICON_PACKAGE);
                tree.Add(node);

                endRegion = (index + 1 < count) ? regions[index + 1].LineFrom : int.MaxValue;

                MemberList regionMembers = new MemberList();
                foreach (MemberModel import in aFile.Imports)
                {
                    if (import.LineFrom >= region.LineFrom &&
                        import.LineTo <= endRegion)
                    {
                        regionMembers.Add(import);
                    }
                }

                foreach (MemberModel fileMember in aFile.Members)
                {
                    if (fileMember.LineFrom >= region.LineFrom &&
                        fileMember.LineTo <= endRegion)
                    {
                        regionMembers.Add(fileMember);
                    }
                }

                foreach (ClassModel cls in aFile.Classes)
                {
                    if (cls.LineFrom <= region.LineFrom)
                    {
                        foreach (MemberModel clsMember in cls.Members)
                        {
                            if (clsMember.LineFrom >= region.LineFrom &&
                                clsMember.LineTo <= endRegion)
                            {
                                regionMembers.Add(clsMember);
                            }
                        }
                    }
                    else if (cls.LineFrom >= region.LineFrom &&
                             cls.LineTo <= endRegion)
                    {
                        regionMembers.Add(cls);
                    }
                }
                AddMembers(node.Nodes, regionMembers);
            }
        }
Exemplo n.º 7
0
        private void AddMembersSorted(TreeNodeCollection tree, MemberList members)
        {
            if (settings.SortingMode == OutlineSorting.None)
            {
                AddMembers(tree, members);
            }
            else if (settings.SortingMode == OutlineSorting.SortedGroup)
            {
                AddMembersGrouped(tree, members);
            }
            else
            {
                IComparer<MemberModel> comparer = null;
                if (settings.SortingMode == OutlineSorting.Sorted)
                    comparer = null;
                else if (settings.SortingMode == OutlineSorting.SortedByKind)
                    comparer = new ByKindMemberComparer();
                else if (settings.SortingMode == OutlineSorting.SortedSmart)
                    comparer = new SmartMemberComparer();
                else if (settings.SortingMode == OutlineSorting.SortedGroup)
                    comparer = new ByKindMemberComparer();

                MemberList copy = new MemberList();
                copy.Add(members);
                copy.Sort(comparer);
                AddMembers(tree, copy);
            }
        }
Exemplo n.º 8
0
 private MemberList SelectMembers(MemberList list, FlagType mask)
 {
     MemberList filtered = new MemberList();
     Visibility acc = Visibility.Public | Visibility.Internal;
     //MemberModel lastAdded = null;
     foreach (MemberModel item in list)
         if ((item.Access & acc) > 0 && (item.Flags & mask) > 0)
         {
             //if (lastAdded != null && lastAdded.Name == item.Name) continue;
             //lastAdded = item;
             filtered.Add(item);
         }
     filtered.Sort();
     return filtered;
 }
Exemplo n.º 9
0
		/// <summary>
		/// Merge one item into the list
		/// </summary>
		/// <param name="item">Item to merge</param>
		public void Merge(MemberModel item)
		{
			MemberList list = new MemberList();
			list.Add(item);
			Merge(list, 0);
		}
Exemplo n.º 10
0
		public MemberList MultipleSearch(string name, FlagType mask) {
			MemberList result = new MemberList();
			foreach (MemberModel m in items)
				if ((m.Name.Equals(name)) && ((m.Flags & mask) == mask)) result.Add(m);
			return result;
		}