Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DiagnosticStrings.cs
- StreamResourceInfo.cs
- XmlDocumentType.cs
- StructuralType.cs
- InstalledFontCollection.cs
- PointCollection.cs
- SchemaNames.cs
- DesignerHelpers.cs
- SqlConnectionPoolProviderInfo.cs
- DecoderFallback.cs
- SqlClientFactory.cs
- PrefixHandle.cs
- XmlILTrace.cs
- StringToken.cs
- AccessibleObject.cs
- DesignColumnCollection.cs
- NamedPipeTransportSecurityElement.cs
- Queue.cs
- SynchronizationFilter.cs
- DockProviderWrapper.cs
- ClosableStream.cs
- DragCompletedEventArgs.cs
- JpegBitmapEncoder.cs
- XmlSchemaAnyAttribute.cs
- TableTextElementCollectionInternal.cs
- GridViewRowPresenterBase.cs
- EncodingFallbackAwareXmlTextWriter.cs
- DataGridViewCellStyleConverter.cs
- StreamReader.cs
- AdPostCacheSubstitution.cs
- ChildrenQuery.cs
- ZipIOCentralDirectoryFileHeader.cs
- DesignerSerializationVisibilityAttribute.cs
- SqlParameterCollection.cs
- CustomSignedXml.cs
- SystemSounds.cs
- UnauthorizedAccessException.cs
- DataGridItemEventArgs.cs
- StrongNameUtility.cs
- MsmqEncryptionAlgorithm.cs
- XmlCustomFormatter.cs
- NoneExcludedImageIndexConverter.cs
- KeyGestureValueSerializer.cs
- DictionarySurrogate.cs
- SqlError.cs
- ListSourceHelper.cs
- HostedImpersonationContext.cs
- _Semaphore.cs
- Table.cs
- SqlDataSource.cs
- OracleRowUpdatedEventArgs.cs
- ListBox.cs
- Propagator.ExtentPlaceholderCreator.cs
- TextRange.cs
- Stroke.cs
- BaseProcessor.cs
- UnionCodeGroup.cs
- ApplicationProxyInternal.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ColorMatrix.cs
- XsdCachingReader.cs
- FileNotFoundException.cs
- CatalogPart.cs
- UriScheme.cs
- FunctionDescription.cs
- EncoderBestFitFallback.cs
- StorageScalarPropertyMapping.cs
- Style.cs
- PanelDesigner.cs
- CreateUserWizard.cs
- MimeBasePart.cs
- InvokePattern.cs
- SendMailErrorEventArgs.cs
- NamedPipeTransportSecurity.cs
- PlainXmlWriter.cs
- DataServiceQueryContinuation.cs
- StylusLogic.cs
- ListBox.cs
- XmlCharCheckingWriter.cs
- XPathException.cs
- ApplicationServicesHostFactory.cs
- UrlPropertyAttribute.cs
- SystemIPv6InterfaceProperties.cs
- DriveNotFoundException.cs
- DataGridPagerStyle.cs
- SafeHandle.cs
- ChunkedMemoryStream.cs
- DataViewSetting.cs
- Debugger.cs
- ItemsPresenter.cs
- StringFormat.cs
- Compress.cs
- AspNetCompatibilityRequirementsAttribute.cs
- TryCatchDesigner.xaml.cs
- System.Data.OracleClient_BID.cs
- DocumentReferenceCollection.cs
- BindingContext.cs
- XmlBindingWorker.cs
- ProcessModule.cs
- ReadOnlyObservableCollection.cs