コード例 #1
0
 /// <summary>
 /// Handles row selection on click, if the list latter is selectable.
 /// </summary>
 /// <param name="row">The row that was clicked.</param>
 protected virtual async Task RowClickedAsync(DataRow row)
 {
     if (SelectableClass != "")
     {
         if (RowSelected.HasDelegate)
         {
             await RowSelected.InvokeAsync(row);
         }
         else
         {
             List?.ToggleSelection(row);
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// 鼠标单击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void OnMouseClick(object sender, MouseEventArgs e)
 {
     if (_DragStartLocation != Point.Empty && e.X != _DragStartLocation.X && _DragStartLocation.Y != e.Y)
     {
         return;
     }
     if (IsHoverRowHeader(e.Location) || IsHoverRow(e.Location))
     {
         _SelectionRow = GetRow(e.Location);
         Invalidate();
         RowSelected?.Invoke(this, new GanttChartRowSelectedEventArgs(_SelectionRow));
     }
     if (IsHoverItem(e.Location))
     {
         _SelectionItem = GetItem(e.Location);
         Invalidate();
         ItemClick?.Invoke(this, new GanttChartItemClickEventArgs(_SelectionItem));
     }
 }
コード例 #3
0
ファイル: ListBox.cs プロジェクト: EReeves/gwen-net-ex
        private void SelectRow(ControlBase control, bool clearOthers = false)
        {
            if (!AllowMultiSelect || clearOthers)
            {
                UnselectAll();
            }

            ListBoxRow row = control as ListBoxRow;

            if (row == null)
            {
                return;
            }

            row.IsSelected = true;
            m_SelectedRows.Add(row);
            if (RowSelected != null)
            {
                RowSelected.Invoke(this, new ItemSelectedEventArgs(row));
            }
        }
コード例 #4
0
        /// <summary>
        /// Slelects the specified row.
        /// </summary>
        /// <param name="control">Row to select.</param>
        /// <param name="clearOthers">Determines whether to deselect previously selected rows.</param>
        public void SelectRow(Control control, bool clearOthers = false)
        {
            if (!AllowMultiSelect || clearOthers)
            {
                UnselectAll();
            }

            ListBoxRow row = control as ListBoxRow;

            if (row == null)
            {
                return;
            }

            // TODO: make sure this is one of our rows!
            row.IsSelected = true;
            m_SelectedRows.Add(row);
            if (RowSelected != null)
            {
                RowSelected.Invoke(this);
            }
        }
コード例 #5
0
ファイル: Repository.cs プロジェクト: crsswind/ORMapper
 protected virtual void OnRowSelected(EventArgs e)
 {
     RowSelected?.Invoke(this, e);
 }
コード例 #6
0
 /// <summary>
 /// 选择行
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvEntity_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     RowSelected?.Invoke(sender, e);
 }
コード例 #7
0
 public void SendRowSelected(Node node)
 {
     RowSelected?.Invoke(this, new NodeEventArgs(node));
 }
コード例 #8
0
 protected void gvOrders_SelectedIndexChanged(object sender, EventArgs e)
 {
     RowSelected?.Invoke(this, EventArgs.Empty);
 }