/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns>A hash code for the current object.</returns> public override int GetHashCode() { unchecked { int result = 17; result = result * 23 + Id.GetHashCode(); result = result * 23 + ((Name != null) ? Name.GetHashCode() : 0); result = result * 23 + Type.GetHashCode(); result = result * 23 + ShowInActions.GetHashCode(); result = result * 23 + RowFilterEnabled.GetHashCode(); result = result * 23 + SummaryRowEnabled.GetHashCode(); result = result * 23 + ((SummaryRow != null) ? SummaryRow.GetHashCode() : 0); result = result * 23 + MultiSortEnabled.GetHashCode(); result = result * 23 + RequiresFilter.GetHashCode(); result = result * 23 + ((WaitForInputData != null) ? WaitForInputData.GetHashCode() : 0); result = result * 23 + ((Fields != null) ? Fields.GetHashCode() : 0); result = result * 23 + ((FieldGroups != null) ? FieldGroups.GetHashCode() : 0); result = result * 23 + ((MultiSort != null) ? MultiSort.GetHashCode() : 0); result = result * 23 + ((Filters != null) ? Filters.GetHashCode() : 0); result = result * 23 + ((Pages != null) ? Pages.GetHashCode() : 0); result = result * 23 + ((Layout != null) ? Layout.GetHashCode() : 0); result = result * 23 + SelectionMode.GetHashCode(); result = result * 23 + ((DoubleClickAction != null) ? DoubleClickAction.GetHashCode() : 0); result = result * 23 + ((UseAsBrowser != null) ? UseAsBrowser.GetHashCode() : 0); result = result * 23 + ((UseAsBrowserRank != null) ? UseAsBrowserRank.GetHashCode() : 0); result = result * 23 + ((UseAsBrowserDefaultCode != null) ? UseAsBrowserDefaultCode.GetHashCode() : 0); result = result * 23 + ((Pivot != null) ? Pivot.GetHashCode() : 0); return(result); } }
public void AddGrid(string name, string label, DoubleClickAction type, DataTable datatable) { var newGrid = GetNewGrid(name, label + " (" + datatable.Rows.Count.ToString() + " rows)", type); FillGrid(newGrid, datatable); gridList.Add(newGrid); }
public void doubleClick() { DoubleClickAction dblClickAction = new DoubleClickAction(cs.MenuGroup, "My Double click", -1); dblClickAction.Description = "Double Click Customization"; dblClickAction.ElementID = "EID_mydblclick"; dblClickAction.DxfName = "Polyline"; DoubleClickCmd dblClickCmd = new DoubleClickCmd(dblClickAction); dblClickCmd.MacroID = "ID_Ai_propch"; dblClickAction.DoubleClickCmd = dblClickCmd; }
private void 显示RJ信息ToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem item = sender as ToolStripMenuItem; if (item.Checked) // 此时选中状态已经被切换 { doubleClickMode = DoubleClickAction.OpenFile; (item.Tag as ToolStripMenuItem).CheckState = CheckState.Unchecked; } else { doubleClickMode = DoubleClickAction.ViewRJInfo; (item.Tag as ToolStripMenuItem).CheckState = CheckState.Checked; } }
private DataGridView GetNewGrid(string name, string label, DoubleClickAction type) { DataGridView newGrid = new DataGridView(); var gridLabel = label; newGrid.Name = name; newGrid.Dock = DockStyle.Fill; newGrid.RowHeadersVisible = false; newGrid.EditMode = DataGridViewEditMode.EditProgrammatically; newGrid.AllowUserToResizeRows = false; newGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; newGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None; newGrid.AllowUserToAddRows = false; newGrid.AllowUserToDeleteRows = false; newGrid.Padding = new Padding(0, 0, 0, 10); newGrid.ContextMenuStrip = PopUpMenu; StyleFunctions.SetGridStyle(newGrid, ParentForm.GridTheme); newGrid.CellLeave += GridLeaveCell; newGrid.CellEnter += GridEnterCell; // Set double-click event according to specified action. switch (type) { case DoubleClickAction.ViewDevice: gridLabel += " - [Double-Click to view]"; newGrid.CellDoubleClick += DoubleClickDevice; break; case DoubleClickAction.SelectValue: newGrid.CellDoubleClick += DoubleClickSelect; break; case DoubleClickAction.ViewOnly: // Don't subscribe double-click event. break; } newGrid.Tag = gridLabel; newGrid.DoubleBuffered(true); return(newGrid); }
/// <summary> /// Sends a copy of this grid to a new <see cref="GridForm"/> instance. /// </summary> /// <param name="grid"></param> /// <param name="parentForm"></param> public static void CopyToGridForm(this DataGridView grid, ExtendedForm parentForm, DoubleClickAction type = DoubleClickAction.ViewOnly) { GridForm NewGridForm = new GridForm(parentForm, grid.Name + " Copy"); NewGridForm.AddGrid(grid.Name, grid.Name, type, ((DataTable)grid.DataSource).Copy()); NewGridForm.Show(); }
private string Write192_DoubleClickAction(DoubleClickAction v) { switch (v) { case DoubleClickAction.None: return "None"; case DoubleClickAction.GoToParent: return "GoToParent"; case DoubleClickAction.SelectAll: return "SelectAll"; case DoubleClickAction.UnselectAll: return "UnselectAll"; case DoubleClickAction.ToggleSelection: return "ToggleSelection"; } long num = (long) v; throw base.CreateInvalidEnumValueException(num.ToString(CultureInfo.InvariantCulture), "Nomad.DoubleClickAction"); }