Exemplo n.º 1
0
        /// <summary>
        /// 基于TreeListView的资源浏览器
        /// 隐藏列依次为:
        ///		完整路径
        ///		HasChildren{-1:无,0:未知,1:有}
        ///		类型{1:Drive,2:Folder,3:File}
        /// </summary>
        public FSExplorer()
        {
            _imgList.ColorDepth       = ColorDepth.Depth32Bit;
            _imgList.ImageSize        = new Size(16, 16);
            _imgList.TransparentColor = Color.Transparent;

            // 添加显示的列
            Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                new System.Windows.Forms.ColumnHeader(),
                new System.Windows.Forms.ColumnHeader(),
                new System.Windows.Forms.ColumnHeader(),
                new System.Windows.Forms.ColumnHeader(),
                new System.Windows.Forms.ColumnHeader()
            });

            Columns[0].Name  = "Name";
            Columns[0].Text  = Apq.GlobalObject.UILang["名称"];
            Columns[0].Width = 400;

            Columns[1].Name      = "Size";
            Columns[1].Text      = Apq.GlobalObject.UILang["大小(B)"];
            Columns[1].Width     = 150;
            Columns[1].TextAlign = System.Windows.Forms.HorizontalAlignment.Right;

            Columns[2].Name  = "Type";
            Columns[2].Text  = Apq.GlobalObject.UILang["类型"];
            Columns[2].Width = 100;

            Columns[3].Name  = "CreationTime";
            Columns[3].Text  = Apq.GlobalObject.UILang["创建时间"];
            Columns[3].Width = 140;

            Columns[4].Name  = "LastWriteTime";
            Columns[4].Text  = Apq.GlobalObject.UILang["修改时间"];
            Columns[4].Width = 140;

            _Comparer1.Column    = 2;
            _Comparer1.SortOrder = System.Windows.Forms.SortOrder.None;

            Comparer       = _Comparer1;
            SmallImageList = _imgList;

            // 事件处理
            BeforeExpand         += new TreeListViewCancelEventHandler(FSExplorer_BeforeExpand);
            BeforeCollapse       += new TreeListViewCancelEventHandler(FSExplorer_BeforeCollapse);
            SelectedIndexChanged += new EventHandler(FSExplorer_SelectedIndexChanged);
        }
Exemplo n.º 2
0
		/// <summary>
		/// 基于TreeListView的资源浏览器
		/// 隐藏列依次为:
		///		完整路径
		///		HasChildren{-1:无,0:未知,1:有}
		///		类型{1:Drive,2:Folder,3:File}
		/// </summary>
		public FSExplorer()
		{
			_imgList.ColorDepth = ColorDepth.Depth32Bit;
			_imgList.ImageSize = new Size(16, 16);
			_imgList.TransparentColor = Color.Transparent;

			// 添加显示的列
			Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            new System.Windows.Forms.ColumnHeader(),
            new System.Windows.Forms.ColumnHeader(),
            new System.Windows.Forms.ColumnHeader(),
            new System.Windows.Forms.ColumnHeader(),
            new System.Windows.Forms.ColumnHeader()});

			Columns[0].Name = "Name";
			Columns[0].Text = Apq.GlobalObject.UILang["名称"];
			Columns[0].Width = 400;

			Columns[1].Name = "Size";
			Columns[1].Text = Apq.GlobalObject.UILang["大小(B)"];
			Columns[1].Width = 150;
			Columns[1].TextAlign = System.Windows.Forms.HorizontalAlignment.Right;

			Columns[2].Name = "Type";
			Columns[2].Text = Apq.GlobalObject.UILang["类型"];
			Columns[2].Width = 100;

			Columns[3].Name = "CreationTime";
			Columns[3].Text = Apq.GlobalObject.UILang["创建时间"];
			Columns[3].Width = 140;

			Columns[4].Name = "LastWriteTime";
			Columns[4].Text = Apq.GlobalObject.UILang["修改时间"];
			Columns[4].Width = 140;

			_Comparer1.Column = 2;
			_Comparer1.SortOrder = System.Windows.Forms.SortOrder.None;

			Comparer = _Comparer1;
			SmallImageList = _imgList;

			// 事件处理
			BeforeExpand += new TreeListViewCancelEventHandler(FSExplorer_BeforeExpand);
			BeforeCollapse += new TreeListViewCancelEventHandler(FSExplorer_BeforeCollapse);
			SelectedIndexChanged += new EventHandler(FSExplorer_SelectedIndexChanged);
		}