當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。