Пример #1
0
        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (DesignMode)
                return;

            var directoryInfo = GetCurrentDirectory().Directory;

            var render = FileViewRender.GetRender(this);
            var provider = new DirectoryProvider(directoryInfo, Sort, SortDirection, SearchTerm);

            render.RenderBeginList(writer);

            foreach (FileSystemInfo fsi in provider.GetFileSystemInfos())
            {
                var item = new FileViewItem(directoryInfo, fsi, this);

                if (!ShowHiddenFilesAndFolders && item.Hidden)
                    continue;

                render.RenderItem(writer, item);
            }

            render.RenderEndList(writer);
            RenderInitScript(writer);
        }
Пример #2
0
        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (DesignMode)
                return;

            DirectoryInfo directoryInfo = GetCurrentDirectory ().Directory;

            FileViewRender render = FileViewRender.GetRender (this);
            DirectoryProvider provider = new DirectoryProvider (directoryInfo, Sort, SortDirection);

            render.RenderBeginList (writer);

            //FileViewItem upDirectory = new FileViewUpDirectoryItem(directoryInfo.Parent, this);
            //render.RenderItem(output, upDirectory);

            //if (ShowInGroups) {
            //    GroupInfo [] groups = provider.GetGroups ();
            //    foreach (GroupInfo group in groups) {
            //        render.RenderBeginGroup (writer, group);
            //        foreach (FileSystemInfo fsi in provider.GetFileSystemInfos (group)) {
            //            FileViewItem item = new FileViewItem (fsi, this);
            //            render.RenderItem (writer, item);
            //        }

            //        render.RenderEndGroup (writer, group);
            //    }
            //}
            //else {
                foreach (FileSystemInfo fsi in provider.GetFileSystemInfos ()) {
                    FileViewItem item = new FileViewItem (fsi, this);

                    if (!ShowHiddenFilesAndFolders && item.Hidden)
                        continue;

                    render.RenderItem (writer, item);
                }
            //}

            render.RenderEndList (writer);
            RenderInitScript (writer);
        }