当前位置: 首页>>代码示例>>C#>>正文


C# CollectionView类代码示例

本文整理汇总了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);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs

示例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);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs

示例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());
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs

示例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);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs

示例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);
        }
开发者ID:modulexcite,项目名称:Avalonia,代码行数:7,代码来源:CollectionViewTests.cs

示例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();
		}
开发者ID:gleblebedev,项目名称:toe,代码行数:32,代码来源:ResGroupEditor.cs

示例7: CreateGenerator

    internal static CustomItemContainerGenerator CreateGenerator( DataGridControl parentGridControl, CollectionView collectionView, DataGridContext dataGridContext )
    {
      CustomItemContainerGenerator newGenerator = new CustomItemContainerGenerator( collectionView, dataGridContext, parentGridControl );
      dataGridContext.SetGenerator( newGenerator );

      return newGenerator;
    }
开发者ID:wangws556,项目名称:duoduo-chat,代码行数:7,代码来源:CustomItemContainerGenerator.cs

示例8: CustomListbox

        public CustomListbox(ref CollectionView iBindableView)
        {
            InitializeComponent();

            pBindableView = iBindableView;
            OnPropertyChanged("dataView");
        }
开发者ID:nomoreclowns,项目名称:ES_xmlGuiEditor,代码行数:7,代码来源:CustomListbox.xaml.cs

示例9: ConnectionViewModel

 public ConnectionViewModel(string name)
 {
     _name = name;
     IList<PhoneBookEntry> list = new List<PhoneBookEntry>
                                  {
                                      new PhoneBookEntry("test"),
                                      new PhoneBookEntry("test2")
                                  };
     _phonebookEntries = new CollectionView(list);
 }
开发者ID:vivekhegde,项目名称:IntelliCode,代码行数:10,代码来源:Fullstack.xaml.cs

示例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);
     }
 }
开发者ID:ClemensT,项目名称:WPF-Samples,代码行数:10,代码来源:MainWindow.cs

示例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);
        }
开发者ID:iejeecee,项目名称:mediaviewer,代码行数:11,代码来源:LogViewModel.cs

示例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();
        }
开发者ID:NuPattern,项目名称:NuPattern,代码行数:14,代码来源:ToolkitType.xaml.cs

示例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);
        }
开发者ID:aortmannm,项目名称:WatchDog,代码行数:11,代码来源:MainWindowViewModel.cs

示例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 = "";
        }
开发者ID:wanghan,项目名称:DriveSchool,代码行数:14,代码来源:MainWindowViewModel.cs

示例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();
    }
开发者ID:Torion,项目名称:WpfExToolkit,代码行数:15,代码来源:CurrencyManager.cs


注:本文中的CollectionView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。