Beispiel #1
0
        private void listViewUniverse_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            FlickerFreeListView myListView = (FlickerFreeListView)sender;

            // Determine if clicked column is already the column that is being sorted.
            if (e.Column == myListView.ListViewColumnSorter.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (myListView.ListViewColumnSorter.Order == SortOrder.Ascending)
                {
                    myListView.ListViewColumnSorter.Order = SortOrder.Descending;
                }
                else
                {
                    myListView.ListViewColumnSorter.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                myListView.ListViewColumnSorter.SortColumn = e.Column;
                myListView.ListViewColumnSorter.Order      = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            myListView.ListViewItemSorter = myListView.ListViewColumnSorter;
            myListView.Sort();
        }
Beispiel #2
0
        public IceTabPageDCC(WindowType windowType, string sCaption) : base(windowType, sCaption)
        {
            this.dccFileList = new FlickerFreeListView();
            this.dccFileList.SuspendLayout();
            this.SuspendLayout();

            Panel dccPanel = new Panel();

            dccPanel.BackColor = Color.LightGray;
            dccPanel.Size      = new Size(this.Width, 55);
            dccPanel.Dock      = DockStyle.Bottom;

            Button dccCancel = new Button();

            dccCancel.Name     = "dccCancel";
            dccCancel.Click   += new EventHandler(dccCancel_Click);
            dccCancel.Location = new Point(5, 5);
            dccCancel.Size     = new Size(100, 35);
            dccCancel.Text     = "Cancel";
            dccCancel.Font     = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dccCancel.UseVisualStyleBackColor = true;
            dccPanel.Controls.Add(dccCancel);

            Button dccOpen = new Button();

            dccOpen.Name     = "dccOpen";
            dccOpen.Click   += new EventHandler(dccOpen_Click);
            dccOpen.Location = new Point(110, 5);
            dccOpen.Size     = new Size(100, 35);
            dccOpen.Text     = "Open Folder";
            dccOpen.Font     = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dccOpen.UseVisualStyleBackColor = true;
            dccPanel.Controls.Add(dccOpen);

            Button dccRemove = new Button();

            dccRemove.Name     = "dccRemove";
            dccRemove.Click   += new EventHandler(dccRemove_Click);
            dccRemove.Location = new Point(220, 5);
            dccRemove.Size     = new Size(100, 35);
            dccRemove.Text     = "Remove";
            dccRemove.Font     = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dccRemove.UseVisualStyleBackColor = true;
            dccPanel.Controls.Add(dccRemove);

            this.dccFileList.Dock          = DockStyle.Fill;
            this.dccFileList.Font          = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dccFileList.View          = View.Details;
            this.dccFileList.MultiSelect   = false;
            this.dccFileList.FullRowSelect = true;
            this.dccFileList.HideSelection = false;
            this.dccFileList.DoubleClick  += new EventHandler(dccFileList_DoubleClick);

            ColumnHeader fn = new ColumnHeader();

            fn.Text  = "File Name";
            fn.Width = 250;
            fn.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
            this.dccFileList.Columns.Add(fn);

            ColumnHeader n = new ColumnHeader();

            n.Text  = "Nick";
            n.Width = 100;
            this.dccFileList.Columns.Add(n);

            ColumnHeader fs = new ColumnHeader();

            fs.Text  = "File Size";
            fs.Width = 200;
            this.dccFileList.Columns.Add(fs);

            ColumnHeader s = new ColumnHeader();

            s.Text  = "Status";
            s.Width = 150;
            s.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
            this.dccFileList.Columns.Add(s);

            //store the dcc file style (upload/download)
            ColumnHeader st = new ColumnHeader();

            st.Text  = "Style";
            st.Width = 0;
            st.AutoResize(ColumnHeaderAutoResizeStyle.None);
            this.dccFileList.Columns.Add(st);
            this.dccFileList.Columns[4].Width = 0;

            //store the path/folder for the dcc file
            ColumnHeader pa = new ColumnHeader();

            pa.Text  = "Path";
            pa.Width = 0;
            pa.AutoResize(ColumnHeaderAutoResizeStyle.None);
            this.dccFileList.Columns.Add(pa);
            this.dccFileList.Columns[5].Width = 0;

            this.Controls.Add(dccFileList);
            this.Controls.Add(dccPanel);
            this.dccFileList.ResumeLayout(false);
            this.ResumeLayout(false);


            dccFiles = new List <DccFileStruct>();
        }
        private void InitializeComponent()
        {
            this.dccFileList = new FlickerFreeListView();
            this.dccFileList.SuspendLayout();
            this.SuspendLayout();

            Panel dccPanel = new Panel();
            dccPanel.BackColor = Color.LightGray;
            dccPanel.Size = new Size(this.Width, 45);
            dccPanel.Dock = DockStyle.Bottom;

            Button dccCancel = new Button();
            dccCancel.Name = "dccCancel";
            dccCancel.Click += new EventHandler(dccCancel_Click);
            dccCancel.Location = new Point(5, 5);
            dccCancel.Size = new Size(100, 35);
            dccCancel.Text = "Cancel";
            dccCancel.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dccCancel.UseVisualStyleBackColor = true;
            dccPanel.Controls.Add(dccCancel);

            Button dccOpen = new Button();
            dccOpen.Name = "dccOpen";
            dccOpen.Click += new EventHandler(dccOpen_Click);
            dccOpen.Location = new Point(110, 5);
            dccOpen.Size = new Size(100, 35);
            dccOpen.Text = "Open Folder";
            dccOpen.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dccOpen.UseVisualStyleBackColor = true;
            dccPanel.Controls.Add(dccOpen);

            Button dccRemove = new Button();
            dccRemove.Name = "dccRemove";
            dccRemove.Click += new EventHandler(dccRemove_Click);
            dccRemove.Location = new Point(220, 5);
            dccRemove.Size = new Size(100, 35);
            dccRemove.Text = "Remove";
            dccRemove.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dccRemove.UseVisualStyleBackColor = true;
            dccPanel.Controls.Add(dccRemove);

            Button dccResend = new Button();
            dccResend.Name = "dccResend";
            dccResend.Click += new EventHandler(dccResend_Click);
            dccResend.Location = new Point(330, 5);
            dccResend.Size = new Size(100, 35);
            dccResend.Text = "Resend";
            dccResend.Visible = false;
            dccResend.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dccResend.UseVisualStyleBackColor = true;
            dccPanel.Controls.Add(dccResend);

            this.dccFileList.Dock = DockStyle.Fill;
            this.dccFileList.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.dccFileList.View = View.Details;
            this.dccFileList.ShowItemToolTips = true;
            this.dccFileList.MultiSelect = false;
            this.dccFileList.FullRowSelect = true;
            this.dccFileList.HideSelection = false;
            this.dccFileList.DoubleClick += new EventHandler(dccFileList_DoubleClick);

            ColumnHeader fn = new ColumnHeader();
            fn.Text = "File Name";
            fn.Width = 200;
            fn.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
            this.dccFileList.Columns.Add(fn);

            ColumnHeader n = new ColumnHeader();
            n.Text = "Nick";
            n.Width = 80;
            this.dccFileList.Columns.Add(n);

            ColumnHeader fs = new ColumnHeader();
            fs.Text = "File Size";
            fs.Width = 200;
            this.dccFileList.Columns.Add(fs);

            ColumnHeader sp = new ColumnHeader();
            sp.Text = "Speed";
            sp.Width = 100;
            this.dccFileList.Columns.Add(sp);

            ColumnHeader el = new ColumnHeader();
            el.Text = "Elapsed";
            el.Width = 100;
            this.dccFileList.Columns.Add(el);

            ColumnHeader s = new ColumnHeader();
            s.Text = "Status";
            s.Width = 100;
            s.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
            this.dccFileList.Columns.Add(s);

            //store the dcc file style (upload/download)
            ColumnHeader st = new ColumnHeader();
            st.Text = "Style";
            st.Width = 0;
            st.AutoResize(ColumnHeaderAutoResizeStyle.None);
            this.dccFileList.Columns.Add(st);
            this.dccFileList.Columns[6].Width = 0;

            //store the server id of the connection
            ColumnHeader sid = new ColumnHeader();
            sid.Text = "ServerID";
            sid.Width = 0;
            sid.AutoResize(ColumnHeaderAutoResizeStyle.None);
            this.dccFileList.Columns.Add(sid);
            this.dccFileList.Columns[7].Width = 0;

            //store the path/folder for the dcc file
            ColumnHeader pa = new ColumnHeader();
            pa.Text = "Path";
            pa.Width = 0;
            pa.AutoResize(ColumnHeaderAutoResizeStyle.None);
            this.dccFileList.Columns.Add(pa);
            this.dccFileList.Columns[8].Width = 0;

            this.Controls.Add(dccFileList);
            this.Controls.Add(dccPanel);
            this.dccFileList.ResumeLayout(false);
            this.ResumeLayout(false);
        }