예제 #1
0
		internal virtual void RenderBeginGroup (HtmlTextWriter output, GroupInfo group) {
			output.AddStyleAttribute ("clear", "both");
			output.AddStyleAttribute (HtmlTextWriterStyle.Width, "100%");
			output.RenderBeginTag (HtmlTextWriterTag.Div);
			output.Write (HttpUtility.HtmlEncode (group.Name));
			output.RenderEndTag ();
		}
 internal override void RenderBeginGroup(HtmlTextWriter output, GroupInfo group)
 {
     output.RenderBeginTag (HtmlTextWriterTag.Tr);
     output.AddAttribute (HtmlTextWriterAttribute.Colspan, "4");
     output.RenderBeginTag (HtmlTextWriterTag.Td);
     base.RenderBeginGroup (output, group);
     output.RenderEndTag ();
     output.RenderEndTag ();
 }
        public GroupInfo[] GetGroups()
        {
            groups = new Hashtable ();
            FileSystemInfo [] fsis = GetFileSystemInfos ();

            ArrayList groupInfos = new ArrayList ();

            switch (sort) {
            case SortMode.Name:
                Hashtable letters = new Hashtable ();
                foreach (FileSystemInfo fsi in fsis) {
                    string l = fsi.Name.Substring (0, 1).ToUpper (CultureInfo.InvariantCulture);
                    GroupInfo gi = (GroupInfo) letters [l];
                    if (gi == null) {
                        gi = new GroupInfo (l);
                        letters [l] = gi;
                    }
                    ArrayList gfsis = (ArrayList) groups [gi];
                    if (gfsis == null) {
                        gfsis = new ArrayList ();
                        groups [gi] = gfsis;
                        groupInfos.Add (gi);
                    }
                    gfsis.Add (fsi);
                }
                GroupInfo [] gis = (GroupInfo []) groupInfos.ToArray (typeof (GroupInfo));
                Array.Sort<GroupInfo> (gis, new Comparison<GroupInfo> (CompareGroupInfos));
                return gis;
            case SortMode.Modified:
                break;
            case SortMode.Type:
                break;
            case SortMode.Size:
                break;
            }

            return (GroupInfo []) groupInfos.ToArray (typeof (GroupInfo));
        }
 public FileSystemInfo[] GetFileSystemInfos(GroupInfo group)
 {
     return (FileSystemInfo []) ((ArrayList) groups [group]).ToArray (typeof (FileSystemInfo));
 }
        int CompareGroupInfos(GroupInfo gi1, GroupInfo gi2)
        {
            int res = 0;
            switch (sort) {
            case SortMode.Name:
                res = String.Compare (gi1.Name, gi2.Name);
                break;
            }

            if (sortDirection == SortDirection.Descending)
                res = -res;

            return res;
        }
예제 #6
0
 internal virtual void RenderEndGroup(HtmlTextWriter output, GroupInfo group)
 {
 }