本文整理汇总了C#中DataGridContext类的典型用法代码示例。如果您正苦于以下问题:C# DataGridContext类的具体用法?C# DataGridContext怎么用?C# DataGridContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridContext类属于命名空间,在下文中一共展示了DataGridContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateGenerator
internal static CustomItemContainerGenerator CreateGenerator( DataGridControl parentGridControl, CollectionView collectionView, DataGridContext dataGridContext )
{
CustomItemContainerGenerator newGenerator = new CustomItemContainerGenerator( collectionView, dataGridContext, parentGridControl );
dataGridContext.SetGenerator( newGenerator );
return newGenerator;
}
示例2: GetNextVisibleFocusableColumnIndex
internal static int GetNextVisibleFocusableColumnIndex( DataGridContext dataGridContext, Row targetRow, ColumnBase targetColumn )
{
if( ( dataGridContext == null ) || ( targetRow == null ) || ( targetColumn == null ) )
return -1;
var columns = dataGridContext.VisibleColumns;
if( ( columns == null ) || ( columns.Count <= 0 ) )
return -1;
var columnIndex = columns.IndexOf( targetColumn );
if( columnIndex < 0 )
return -1;
if( !dataGridContext.IsAFlattenDetail )
return NavigationHelper.GetNextVisibleFocusableColumnIndex( dataGridContext, targetRow, columnIndex + 1 );
var columnMap = dataGridContext.ItemPropertyMap;
var masterColumnName = default( string );
if( !columnMap.TryGetColumnFieldName( targetColumn, out masterColumnName ) )
return -1;
var masterDataGridContext = dataGridContext.RootDataGridContext;
var masterColumn = masterDataGridContext.Columns[ masterColumnName ];
if( masterColumn == null )
return -1;
var masterColumnIndex = masterDataGridContext.VisibleColumns.IndexOf( masterColumn );
if( masterColumnIndex < 0 )
return -1;
return NavigationHelper.GetNextVisibleFocusableDetailColumnIndexFromMasterColumnIndex( dataGridContext, targetRow, masterColumnIndex + 1 );
}
示例3: ColumnStretchingManager
public ColumnStretchingManager( DataGridContext dataGridContext )
{
if( dataGridContext == null )
throw new ArgumentNullException( "dataGridContext" );
m_dataGridContext = dataGridContext;
}
示例4: HasGroup
public static bool HasGroup( DataGridContext dataGridContext )
{
if( dataGridContext.GroupLevelDescriptions.Count > 0 )
return true;
return GroupingHelper.HasGroup( dataGridContext.DetailConfigurations );
}
示例5: DataGridContextAutomationPeer
internal DataGridContextAutomationPeer(
DataGridControl dataGridControl,
DataGridContext parentDataGridContext,
object parentItem,
DetailConfiguration detailConfiguration )
{
if( dataGridControl == null )
throw new ArgumentNullException( "dataGridControl" );
if( parentDataGridContext == null )
{
m_dataGridContext = dataGridControl.DataGridContext;
}
else
{
m_dataGridContext = parentDataGridContext.GetChildContext( parentItem, detailConfiguration );
}
if( m_dataGridContext != null )
m_dataGridContext.Peer = this;
m_dataGridControl = dataGridControl;
m_parentDataGridContext = parentDataGridContext;
m_parentItem = parentItem;
m_detailConfiguration = detailConfiguration;
m_dataChildren = new Hashtable( 0 );
m_headerFooterChildren = new Hashtable( 0 );
}
示例6: GetLastVisibleFocusableColumnIndex
internal static int GetLastVisibleFocusableColumnIndex( DataGridContext dataGridContext )
{
if( dataGridContext == null )
return -1;
return NavigationHelper.GetLastVisibleFocusableColumnIndex( dataGridContext, dataGridContext.CurrentRow );
}
示例7: Group
internal Group( GroupGeneratorNode node, CollectionViewGroup group, IList<GroupLevelDescription> groupLevelDescriptions, DataGridContext dataGridContext )
{
if( node == null )
throw new ArgumentNullException( "node" );
if( group == null )
throw new ArgumentNullException( "group" );
if( groupLevelDescriptions == null )
throw new ArgumentNullException( "groupLevelDescriptions" );
if( dataGridContext == null )
throw new ArgumentNullException( "dataGridContext" );
m_generatorNode = node;
m_collectionViewGroup = group;
m_groupDescriptionsCollection = groupLevelDescriptions;
m_dataGridContext = dataGridContext;
//In case no late bingding is to happen, and if we already have everything to get the groupLevelDescription immediately, let's do!
int level = m_generatorNode.Level;
if( m_groupDescriptionsCollection.Count > level )
{
m_groupLevelDescription = m_groupDescriptionsCollection[ level ];
}
m_lateGroupLevelDescriptionBindingPerformed = false;
m_generatorNode.TotalLeafCountChanged += OnTotalItemCountChanged;
m_generatorNode.IsExpandedChanged += OnIsExpandedChanged;
}
示例8: Group
internal Group(
GroupGeneratorNode node,
CollectionViewGroup group,
LateGroupLevelDescription groupLevelDescription,
DataGridContext dataGridContext )
{
if( node == null )
throw new ArgumentNullException( "node" );
if( group == null )
throw new ArgumentNullException( "group" );
if( groupLevelDescription == null )
throw new ArgumentNullException( "groupLevelDescription" );
if( dataGridContext == null )
throw new ArgumentNullException( "dataGridContext" );
m_collectionViewGroup = group;
// Initialization is done through setters to register for events.
this.DataGridContext = dataGridContext;
this.GeneratorNode = node;
this.GroupLevelDescription = groupLevelDescription;
}
示例9: Visit
public void Visit( DataGridContext sourceContext, int sourceDataItemIndex, object item, ref bool stopVisit )
{
if( !m_isTableFlowView )
{
m_item = item;
m_parentDataGridContext = sourceContext;
m_success = true;
stopVisit = true;
return;
}
UIElement dataRow = sourceContext.CustomItemContainerGenerator.ContainerFromItem( item ) as UIElement;
if( dataRow != null )
{
if( !ScrollTip.IsItemInView( dataRow, sourceContext.DataGridControl.ItemsHost ) )
{
stopVisit = true;
}
else if( !ScrollTip.IsDataItemHiddenBySticky( sourceContext, item ) )
{
m_item = item;
m_parentDataGridContext = sourceContext;
m_success = true;
stopVisit = true;
}
}
}
示例10: Visit
public void Visit( DataGridContext sourceContext, ref bool stopVisit )
{
object[] items;
CollectionView itemsCollection = sourceContext.Items;
int count = itemsCollection.Count;
if( count == 0 )
return;
if( sourceContext.ItemsSourceCollection is DataGridVirtualizingCollectionViewBase )
{
items = null;
}
else
{
items = new object[ count ];
for( int i = 0; i < count; i++ )
{
items[ i ] = itemsCollection.GetItemAt( i );
}
}
SelectionRange itemRange = new SelectionRange( 0, count - 1 );
if( sourceContext.DataGridControl.SelectionUnit == SelectionUnit.Row )
{
sourceContext.DataGridControl.SelectionChangerManager.SelectItems(
sourceContext,
new SelectionRangeWithItems( itemRange, items ) );
}
else
{
HashedLinkedList<ColumnBase> columnsByVisiblePosition = sourceContext.ColumnsByVisiblePosition;
SelectedItemsStorage selectedColumnStore = new SelectedItemsStorage( null, 8 );
SelectionRange fullColumnRange = new SelectionRange( 0, columnsByVisiblePosition.Count - 1 );
selectedColumnStore.Add( new SelectionRangeWithItems( fullColumnRange, null ) );
int index = 0;
foreach( ColumnBase column in columnsByVisiblePosition )
{
if( !column.Visible )
{
selectedColumnStore.Remove( new SelectionRangeWithItems( new SelectionRange( index ), null ) );
}
index++;
}
int columnRangeCount = selectedColumnStore.Count;
for( int i = 0; i < columnRangeCount; i++ )
{
sourceContext.DataGridControl.SelectionChangerManager.SelectCells(
sourceContext,
new SelectionCellRangeWithItems( itemRange, items, selectedColumnStore[ i ].Range ) );
}
}
}
示例11: StartDataItem
protected override void StartDataItem( DataGridContext dataGridContext, object dataItem )
{
if (!string.IsNullOrEmpty(_indentationString))
WriteToBaseStream(_indentationString);
// The next StartDataItemField will be considered as first column
_isFirstColumn = true;
}
示例12: Prepare
internal void Prepare( DataGridContext dataGridContext, object dataItem )
{
m_containersPrepared = true;
m_dataGridContext = dataGridContext;
m_dataItem = dataItem;
this.Update();
}
示例13: DataGridCurrentChangedEventArgs
internal DataGridCurrentChangedEventArgs( DataGridContext oldDataGridContext, object oldCurrent, DataGridContext newDataGridContext, object newCurrent )
: base( DataGridControl.CurrentChangedEvent )
{
this.OldDataGridContext = oldDataGridContext;
this.OldCurrent = oldCurrent;
this.NewDataGridContext = newDataGridContext;
this.NewCurrent = newCurrent;
}
示例14: Visit
public void Visit( DataGridContext sourceContext, int startSourceDataItemIndex, int endSourceDataItemIndex, ref bool stopVisit )
{
SelectionManager selectionChangerManager = sourceContext.DataGridControl.SelectionChangerManager;
if( m_selectedColumns != null )
{
int columnCount = sourceContext.Columns.Count;
if( columnCount == 0 )
return;
SelectionRange contextColumnMaxRange = new SelectionRange( 0, columnCount - 1 );
for( int i = 0; i < m_selectedColumns.Length; i++ )
{
SelectionRange selectionRange = m_selectedColumns[ i ];
SelectionRange intersectionSelectionRange = selectionRange.Intersect( contextColumnMaxRange );
if( intersectionSelectionRange.IsEmpty )
continue;
#if DEBUG
string action = ( m_unselect ) ? "Removing" : "Adding";
Debug.WriteLine( "Selection : " + action + " cell : (" + startSourceDataItemIndex.ToString() + " - " + endSourceDataItemIndex.ToString() + ") - ("
+ intersectionSelectionRange.StartIndex.ToString() + " - " + intersectionSelectionRange.EndIndex.ToString() + ")" );
#endif
var cellRange = new SelectionCellRangeWithItems( new SelectionRange( startSourceDataItemIndex, endSourceDataItemIndex ), null, intersectionSelectionRange );
if( m_unselect )
{
selectionChangerManager.UnselectCells( sourceContext, cellRange );
}
else
{
selectionChangerManager.SelectCells( sourceContext, cellRange );
}
}
}
else
{
#if DEBUG
string action = ( m_unselect ) ? "Removing" : "Adding";
Debug.WriteLine( "Selection : " + action + " Adding item : " + startSourceDataItemIndex.ToString() + " - " + endSourceDataItemIndex.ToString() );
#endif
var itemRange = new SelectionRangeWithItems( new SelectionRange( startSourceDataItemIndex, endSourceDataItemIndex ), null );
if( m_unselect )
{
selectionChangerManager.UnselectItems( sourceContext, itemRange );
}
else
{
selectionChangerManager.SelectItems( sourceContext, itemRange );
}
}
}
示例15: DataGridCurrentChangingEventArgs
internal DataGridCurrentChangingEventArgs( DataGridContext oldDataGridContext, object oldCurrent, DataGridContext newDataGridContext, object newCurrent, bool isCancelable )
: base( DataGridControl.CurrentChangingEvent )
{
this.IsCancelable = isCancelable;
this.OldDataGridContext = oldDataGridContext;
this.OldCurrent = oldCurrent;
this.NewDataGridContext = newDataGridContext;
this.NewCurrent = newCurrent;
}