Code:
/ DotNET / DotNET / 8.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
- ListBox.cs
- CodeSubDirectory.cs
- TextOnlyOutput.cs
- Misc.cs
- BooleanConverter.cs
- XmlChoiceIdentifierAttribute.cs
- JpegBitmapEncoder.cs
- IISUnsafeMethods.cs
- SqlCommandBuilder.cs
- HeaderedItemsControl.cs
- TextEditorCharacters.cs
- HierarchicalDataSourceControl.cs
- TextElementEnumerator.cs
- KeyFrames.cs
- AuthorizationRuleCollection.cs
- EncoderExceptionFallback.cs
- EntityCollection.cs
- Duration.cs
- DataGridColumnDropSeparator.cs
- DataTemplate.cs
- CompoundFileIOPermission.cs
- AstTree.cs
- AppManager.cs
- ProtectedConfiguration.cs
- DataErrorValidationRule.cs
- OleDbStruct.cs
- SqlBuffer.cs
- XPathDocument.cs
- SourceElementsCollection.cs
- Baml2006KeyRecord.cs
- StringInfo.cs
- CloudCollection.cs
- PenContexts.cs
- DataColumnPropertyDescriptor.cs
- ToolStripButton.cs
- Span.cs
- ScrollEvent.cs
- CodeAttributeArgumentCollection.cs
- ComponentEditorForm.cs
- WorkflowNamespace.cs
- RefreshPropertiesAttribute.cs
- QilLoop.cs
- ProcessModule.cs
- ConsumerConnectionPointCollection.cs
- Matrix.cs
- SecurityProtocol.cs
- NamespaceEmitter.cs
- HuffModule.cs
- OleCmdHelper.cs
- WebConfigurationManager.cs
- TimeSpanOrInfiniteConverter.cs
- ContextStack.cs
- TiffBitmapEncoder.cs
- NamedPipeTransportSecurity.cs
- EncoderReplacementFallback.cs
- UriWriter.cs
- DesignConnection.cs
- RequiredFieldValidator.cs
- CollectionConverter.cs
- MachineKeySection.cs
- X509CertificateTrustedIssuerElement.cs
- GridEntry.cs
- EventDescriptor.cs
- CompilerErrorCollection.cs
- IconConverter.cs
- Resources.Designer.cs
- CodeAttributeDeclaration.cs
- AssociationSetEnd.cs
- ItemMap.cs
- KeyBinding.cs
- CaseInsensitiveComparer.cs
- PeerResolver.cs
- SamlAuthorizationDecisionStatement.cs
- SqlServices.cs
- ValidationResult.cs
- Visual3D.cs
- DataStreamFromComStream.cs
- WebPartMenu.cs
- FunctionDetailsReader.cs
- DynamicQueryableWrapper.cs
- Compiler.cs
- CultureTable.cs
- WebEvents.cs
- ButtonFieldBase.cs
- GlyphRunDrawing.cs
- Point.cs
- CacheAxisQuery.cs
- CompilationUtil.cs
- JsonDeserializer.cs
- recordstatefactory.cs
- XmlWhitespace.cs
- ObjectStateFormatter.cs
- HMACMD5.cs
- IISMapPath.cs
- MsmqIntegrationElement.cs
- DocumentSchemaValidator.cs
- ToolStripDropTargetManager.cs
- CompilerLocalReference.cs
- Menu.cs
- LogEntrySerialization.cs