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
- DispatcherFrame.cs
- LogRestartAreaEnumerator.cs
- XPathScanner.cs
- HtmlGenericControl.cs
- GridViewCellAutomationPeer.cs
- ScriptResourceInfo.cs
- CalloutQueueItem.cs
- DataControlExtensions.cs
- EventLogger.cs
- ClickablePoint.cs
- EditorZone.cs
- AuthenticateEventArgs.cs
- XmlIlTypeHelper.cs
- InheritanceContextChangedEventManager.cs
- CodeTypeReferenceCollection.cs
- SafeCoTaskMem.cs
- FixedStringLookup.cs
- SwitchLevelAttribute.cs
- DataGridViewColumnCollection.cs
- XmlSchemaAny.cs
- MemberHolder.cs
- PipeStream.cs
- ProcessInfo.cs
- AtomContentProperty.cs
- FlowDocumentView.cs
- SecurityManager.cs
- MenuItemBindingCollection.cs
- ShaderEffect.cs
- TemplateContainer.cs
- TextRenderer.cs
- DataGridCheckBoxColumn.cs
- ParameterElement.cs
- EntityDesignerUtils.cs
- ArrayWithOffset.cs
- BordersPage.cs
- InvalidCardException.cs
- DockEditor.cs
- SafeNativeMethods.cs
- figurelengthconverter.cs
- SqlCommand.cs
- RelationshipEntry.cs
- IsolatedStorageSecurityState.cs
- StateMachine.cs
- URLAttribute.cs
- RegistrationServices.cs
- wmiutil.cs
- StorageConditionPropertyMapping.cs
- AnimationTimeline.cs
- BindingParameterCollection.cs
- VisualStyleRenderer.cs
- LowerCaseStringConverter.cs
- BitmapEffectDrawing.cs
- Match.cs
- UserCancellationException.cs
- PartitionResolver.cs
- FileAuthorizationModule.cs
- RadioButtonPopupAdapter.cs
- DropDownList.cs
- WindowsListViewItemCheckBox.cs
- XmlCharacterData.cs
- TypeConverterHelper.cs
- Int16.cs
- ACL.cs
- SolidColorBrush.cs
- ComponentResourceKey.cs
- QueuePathDialog.cs
- OracleParameterCollection.cs
- FixedTextBuilder.cs
- EntitySetDataBindingList.cs
- HashMembershipCondition.cs
- ping.cs
- SqlInfoMessageEvent.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- ScalarOps.cs
- DebuggerService.cs
- BaseComponentEditor.cs
- NamedPipeProcessProtocolHandler.cs
- CompiledELinqQueryState.cs
- SamlSecurityToken.cs
- BooleanAnimationUsingKeyFrames.cs
- PermissionSet.cs
- RoleBoolean.cs
- PackUriHelper.cs
- ConstructorBuilder.cs
- LinqToSqlWrapper.cs
- MailSettingsSection.cs
- Exceptions.cs
- OleAutBinder.cs
- DeferredBinaryDeserializerExtension.cs
- TableLayoutCellPaintEventArgs.cs
- ExpressionContext.cs
- SerialStream.cs
- Operator.cs
- SystemDiagnosticsSection.cs
- XXXInfos.cs
- CompilerInfo.cs
- PersianCalendar.cs
- PrintDialog.cs
- ellipse.cs
- C14NUtil.cs