/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// componentchangingeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this ComponentChangingEventHandler componentchangingeventhandler, Object sender, ComponentChangingEventArgs e, AsyncCallback callback) { if (componentchangingeventhandler == null) { throw new ArgumentNullException("componentchangingeventhandler"); } return(componentchangingeventhandler.BeginInvoke(sender, e, callback, null)); }
/// <summary> /// Initializes a new instance of the UpgradeHelpers.Windows.Forms.ExtendedGridView class with the corresponding container /// </summary> /// <param name="container">The container where the Grid is going to be hosted</param> public DataGridViewFlex(IContainer container) { DoubleBuffered = true; InitializeComponent(); _controlKeyDown = new KeyEventHandler(control_KeyDown); _controlKeyUp = new KeyEventHandler(control_KeyUp); _controlKeyPress = new KeyPressEventHandler(control_KeyPress); this.CellMouseEnter -= new DataGridViewCellEventHandler(ExtendedDataGridView_CellMouseEnter); this.CellMouseEnter += new DataGridViewCellEventHandler(ExtendedDataGridView_CellMouseEnter); this.RowHeaderMouseClick += ExtendedDataGridView_RowHeaderMouseClick; isInitializing = false; Reset(); #region Designer related code IServiceContainer serviceContainer = container as IServiceContainer; if (serviceContainer != null) { ExtendedDataGridViewPropertyFilter newMyFilter = new ExtendedDataGridViewPropertyFilter(); DesignerActionService designerActionService = serviceContainer.GetService(typeof(DesignerActionService)) as DesignerActionService; //DesignerActionUIService designerActionUIService = serviceContainer.GetService(typeof(DesignerActionUIService)) as DesignerActionUIService; newMyFilter.oldService = (ITypeDescriptorFilterService)serviceContainer.GetService(typeof(ITypeDescriptorFilterService)); newMyFilter.designerActionService = designerActionService; //newMyFilter.designerActionUIService = designerActionUIService; if (newMyFilter.oldService != null) { serviceContainer.RemoveService(typeof(ITypeDescriptorFilterService)); } serviceContainer.AddService(typeof(ITypeDescriptorFilterService), newMyFilter); } // Acquire a reference to IComponentChangeService //This service is used during design to make sure that we do not allow the user //to edit Columns properties when the grid is in MSFlexGrid compatibility IComponentChangeService changeService = container as IComponentChangeService; if (changeService != null) { changeEventHandler = new ComponentChangingEventHandler(changeService_ComponentChanging); changeService.ComponentChanging -= changeEventHandler; changeService.ComponentChanging += changeEventHandler; } #endregion }
/// <summary> /// Initializes a new instance of the UpgradeHelpers.Windows.Forms.ExtendedGridView class with the corresponding container /// </summary> /// <param name="container">The container where the Grid is going to be hosted</param> public DataGridViewFlex(IContainer container) { InitializeComponent(); _controlKeyDown = new KeyEventHandler(control_KeyDown); _controlKeyUp = new KeyEventHandler(control_KeyUp); _controlKeyPress = new KeyPressEventHandler(control_KeyPress); this.CellMouseEnter -= new DataGridViewCellEventHandler(ExtendedDataGridView_CellMouseEnter); this.CellMouseEnter += new DataGridViewCellEventHandler(ExtendedDataGridView_CellMouseEnter); this.RowHeaderMouseClick += ExtendedDataGridView_RowHeaderMouseClick; isInitializing = false; Reset(); #region Designer related code IServiceContainer serviceContainer = container as IServiceContainer; if (serviceContainer != null) { ExtendedDataGridViewPropertyFilter newMyFilter = new ExtendedDataGridViewPropertyFilter(); DesignerActionService designerActionService = serviceContainer.GetService(typeof(DesignerActionService)) as DesignerActionService; //DesignerActionUIService designerActionUIService = serviceContainer.GetService(typeof(DesignerActionUIService)) as DesignerActionUIService; newMyFilter.oldService = (ITypeDescriptorFilterService)serviceContainer.GetService(typeof(ITypeDescriptorFilterService)); newMyFilter.designerActionService = designerActionService; //newMyFilter.designerActionUIService = designerActionUIService; if (newMyFilter.oldService != null) { serviceContainer.RemoveService(typeof(ITypeDescriptorFilterService)); } serviceContainer.AddService(typeof(ITypeDescriptorFilterService), newMyFilter); } // Acquire a reference to IComponentChangeService //This service is used during design to make sure that we do not allow the user //to edit Columns properties when the grid is in MSFlexGrid compatibility IComponentChangeService changeService = container as IComponentChangeService; if (changeService != null) { changeEventHandler = new ComponentChangingEventHandler(changeService_ComponentChanging); changeService.ComponentChanging -= changeEventHandler; changeService.ComponentChanging += changeEventHandler; } #endregion }