Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / DataGridAutoGeneratingColumnEventArgs.cs / 1305600 / DataGridAutoGeneratingColumnEventArgs.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Reflection; using System.Text; namespace System.Windows.Controls { ////// The event args class to be used with AutoGeneratingColumn event. /// public class DataGridAutoGeneratingColumnEventArgs : EventArgs { #region Constructors ////// Public constructor /// /// /// /// public DataGridAutoGeneratingColumnEventArgs(string propertyName, Type propertyType, DataGridColumn column) : this(column, propertyName, propertyType, null) { } internal DataGridAutoGeneratingColumnEventArgs(DataGridColumn column, ItemPropertyInfo itemPropertyInfo) : this(column, itemPropertyInfo.Name, itemPropertyInfo.PropertyType, itemPropertyInfo.Descriptor) { } internal DataGridAutoGeneratingColumnEventArgs( DataGridColumn column, string propertyName, Type propertyType, object propertyDescriptor) { _column = column; _propertyName = propertyName; _propertyType = propertyType; PropertyDescriptor = propertyDescriptor; } #endregion #region Properties ////// Column which is being generated /// public DataGridColumn Column { get { return _column; } set { _column = value; } } ////// Property for which the column is getting generated /// public string PropertyName { get { return _propertyName; } } ////// Type of the property for which the column is getting generated /// public Type PropertyType { get { return _propertyType; } } ////// Descriptor of the property for which the column is gettign generated /// public object PropertyDescriptor { get { return _propertyDescriptor; } private set { if (value == null) { _propertyDescriptor = null; } else { Debug.Assert( typeof(PropertyDescriptor).IsAssignableFrom(value.GetType()) || typeof(PropertyInfo).IsAssignableFrom(value.GetType()), "Property descriptor should be either a PropertyDescriptor or a PropertyInfo"); _propertyDescriptor = value; } } } ////// Flag to indicated if generation of this column has to be cancelled /// public bool Cancel { get { return _cancel; } set { _cancel = value; } } #endregion #region Data private DataGridColumn _column; private string _propertyName; private Type _propertyType; private object _propertyDescriptor; private bool _cancel; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Reflection; using System.Text; namespace System.Windows.Controls { ////// The event args class to be used with AutoGeneratingColumn event. /// public class DataGridAutoGeneratingColumnEventArgs : EventArgs { #region Constructors ////// Public constructor /// /// /// /// public DataGridAutoGeneratingColumnEventArgs(string propertyName, Type propertyType, DataGridColumn column) : this(column, propertyName, propertyType, null) { } internal DataGridAutoGeneratingColumnEventArgs(DataGridColumn column, ItemPropertyInfo itemPropertyInfo) : this(column, itemPropertyInfo.Name, itemPropertyInfo.PropertyType, itemPropertyInfo.Descriptor) { } internal DataGridAutoGeneratingColumnEventArgs( DataGridColumn column, string propertyName, Type propertyType, object propertyDescriptor) { _column = column; _propertyName = propertyName; _propertyType = propertyType; PropertyDescriptor = propertyDescriptor; } #endregion #region Properties ////// Column which is being generated /// public DataGridColumn Column { get { return _column; } set { _column = value; } } ////// Property for which the column is getting generated /// public string PropertyName { get { return _propertyName; } } ////// Type of the property for which the column is getting generated /// public Type PropertyType { get { return _propertyType; } } ////// Descriptor of the property for which the column is gettign generated /// public object PropertyDescriptor { get { return _propertyDescriptor; } private set { if (value == null) { _propertyDescriptor = null; } else { Debug.Assert( typeof(PropertyDescriptor).IsAssignableFrom(value.GetType()) || typeof(PropertyInfo).IsAssignableFrom(value.GetType()), "Property descriptor should be either a PropertyDescriptor or a PropertyInfo"); _propertyDescriptor = value; } } } ////// Flag to indicated if generation of this column has to be cancelled /// public bool Cancel { get { return _cancel; } set { _cancel = value; } } #endregion #region Data private DataGridColumn _column; private string _propertyName; private Type _propertyType; private object _propertyDescriptor; private bool _cancel; #endregion } } // 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
- ToolStripRenderer.cs
- XmlIterators.cs
- BitVector32.cs
- LowerCaseStringConverter.cs
- RegistrationServices.cs
- While.cs
- DataGridViewDataErrorEventArgs.cs
- CompModSwitches.cs
- PopOutPanel.cs
- counter.cs
- Control.cs
- XmlTypeAttribute.cs
- SiteMapNodeCollection.cs
- BaseCAMarshaler.cs
- ClientTarget.cs
- PaintValueEventArgs.cs
- RepeatInfo.cs
- HttpEncoderUtility.cs
- BaseAddressElement.cs
- PopupEventArgs.cs
- SafeIUnknown.cs
- DynamicILGenerator.cs
- SqlAggregateChecker.cs
- WaitForChangedResult.cs
- SqlDataSource.cs
- BoundPropertyEntry.cs
- ValidatorCollection.cs
- Encoding.cs
- Delegate.cs
- ZipIOExtraFieldPaddingElement.cs
- SystemIPv6InterfaceProperties.cs
- Model3D.cs
- WebEvents.cs
- Drawing.cs
- Image.cs
- ScopelessEnumAttribute.cs
- WebResponse.cs
- oledbmetadatacolumnnames.cs
- MarshalDirectiveException.cs
- IsolatedStorage.cs
- RayMeshGeometry3DHitTestResult.cs
- ObjectQueryExecutionPlan.cs
- DependencyObjectType.cs
- Rotation3D.cs
- Italic.cs
- ServiceBuildProvider.cs
- EventEntry.cs
- DeclaredTypeElementCollection.cs
- CompletedAsyncResult.cs
- DecimalConstantAttribute.cs
- Aggregates.cs
- ImmComposition.cs
- XmlSchemaException.cs
- ListViewHitTestInfo.cs
- ZipIOCentralDirectoryBlock.cs
- ConnectionStringsExpressionEditor.cs
- UdpDiscoveryMessageFilter.cs
- DesignerAdapterAttribute.cs
- WmlTextBoxAdapter.cs
- MasterPageCodeDomTreeGenerator.cs
- InternalTypeHelper.cs
- HtmlTableRowCollection.cs
- SelectionBorderGlyph.cs
- AttributeUsageAttribute.cs
- PositiveTimeSpanValidatorAttribute.cs
- PropertyInfoSet.cs
- ComplexPropertyEntry.cs
- MatchAttribute.cs
- ScriptManagerProxy.cs
- StackOverflowException.cs
- SqlSupersetValidator.cs
- ItemMap.cs
- StaticExtension.cs
- VersionConverter.cs
- XmlReturnWriter.cs
- ComponentResourceManager.cs
- PassportAuthenticationEventArgs.cs
- XmlSchemaSequence.cs
- EpmCustomContentDeSerializer.cs
- SmtpFailedRecipientsException.cs
- MessagingDescriptionAttribute.cs
- TemplateLookupAction.cs
- basecomparevalidator.cs
- SharedPersonalizationStateInfo.cs
- GroupBox.cs
- FixUp.cs
- XmlSchemaSubstitutionGroup.cs
- ContextMenuService.cs
- MultiSelector.cs
- IdentityModelDictionary.cs
- AspProxy.cs
- XmlSchemaAttribute.cs
- StrongNameIdentityPermission.cs
- EventArgs.cs
- JsonReaderDelegator.cs
- Keywords.cs
- ProfileBuildProvider.cs
- BufferedReadStream.cs
- NameNode.cs
- GeneralTransformGroup.cs