本文整理汇总了C#中CollectionView类的典型用法代码示例。如果您正苦于以下问题:C# CollectionView类的具体用法?C# CollectionView怎么用?C# CollectionView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CollectionView类属于命名空间,在下文中一共展示了CollectionView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanSort_Returns_False
public void CanSort_Returns_False()
{
int[] source = new[] { 1, 1, 2, 3, 5, 8 };
CollectionView target = new CollectionView(source);
Assert.IsFalse(target.CanSort);
}
示例2: Culture_Is_Initially_Null
public void Culture_Is_Initially_Null()
{
int[] source = new[] { 1, 1, 2, 3, 5, 8 };
CollectionView target = new CollectionView(source);
Assert.IsNull(target.Culture);
}
示例3: Initial_Items_Are_Same_As_SourceCollection
public void Initial_Items_Are_Same_As_SourceCollection()
{
int[] source = new[] { 1, 1, 2, 3, 5, 8 };
CollectionView target = new CollectionView(source);
CollectionAssert.AreEqual(source, ((IEnumerable)target).Cast<object>().ToArray());
}
示例4: CanFilter_Returns_True
public void CanFilter_Returns_True()
{
int[] source = new[] { 1, 1, 2, 3, 5, 8 };
CollectionView target = new CollectionView(source);
Assert.IsTrue(target.CanFilter);
}
示例5: SourceCollection_Is_Set
public void SourceCollection_Is_Set()
{
int[] source = new[] { 1, 1, 2, 3, 5, 8 };
CollectionView target = new CollectionView(source);
Assert.AreSame(source, target.SourceCollection);
}
示例6: ResGroupEditor
public ResGroupEditor(IEditorEnvironment editorEnvironment, ICommandHistory history)
{
this.editorEnvironment = editorEnvironment;
this.history = history;
this.AutoSize = true;
this.Padding = new Padding(10);
this.SuspendLayout();
this.split = new SplitContainer { Dock = DockStyle.Fill };
this.split.Panel2Collapsed = true;
this.Controls.Add(this.split);
var sp = new StackPanel { Dock = DockStyle.Fill, AutoSize = true };
this.split.Panel1.Controls.Add(sp);
var collectionView = new CollectionView<IResourceFile>(a => editorEnvironment.EditorFor(a, history))
{ AutoSize = true };
collectionView.ItemsPanel.AutoSize = true;
collectionView.ItemsPanel.AutoScroll = false;
new PropertyBinding<ResGroup, IList<IResourceFile>>(collectionView, this.dataContext, m => m.ExternalResources, null);
sp.Controls.Add(collectionView);
var embCollectionView = new CollectionView<Managed>(a => this.CreateButtonForResource(a)) { AutoSize = true };
embCollectionView.ItemsPanel.AutoSize = true;
embCollectionView.ItemsPanel.AutoScroll = false;
new PropertyBinding<ResGroup, IList<Managed>>(embCollectionView, this.dataContext, m => m.EmbeddedResources, null);
sp.Controls.Add(embCollectionView);
this.ResumeLayout();
this.PerformLayout();
}
示例7: CreateGenerator
internal static CustomItemContainerGenerator CreateGenerator( DataGridControl parentGridControl, CollectionView collectionView, DataGridContext dataGridContext )
{
CustomItemContainerGenerator newGenerator = new CustomItemContainerGenerator( collectionView, dataGridContext, parentGridControl );
dataGridContext.SetGenerator( newGenerator );
return newGenerator;
}
示例8: CustomListbox
public CustomListbox(ref CollectionView iBindableView)
{
InitializeComponent();
pBindableView = iBindableView;
OnPropertyChanged("dataView");
}
示例9: ConnectionViewModel
public ConnectionViewModel(string name)
{
_name = name;
IList<PhoneBookEntry> list = new List<PhoneBookEntry>
{
new PhoneBookEntry("test"),
new PhoneBookEntry("test2")
};
_phonebookEntries = new CollectionView(list);
}
示例10: AddGrouping
private void AddGrouping(object sender, RoutedEventArgs e)
{
_myView = (CollectionView) CollectionViewSource.GetDefaultView(myItemsControl.ItemsSource);
if (_myView.CanGroup)
{
var groupDescription
= new PropertyGroupDescription("@Type");
_myView.GroupDescriptions.Add(groupDescription);
}
}
示例11: LogViewModel
public LogViewModel()
{
MessagesLock = new Object();
messages = new ObservableCollection<LogMessageModel>();
BindingOperations.EnableCollectionSynchronization(messages, MessagesLock);
//clearLog = new Command(new Action(() => messages.Clear()));
LogLevel = new CollectionView(Enum.GetValues(typeof(LogMessageModel.LogLevel)));
LogLevel.MoveCurrentTo(LogMessageModel.LogLevel.INFO);
}
示例12: ToolkitType
/// <summary>
/// Initializes a new instance of the <see cref="ToolkitType"/> class.
/// </summary>
public ToolkitType()
{
var componentModel = ServiceProvider.GlobalProvider.GetService<SComponentModel, IComponentModel>();
var export = componentModel.GetService<IEnumerable<IInstalledToolkitInfo>>();
this.allToolkits = new ObservableCollection<IInstalledToolkitInfo>((export != null) ? export.ToList() : new List<IInstalledToolkitInfo>());
this.toolkitsView = new ListCollectionView(this.allToolkits);
InitializeComponent();
FilterToolkits();
}
示例13: MainWindowViewModel
public MainWindowViewModel()
{
Properties.Settings.Default.LastLogReadedDate = DateTime.Now;
IsAutostart = Properties.Settings.Default.Autostart;
MailStateButtonName = "Active Mail Service";
AvailableDriveLetters = new CollectionView(GetAvailableDrives());
_alarmTimer = new DispatcherTimer();
_alarmTimer.Tick += new EventHandler(SendMailTick);
_alarmTimer.Interval = TimeSpan.FromMinutes(Properties.Settings.Default.AlarmIntervalInMinutes);
}
示例14: MainWindowViewModel
public MainWindowViewModel(Window window)
{
this.CurrentWindow = window;
this._allStudents = DBHandler.Instance.QueryAll();
this._filteredStudents = new StudentCollection();
this.Students = this._allStudents;
IList<SearchConditionEntry> searchConditionList = new List<SearchConditionEntry>();
searchConditionList.Add(new SearchConditionEntry("姓名", SearchCategory.SearchByName));
searchConditionList.Add(new SearchConditionEntry("身份证", SearchCategory.SearchByIdentity));
this._searchConditions = new CollectionView(searchConditionList);
this._searchKeyword = "";
}
示例15: CurrencyManager
public CurrencyManager( DataGridContext dataGridContext, CollectionView collectionView )
{
if( dataGridContext == null )
throw new ArgumentNullException( "dataGridContext" );
if( collectionView == null )
throw new ArgumentNullException( "collectionView" );
m_dataGridContext = dataGridContext;
m_collectionView = collectionView;
System.Diagnostics.Debug.Assert( m_dataGridContext.CurrentItem == m_collectionView.CurrentItem );
this.RegisterListeners();
}