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
- ACE.cs
- DocumentDesigner.cs
- XmlWriterSettings.cs
- AlgoModule.cs
- TextElementAutomationPeer.cs
- SortDescription.cs
- WS2007HttpBinding.cs
- LineGeometry.cs
- DataChangedEventManager.cs
- OperatingSystem.cs
- TransformGroup.cs
- SecurityManager.cs
- VerticalAlignConverter.cs
- DataAdapter.cs
- GridViewUpdateEventArgs.cs
- AssemblyName.cs
- MimePart.cs
- SchemaElementLookUpTableEnumerator.cs
- HtmlDocument.cs
- SocketException.cs
- IPHostEntry.cs
- __Filters.cs
- DateTimeStorage.cs
- DockingAttribute.cs
- handlecollector.cs
- PassportAuthentication.cs
- StyleHelper.cs
- GridView.cs
- COM2PictureConverter.cs
- SystemInfo.cs
- DependencyProperty.cs
- MethodSet.cs
- HtmlFormParameterReader.cs
- ViewGenResults.cs
- UnitySerializationHolder.cs
- MultiByteCodec.cs
- Baml6Assembly.cs
- DbFunctionCommandTree.cs
- ToolStripOverflowButton.cs
- BrushConverter.cs
- UserControlParser.cs
- DecimalAnimationUsingKeyFrames.cs
- LogRecordSequence.cs
- DbTransaction.cs
- AvtEvent.cs
- KeyTime.cs
- MemoryFailPoint.cs
- Maps.cs
- ReflectTypeDescriptionProvider.cs
- EmptyCollection.cs
- UnsafeNativeMethods.cs
- ProtocolReflector.cs
- XmlTextEncoder.cs
- XmlComplianceUtil.cs
- BitFlagsGenerator.cs
- BulletDecorator.cs
- FieldReference.cs
- MediaTimeline.cs
- AnchorEditor.cs
- WebPartActionVerb.cs
- QilUnary.cs
- TextEditorSpelling.cs
- CriticalFinalizerObject.cs
- RemotingConfigParser.cs
- DBSqlParserTable.cs
- NativeWindow.cs
- SiteMembershipCondition.cs
- XmlNamedNodeMap.cs
- HostedHttpRequestAsyncResult.cs
- InputScopeNameConverter.cs
- AppDomain.cs
- Rotation3D.cs
- ConnectionStringsExpressionBuilder.cs
- Blend.cs
- SecurityDescriptor.cs
- CapabilitiesState.cs
- WindowsHyperlink.cs
- XmlSchemaAnnotation.cs
- TypeSystem.cs
- WebPartConnectionsCancelEventArgs.cs
- Delay.cs
- WebDisplayNameAttribute.cs
- DebugInfoExpression.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- TextDecorationLocationValidation.cs
- TypeSystemHelpers.cs
- UrlPath.cs
- CopyOfAction.cs
- MenuItemStyleCollection.cs
- ProgressBarBrushConverter.cs
- OutputScopeManager.cs
- ArgumentException.cs
- LoadRetryConstantStrategy.cs
- StandardCommandToolStripMenuItem.cs
- PageParser.cs
- TabItem.cs
- _ShellExpression.cs
- ChunkedMemoryStream.cs
- dsa.cs
- ResXFileRef.cs