Esempio n. 1
0
        public CCommitsListView()
        {
            SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
            UpdateStyles();
            int value = 2;
            SystemParametersInfo(0x67, value, ref value, 0);
            ItemMouseHover += new System.Windows.Forms.ListViewItemMouseHoverEventHandler(this.m_lvCommitsInfo_ItemMouseHover);
            MouseClick += new System.Windows.Forms.MouseEventHandler(this.m_lvCommitsInfo_MouseClick);

            _emOprType =OperationTyPe.UNKNOWN;
            _szSourceSHA = string.Empty;
            _szTargetSHA = string.Empty;
            _szSourceFile = string.Empty;
            _szTargetFile = string.Empty;
            m_itmPreveHover = new ListViewItem();
        }
        public void Init ()
        {
            this.View = System.Windows.Forms.View.Details;
            MultiSelect = false;

            //AllowOrder ( false );     //默不能排序。
            AllowOrder ( true );        //默可以排序。
 
            //设定排序器.
            ListViewItemSorter = _sorter;
            _sorter.Order = SortOrder.Ascending;

            //消息响应函数。
            ColumnClick += new System.Windows.Forms.ColumnClickEventHandler ( this.OnColumnClick );
            ColumnWidthChanging += new System.Windows.Forms.ColumnWidthChangingEventHandler ( this.OnColWidthChanging );
            ItemMouseHover += new System.Windows.Forms.ListViewItemMouseHoverEventHandler ( this.OnItemMouseHover );
            ColumnWidthChanged += new System.Windows.Forms.ColumnWidthChangedEventHandler ( this.OnColumnWidthChanged );

            //
            SetStyle ();

            //RestoreColWidth ();   

            //
            SetDefaultAllOrderType ();

            //SaveColW();
        }