Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / GridViewColumnCollectionChangedEventArgs.cs / 1305600 / GridViewColumnCollectionChangedEventArgs.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System.Windows.Controls;
using System.Collections.Generic; // IList
using System.Collections.Specialized; // NotifyCollectionChangedEventArgs
using System.Collections.ObjectModel; // Collection, ReadOnlyCollection
using System.Diagnostics; // Assert
namespace System.Windows.Controls
{
///
/// Argument for GridViewColumnCollectionChanged event
///
internal class GridViewColumnCollectionChangedEventArgs : NotifyCollectionChangedEventArgs
{
///
/// constructor (for a property of one column changed)
///
/// column whose property changed
/// Name of the changed property
internal GridViewColumnCollectionChangedEventArgs(GridViewColumn column, string propertyName)
: base(NotifyCollectionChangedAction.Reset) // NotifyCollectionChangedEventArgs doesn't have 0 parameter constructor, so pass in an arbitrary parameter.
{
_column = column;
_propertyName = propertyName;
}
///
/// constructor (for clear)
///
/// must be NotifyCollectionChangedAction.Reset
/// Columns removed in reset action
internal GridViewColumnCollectionChangedEventArgs(NotifyCollectionChangedAction action, GridViewColumn[] clearedColumns)
: base(action)
{
_clearedColumns = System.Array.AsReadOnly(clearedColumns);
}
///
/// Construct for one-column Add/Remove event.
///
internal GridViewColumnCollectionChangedEventArgs(NotifyCollectionChangedAction action, GridViewColumn changedItem, int index, int actualIndex)
: base (action, changedItem, index)
{
Debug.Assert(action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove,
"This constructor only supports Add/Remove action.");
Debug.Assert(changedItem != null, "changedItem can't be null");
Debug.Assert(index >= 0, "index must >= 0");
Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
_actualIndex = actualIndex;
}
///
/// Construct for a one-column Replace event.
///
internal GridViewColumnCollectionChangedEventArgs(NotifyCollectionChangedAction action, GridViewColumn newItem, GridViewColumn oldItem, int index, int actualIndex)
: base(action, newItem, oldItem, index)
{
Debug.Assert(newItem != null, "newItem can't be null");
Debug.Assert(oldItem != null, "oldItem can't be null");
Debug.Assert(index >= 0, "index must >= 0");
Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
_actualIndex = actualIndex;
}
///
/// Construct for a one-column Move event.
///
internal GridViewColumnCollectionChangedEventArgs(NotifyCollectionChangedAction action, GridViewColumn changedItem, int index, int oldIndex, int actualIndex)
: base(action, changedItem, index, oldIndex)
{
Debug.Assert(changedItem != null, "changedItem can't be null");
Debug.Assert(index >= 0, "index must >= 0");
Debug.Assert(oldIndex >= 0, "oldIndex must >= 0");
Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
_actualIndex = actualIndex;
}
///
/// index of the changed column in the internal column list.
///
internal int ActualIndex
{
get { return _actualIndex; }
}
private int _actualIndex = -1;
///
/// Columns removed in reset action.
///
internal ReadOnlyCollection ClearedColumns
{
get { return _clearedColumns; }
}
private ReadOnlyCollection _clearedColumns;
// The following two properties are used to store information of GridViewColumns.PropertyChanged event.
//
// GridViewColumnCollection hookup GridViewColumns.PropertyChanged event. When GridViewColumns.PropertyChanged
// event is raised, GridViewColumnCollection will raised CollectionChanged event with GridViewColumnCollectionChangedEventArgs.
// In the event arg the following two properties will be set, so GridViewRowPresenter will be informed.
//
// GridViewRowPresenter needn't hookup PropertyChanged event of each column, which cost a lot of time in scroll operation.
///
/// Column whose property changed
///
internal GridViewColumn Column
{
get { return _column; }
}
private GridViewColumn _column;
///
/// Name of the changed property
///
internal string PropertyName
{
get { return _propertyName; }
}
private string _propertyName;
}
}
// 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.Windows.Controls;
using System.Collections.Generic; // IList
using System.Collections.Specialized; // NotifyCollectionChangedEventArgs
using System.Collections.ObjectModel; // Collection, ReadOnlyCollection
using System.Diagnostics; // Assert
namespace System.Windows.Controls
{
///
/// Argument for GridViewColumnCollectionChanged event
///
internal class GridViewColumnCollectionChangedEventArgs : NotifyCollectionChangedEventArgs
{
///
/// constructor (for a property of one column changed)
///
/// column whose property changed
/// Name of the changed property
internal GridViewColumnCollectionChangedEventArgs(GridViewColumn column, string propertyName)
: base(NotifyCollectionChangedAction.Reset) // NotifyCollectionChangedEventArgs doesn't have 0 parameter constructor, so pass in an arbitrary parameter.
{
_column = column;
_propertyName = propertyName;
}
///
/// constructor (for clear)
///
/// must be NotifyCollectionChangedAction.Reset
/// Columns removed in reset action
internal GridViewColumnCollectionChangedEventArgs(NotifyCollectionChangedAction action, GridViewColumn[] clearedColumns)
: base(action)
{
_clearedColumns = System.Array.AsReadOnly(clearedColumns);
}
///
/// Construct for one-column Add/Remove event.
///
internal GridViewColumnCollectionChangedEventArgs(NotifyCollectionChangedAction action, GridViewColumn changedItem, int index, int actualIndex)
: base (action, changedItem, index)
{
Debug.Assert(action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove,
"This constructor only supports Add/Remove action.");
Debug.Assert(changedItem != null, "changedItem can't be null");
Debug.Assert(index >= 0, "index must >= 0");
Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
_actualIndex = actualIndex;
}
///
/// Construct for a one-column Replace event.
///
internal GridViewColumnCollectionChangedEventArgs(NotifyCollectionChangedAction action, GridViewColumn newItem, GridViewColumn oldItem, int index, int actualIndex)
: base(action, newItem, oldItem, index)
{
Debug.Assert(newItem != null, "newItem can't be null");
Debug.Assert(oldItem != null, "oldItem can't be null");
Debug.Assert(index >= 0, "index must >= 0");
Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
_actualIndex = actualIndex;
}
///
/// Construct for a one-column Move event.
///
internal GridViewColumnCollectionChangedEventArgs(NotifyCollectionChangedAction action, GridViewColumn changedItem, int index, int oldIndex, int actualIndex)
: base(action, changedItem, index, oldIndex)
{
Debug.Assert(changedItem != null, "changedItem can't be null");
Debug.Assert(index >= 0, "index must >= 0");
Debug.Assert(oldIndex >= 0, "oldIndex must >= 0");
Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
_actualIndex = actualIndex;
}
///
/// index of the changed column in the internal column list.
///
internal int ActualIndex
{
get { return _actualIndex; }
}
private int _actualIndex = -1;
///
/// Columns removed in reset action.
///
internal ReadOnlyCollection ClearedColumns
{
get { return _clearedColumns; }
}
private ReadOnlyCollection _clearedColumns;
// The following two properties are used to store information of GridViewColumns.PropertyChanged event.
//
// GridViewColumnCollection hookup GridViewColumns.PropertyChanged event. When GridViewColumns.PropertyChanged
// event is raised, GridViewColumnCollection will raised CollectionChanged event with GridViewColumnCollectionChangedEventArgs.
// In the event arg the following two properties will be set, so GridViewRowPresenter will be informed.
//
// GridViewRowPresenter needn't hookup PropertyChanged event of each column, which cost a lot of time in scroll operation.
///
/// Column whose property changed
///
internal GridViewColumn Column
{
get { return _column; }
}
private GridViewColumn _column;
///
/// Name of the changed property
///
internal string PropertyName
{
get { return _propertyName; }
}
private string _propertyName;
}
}
// 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
- SourceInterpreter.cs
- CodePageEncoding.cs
- CheckBoxList.cs
- XsltSettings.cs
- SymmetricAlgorithm.cs
- XsltCompileContext.cs
- _IPv4Address.cs
- ExpressionEditorAttribute.cs
- CheckedPointers.cs
- DateTimeStorage.cs
- DesignerSerializationManager.cs
- TreeWalker.cs
- ControlBindingsCollection.cs
- NativeMethodsOther.cs
- HtmlElementErrorEventArgs.cs
- DataGridTableStyleMappingNameEditor.cs
- XmlWriterDelegator.cs
- DataGridViewTopLeftHeaderCell.cs
- AllMembershipCondition.cs
- Evidence.cs
- StyleBamlRecordReader.cs
- MailFileEditor.cs
- RemoteAsymmetricSignatureFormatter.cs
- RequestSecurityToken.cs
- PartialCachingAttribute.cs
- XamlInt32CollectionSerializer.cs
- ButtonFlatAdapter.cs
- DbCommandTree.cs
- DirectoryRedirect.cs
- MetaData.cs
- MethodImplAttribute.cs
- _LocalDataStore.cs
- GraphicsState.cs
- LassoSelectionBehavior.cs
- BuildProvider.cs
- EmissiveMaterial.cs
- HandleRef.cs
- TemplateApplicationHelper.cs
- TreeNodeBinding.cs
- FacetEnabledSchemaElement.cs
- MutexSecurity.cs
- SID.cs
- StringUtil.cs
- FullTextBreakpoint.cs
- base64Transforms.cs
- ColorKeyFrameCollection.cs
- DecoratedNameAttribute.cs
- WebBrowserSiteBase.cs
- CriticalFinalizerObject.cs
- EventProviderWriter.cs
- Rights.cs
- SQLInt64.cs
- BCryptHashAlgorithm.cs
- ResourcePool.cs
- httpstaticobjectscollection.cs
- FormatterServices.cs
- MulticastDelegate.cs
- HttpHandlerActionCollection.cs
- TypefaceMetricsCache.cs
- ReliableOutputSessionChannel.cs
- CompletedAsyncResult.cs
- IdentityNotMappedException.cs
- TogglePattern.cs
- EntityModelSchemaGenerator.cs
- QilReplaceVisitor.cs
- DropShadowEffect.cs
- SelectedGridItemChangedEvent.cs
- DetailsViewInsertedEventArgs.cs
- WriteTimeStream.cs
- RoutingSection.cs
- PermissionSetEnumerator.cs
- ExceptionRoutedEventArgs.cs
- __Error.cs
- DataGrid.cs
- HuffmanTree.cs
- MasterPageBuildProvider.cs
- TemplatedWizardStep.cs
- QuaternionRotation3D.cs
- ColorConverter.cs
- DataGridViewHitTestInfo.cs
- ErrorTableItemStyle.cs
- MasterPageParser.cs
- ConfigurationSectionGroup.cs
- ErrorTableItemStyle.cs
- ModuleBuilderData.cs
- GraphicsState.cs
- InvokeProviderWrapper.cs
- _ConnectionGroup.cs
- PackWebRequest.cs
- ContractMapping.cs
- SimpleWebHandlerParser.cs
- GetPageNumberCompletedEventArgs.cs
- SspiNegotiationTokenAuthenticatorState.cs
- ProviderConnectionPoint.cs
- SettingsBindableAttribute.cs
- Transform.cs
- AppDomain.cs
- PriorityRange.cs
- PingOptions.cs
- CommandManager.cs