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
- RuntimeDelegateArgument.cs
- PluralizationServiceUtil.cs
- EmptyQuery.cs
- FixedSOMImage.cs
- TextEncodedRawTextWriter.cs
- MessageProperties.cs
- NameValueConfigurationCollection.cs
- WindowInteractionStateTracker.cs
- OLEDB_Enum.cs
- ModuleConfigurationInfo.cs
- ListMarkerSourceInfo.cs
- _TransmitFileOverlappedAsyncResult.cs
- EndpointDispatcherTable.cs
- TableLayoutPanelCellPosition.cs
- Helpers.cs
- DeviceContext.cs
- SchemaNames.cs
- CoTaskMemUnicodeSafeHandle.cs
- SafeHandle.cs
- TextSpan.cs
- xdrvalidator.cs
- AttachedPropertyInfo.cs
- EncoderBestFitFallback.cs
- DodSequenceMerge.cs
- AssociationSetEnd.cs
- EntityClassGenerator.cs
- RoleService.cs
- _AutoWebProxyScriptWrapper.cs
- WebPartsSection.cs
- PropertyGeneratedEventArgs.cs
- MouseActionConverter.cs
- MetabaseSettingsIis7.cs
- ObjectStateEntryDbDataRecord.cs
- BufferedGenericXmlSecurityToken.cs
- SoapIncludeAttribute.cs
- KernelTypeValidation.cs
- SymmetricKeyWrap.cs
- ObjectResult.cs
- ExpiredSecurityTokenException.cs
- PartialCachingControl.cs
- GradientStop.cs
- SimpleHandlerBuildProvider.cs
- X509PeerCertificateAuthentication.cs
- StaticFileHandler.cs
- CodeDelegateCreateExpression.cs
- DataSourceXmlSubItemAttribute.cs
- Condition.cs
- ConfigXmlCDataSection.cs
- FontDialog.cs
- WebResponse.cs
- EncryptedPackageFilter.cs
- EncoderExceptionFallback.cs
- TableAutomationPeer.cs
- StringUtil.cs
- HttpWebRequestElement.cs
- FilteredAttributeCollection.cs
- EditorReuseAttribute.cs
- PopupControlService.cs
- FileLogRecord.cs
- BamlVersionHeader.cs
- BinaryCommonClasses.cs
- X509ChainElement.cs
- TreeNodeConverter.cs
- LayoutExceptionEventArgs.cs
- altserialization.cs
- NumberFunctions.cs
- SingleStorage.cs
- FilteredDataSetHelper.cs
- ImageDrawing.cs
- SqlDataSourceEnumerator.cs
- DuplicateDetector.cs
- NotImplementedException.cs
- Tracking.cs
- dataprotectionpermissionattribute.cs
- ColorConvertedBitmapExtension.cs
- PreviewPageInfo.cs
- AlternationConverter.cs
- CheckBoxStandardAdapter.cs
- RecordBuilder.cs
- ToolStripArrowRenderEventArgs.cs
- ApplicationId.cs
- ContainerTracking.cs
- ControlParameter.cs
- BitmapCacheBrush.cs
- AuthenticationConfig.cs
- HttpMethodConstraint.cs
- MimeTypeMapper.cs
- CheckBoxAutomationPeer.cs
- Types.cs
- CssStyleCollection.cs
- Point.cs
- mactripleDES.cs
- Calendar.cs
- ChangeInterceptorAttribute.cs
- ConfigurationException.cs
- Point3DCollectionConverter.cs
- MonitoringDescriptionAttribute.cs
- OuterGlowBitmapEffect.cs
- VisualStyleElement.cs
- Int16Storage.cs