Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- MD5CryptoServiceProvider.cs
- ProfessionalColors.cs
- XmlSchemaSimpleTypeRestriction.cs
- DefaultValueTypeConverter.cs
- RootBrowserWindow.cs
- XmlName.cs
- ElementHost.cs
- ClrPerspective.cs
- KnownTypesHelper.cs
- Application.cs
- AuthenticationSection.cs
- NamedPipeConnectionPoolSettingsElement.cs
- QueryCacheManager.cs
- QueryRewriter.cs
- MasterPageBuildProvider.cs
- PropertyGridView.cs
- SiteOfOriginPart.cs
- ProfessionalColorTable.cs
- StrongNameKeyPair.cs
- ProcessModelInfo.cs
- LoginCancelEventArgs.cs
- CodeNamespaceImport.cs
- FlagPanel.cs
- ExtensionElement.cs
- CommentEmitter.cs
- SqlCharStream.cs
- ResourcesBuildProvider.cs
- SmtpException.cs
- MappingModelBuildProvider.cs
- ProfileServiceManager.cs
- AndCondition.cs
- Vector3D.cs
- WebConvert.cs
- SecurityContextSecurityTokenParameters.cs
- ResourcePart.cs
- Quaternion.cs
- EmbeddedMailObjectsCollection.cs
- ApplicationDirectoryMembershipCondition.cs
- ItemChangedEventArgs.cs
- TextBlock.cs
- OutputCacheProfileCollection.cs
- ObjectStateManager.cs
- ASCIIEncoding.cs
- DocumentGridPage.cs
- UriSchemeKeyedCollection.cs
- ManagementObjectSearcher.cs
- SqlDataSourceDesigner.cs
- SoapIgnoreAttribute.cs
- WinFormsUtils.cs
- MatchingStyle.cs
- PageAsyncTask.cs
- FrameworkPropertyMetadata.cs
- ChtmlFormAdapter.cs
- ProjectionCamera.cs
- MimeFormReflector.cs
- DataBoundControl.cs
- ClosureBinding.cs
- typedescriptorpermission.cs
- CodeAttributeArgumentCollection.cs
- EntityUtil.cs
- StaticFileHandler.cs
- TypeUsage.cs
- ObjectDataSourceSelectingEventArgs.cs
- DataSourceGroupCollection.cs
- AutoGeneratedField.cs
- MaterialGroup.cs
- TriggerBase.cs
- MD5.cs
- SqlClientMetaDataCollectionNames.cs
- SmtpFailedRecipientsException.cs
- XmlSerializerSection.cs
- DatagridviewDisplayedBandsData.cs
- DBBindings.cs
- ApplicationServiceManager.cs
- BatchWriter.cs
- LocatorBase.cs
- Validator.cs
- XPathAncestorIterator.cs
- UrlMapping.cs
- FullTrustAssembly.cs
- FloaterParagraph.cs
- GridViewSortEventArgs.cs
- NegotiateStream.cs
- Byte.cs
- MessageDecoder.cs
- FileDialogCustomPlace.cs
- Registry.cs
- AutomationEventArgs.cs
- validationstate.cs
- EmbeddedObject.cs
- ToolStripDesignerAvailabilityAttribute.cs
- UnionCqlBlock.cs
- LocalizationCodeDomSerializer.cs
- GridViewUpdatedEventArgs.cs
- Profiler.cs
- AmbiguousMatchException.cs
- Serializer.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- ConnectionStringsExpressionBuilder.cs
- SelectionHighlightInfo.cs