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
- BufferBuilder.cs
- OleDbConnectionInternal.cs
- ErrorInfoXmlDocument.cs
- QueueProcessor.cs
- WsdlContractConversionContext.cs
- XmlSchemaSequence.cs
- SkipStoryboardToFill.cs
- OracleDataAdapter.cs
- DataGridViewColumnCollection.cs
- OutputCacheSection.cs
- LightweightCodeGenerator.cs
- WindowAutomationPeer.cs
- FormViewInsertEventArgs.cs
- WithStatement.cs
- ClockController.cs
- ExpandedProjectionNode.cs
- ImageCreator.cs
- RecordsAffectedEventArgs.cs
- BamlBinaryReader.cs
- InternalDispatchObject.cs
- PathSegmentCollection.cs
- TreeViewDataItemAutomationPeer.cs
- StrokeNodeOperations2.cs
- MarkupWriter.cs
- IResourceProvider.cs
- GraphicsContainer.cs
- ArraySubsetEnumerator.cs
- EventListener.cs
- ObjectRef.cs
- DataGridBoundColumn.cs
- RelationshipConverter.cs
- TemplatedWizardStep.cs
- DoubleAnimation.cs
- CanonicalFormWriter.cs
- HTTPNotFoundHandler.cs
- InternalEnumValidator.cs
- BrowserCapabilitiesCompiler.cs
- ControlAdapter.cs
- RowToParametersTransformer.cs
- TextContainerChangedEventArgs.cs
- Throw.cs
- XmlUtil.cs
- SByteConverter.cs
- BuilderPropertyEntry.cs
- UdpMessageProperty.cs
- PersistenceTypeAttribute.cs
- IriParsingElement.cs
- basecomparevalidator.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- LiteralLink.cs
- NamedPipeDuplicateContext.cs
- KeyValueInternalCollection.cs
- SevenBitStream.cs
- WebConvert.cs
- ToolbarAUtomationPeer.cs
- TextSimpleMarkerProperties.cs
- Attribute.cs
- ComponentCache.cs
- SchemaNotation.cs
- PageAsyncTask.cs
- ContainerParaClient.cs
- BatchParser.cs
- DataGridViewCellStateChangedEventArgs.cs
- StringWriter.cs
- AnimationStorage.cs
- MetadataItemCollectionFactory.cs
- XmlAttributeAttribute.cs
- InternalTypeHelper.cs
- DependencyPropertyAttribute.cs
- TextServicesContext.cs
- ModuleElement.cs
- StrokeCollectionDefaultValueFactory.cs
- NativeBuffer.cs
- TypeDescriptionProvider.cs
- MSAAEventDispatcher.cs
- FullTextState.cs
- _OSSOCK.cs
- TimeZoneInfo.cs
- OraclePermissionAttribute.cs
- BaseTemplateBuildProvider.cs
- Attributes.cs
- CounterSample.cs
- EventRecord.cs
- ToolZone.cs
- Knowncolors.cs
- PathTooLongException.cs
- AppSettingsReader.cs
- BlobPersonalizationState.cs
- AdornerDecorator.cs
- InitializationEventAttribute.cs
- SchemaImporter.cs
- AppPool.cs
- SystemIcmpV4Statistics.cs
- ToolTipService.cs
- PropertyNames.cs
- UnknownWrapper.cs
- ImageDrawing.cs
- FontStyle.cs
- Matrix3D.cs
- NameObjectCollectionBase.cs