Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProfileService.cs
- CheckBox.cs
- FullTextBreakpoint.cs
- CheckBoxDesigner.cs
- JavascriptCallbackMessageInspector.cs
- Interlocked.cs
- QueryCacheKey.cs
- CheckoutException.cs
- TextRunCacheImp.cs
- ToolZone.cs
- ProcessRequestArgs.cs
- EntityTypeBase.cs
- Perspective.cs
- StorageBasedPackageProperties.cs
- RadioButtonPopupAdapter.cs
- SchemaImporterExtensionsSection.cs
- QueuePathDialog.cs
- RotateTransform.cs
- TcpProcessProtocolHandler.cs
- IODescriptionAttribute.cs
- RepeatButton.cs
- PathGeometry.cs
- PeerInputChannelListener.cs
- LabelLiteral.cs
- TogglePatternIdentifiers.cs
- PrePostDescendentsWalker.cs
- InputBuffer.cs
- _NtlmClient.cs
- ObjectQuery_EntitySqlExtensions.cs
- PropertyGridCommands.cs
- ExpressionCopier.cs
- DataColumnPropertyDescriptor.cs
- PolyLineSegmentFigureLogic.cs
- ResourceSet.cs
- ApplicationActivator.cs
- LocatorBase.cs
- BasePattern.cs
- SqlWriter.cs
- SqlDataSourceFilteringEventArgs.cs
- NavigationWindowAutomationPeer.cs
- XmlDocument.cs
- JsonWriter.cs
- Variant.cs
- WebBrowserContainer.cs
- SpellerHighlightLayer.cs
- SelectedGridItemChangedEvent.cs
- Command.cs
- NewArray.cs
- FileDataSourceCache.cs
- Tag.cs
- SnapshotChangeTrackingStrategy.cs
- LinkUtilities.cs
- DragDeltaEventArgs.cs
- DashStyles.cs
- RegexReplacement.cs
- XmlSchemaSet.cs
- SoapIgnoreAttribute.cs
- ByteStack.cs
- ThreadPool.cs
- FileVersionInfo.cs
- XmlElement.cs
- Vector3D.cs
- ApplicationServicesHostFactory.cs
- JournalEntry.cs
- PointConverter.cs
- TcpStreams.cs
- PropertyStore.cs
- FormViewDeleteEventArgs.cs
- Types.cs
- WorkflowDesignerMessageFilter.cs
- TailCallAnalyzer.cs
- TreeViewBindingsEditor.cs
- Vector3dCollection.cs
- AppModelKnownContentFactory.cs
- RSAPKCS1SignatureDeformatter.cs
- BitmapFrameEncode.cs
- InternalBufferOverflowException.cs
- TrackingRecord.cs
- HttpResponseBase.cs
- TextBox.cs
- ChannelManagerHelpers.cs
- InvalidComObjectException.cs
- WebServiceData.cs
- ToolStripContentPanelRenderEventArgs.cs
- AuthStoreRoleProvider.cs
- ColorBuilder.cs
- SqlDependencyListener.cs
- ListBoxItemAutomationPeer.cs
- ContentElement.cs
- DataSourceBooleanViewSchemaConverter.cs
- SerializationObjectManager.cs
- SessionSwitchEventArgs.cs
- DrawingCollection.cs
- KeyFrames.cs
- ISO2022Encoding.cs
- GcSettings.cs
- XmlDataSource.cs
- HistoryEventArgs.cs
- XslAstAnalyzer.cs
- Color.cs