Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewElement.cs / 1 / DataGridViewElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms { using System; using System.Drawing; using System.Diagnostics; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; ////// /// public class DataGridViewElement { private DataGridViewElementStates state; // enabled frozen readOnly resizable selected visible private DataGridView dataGridView; ///Identifies an element in the dataGridView (base class for TCell, TBand, TRow, TColumn. ////// /// public DataGridViewElement() { this.state = DataGridViewElementStates.Visible; } internal DataGridViewElement(DataGridViewElement dgveTemplate) { // Selected and Displayed states are not inherited this.state = dgveTemplate.State & (DataGridViewElementStates.Frozen | DataGridViewElementStates.ReadOnly | DataGridViewElementStates.Resizable | DataGridViewElementStates.ResizableSet | DataGridViewElementStates.Visible); } ////// Initializes a new instance of the ///class. /// [ Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced) ] public virtual DataGridViewElementStates State { get { return this.state; } } internal DataGridViewElementStates StateInternal { set { this.state = value; } } internal bool StateIncludes(DataGridViewElementStates elementState) { return (this.State & elementState) == elementState; } internal bool StateExcludes(DataGridViewElementStates elementState) { return (this.State & elementState) == 0; } /// [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public DataGridView DataGridView { get { return this.dataGridView; } } internal DataGridView DataGridViewInternal { set { if (this.DataGridView != value) { this.dataGridView = value; OnDataGridViewChanged(); } } } /// protected virtual void OnDataGridViewChanged() { } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseCellClick(DataGridViewCellEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnCellClickInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseCellContentClick(DataGridViewCellEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnCellContentClickInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseCellContentDoubleClick(DataGridViewCellEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnCellContentDoubleClickInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseCellValueChanged(DataGridViewCellEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnCellValueChangedInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseDataError(DataGridViewDataErrorEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnDataErrorInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseMouseWheel(MouseEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnMouseWheelInternal(e); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms { using System; using System.Drawing; using System.Diagnostics; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; ////// /// public class DataGridViewElement { private DataGridViewElementStates state; // enabled frozen readOnly resizable selected visible private DataGridView dataGridView; ///Identifies an element in the dataGridView (base class for TCell, TBand, TRow, TColumn. ////// /// public DataGridViewElement() { this.state = DataGridViewElementStates.Visible; } internal DataGridViewElement(DataGridViewElement dgveTemplate) { // Selected and Displayed states are not inherited this.state = dgveTemplate.State & (DataGridViewElementStates.Frozen | DataGridViewElementStates.ReadOnly | DataGridViewElementStates.Resizable | DataGridViewElementStates.ResizableSet | DataGridViewElementStates.Visible); } ////// Initializes a new instance of the ///class. /// [ Browsable(false), EditorBrowsable(EditorBrowsableState.Advanced) ] public virtual DataGridViewElementStates State { get { return this.state; } } internal DataGridViewElementStates StateInternal { set { this.state = value; } } internal bool StateIncludes(DataGridViewElementStates elementState) { return (this.State & elementState) == elementState; } internal bool StateExcludes(DataGridViewElementStates elementState) { return (this.State & elementState) == 0; } /// [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public DataGridView DataGridView { get { return this.dataGridView; } } internal DataGridView DataGridViewInternal { set { if (this.DataGridView != value) { this.dataGridView = value; OnDataGridViewChanged(); } } } /// protected virtual void OnDataGridViewChanged() { } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseCellClick(DataGridViewCellEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnCellClickInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseCellContentClick(DataGridViewCellEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnCellContentClickInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseCellContentDoubleClick(DataGridViewCellEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnCellContentDoubleClickInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseCellValueChanged(DataGridViewCellEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnCellValueChangedInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseDataError(DataGridViewDataErrorEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnDataErrorInternal(e); } } /// [SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")] // Method raises an event for the grid control protected void RaiseMouseWheel(MouseEventArgs e) { if (this.dataGridView != null) { this.dataGridView.OnMouseWheelInternal(e); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClientScriptManager.cs
- JsonReaderWriterFactory.cs
- FixedHighlight.cs
- SEHException.cs
- PointHitTestResult.cs
- InstanceDescriptor.cs
- TypeUsageBuilder.cs
- PagerSettings.cs
- NativeCompoundFileAPIs.cs
- XslAst.cs
- XmlQueryType.cs
- DiscoveryMessageSequenceCD1.cs
- DataService.cs
- RichTextBox.cs
- EntityViewContainer.cs
- UnhandledExceptionEventArgs.cs
- MSAAEventDispatcher.cs
- GeneralTransform3DCollection.cs
- BindingSource.cs
- SequenceFullException.cs
- CommunicationObjectAbortedException.cs
- XmlWrappingWriter.cs
- NavigationProperty.cs
- MediaElement.cs
- SafeCryptoHandles.cs
- HotSpot.cs
- PageCatalogPartDesigner.cs
- DataGridViewCellEventArgs.cs
- RectangleHotSpot.cs
- CursorConverter.cs
- Encoding.cs
- ProxyHelper.cs
- SqlDataSourceStatusEventArgs.cs
- DtdParser.cs
- LogicalExpressionTypeConverter.cs
- InvalidAsynchronousStateException.cs
- XmlUtil.cs
- HtmlElementEventArgs.cs
- WindowsListViewGroup.cs
- UserPreferenceChangingEventArgs.cs
- Stack.cs
- TraceHandler.cs
- CaseStatement.cs
- ValidatorCompatibilityHelper.cs
- BinaryObjectReader.cs
- SrgsElementFactory.cs
- ReverseInheritProperty.cs
- __TransparentProxy.cs
- ObjectListItem.cs
- Logging.cs
- IndependentlyAnimatedPropertyMetadata.cs
- EncodingTable.cs
- SingleConverter.cs
- TiffBitmapEncoder.cs
- ExpressionBindingCollection.cs
- AmbientValueAttribute.cs
- DatasetMethodGenerator.cs
- LoginCancelEventArgs.cs
- IntSecurity.cs
- WebPartConnectionsConfigureVerb.cs
- WebPartConnectionsConnectVerb.cs
- GatewayIPAddressInformationCollection.cs
- SystemInfo.cs
- TrimSurroundingWhitespaceAttribute.cs
- UserNamePasswordValidator.cs
- RowTypePropertyElement.cs
- Classification.cs
- DetailsViewAutoFormat.cs
- WorkerRequest.cs
- Maps.cs
- ProjectionCamera.cs
- PixelFormat.cs
- GridViewSortEventArgs.cs
- SuspendDesigner.cs
- HotSpotCollection.cs
- DetailsViewCommandEventArgs.cs
- Executor.cs
- EntitySetBase.cs
- Scripts.cs
- ByteBufferPool.cs
- ApplicationProxyInternal.cs
- FaultReasonText.cs
- EnumBuilder.cs
- OleDbErrorCollection.cs
- EditorBrowsableAttribute.cs
- RemotingConfiguration.cs
- PostBackOptions.cs
- WebPartConnectionsCancelVerb.cs
- CompilationPass2TaskInternal.cs
- RangeValueProviderWrapper.cs
- UniqueEventHelper.cs
- PropertyPushdownHelper.cs
- MsmqIntegrationValidationBehavior.cs
- StopStoryboard.cs
- ScaleTransform3D.cs
- MappingException.cs
- ProcessHost.cs
- VectorCollectionValueSerializer.cs
- OleDbParameterCollection.cs
- TableParagraph.cs