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


C# ListSortDirection类代码示例

本文整理汇总了C#中ListSortDirection的典型用法代码示例。如果您正苦于以下问题:C# ListSortDirection类的具体用法?C# ListSortDirection怎么用?C# ListSortDirection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ListSortDirection类属于命名空间,在下文中一共展示了ListSortDirection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SortInfo

 //Deserialization constructor.
 public SortInfo(SerializationInfo info, StreamingContext ctxt)
 {
     //Get the values from info and assign them to the appropriate properties
     _columnIndex = (int)info.GetValue("ColumnIndex", typeof(int));
     _propertyName = (String)info.GetValue("PropertyName", typeof(string));
     _direction = (ListSortDirection)info.GetValue("Direction", typeof(ListSortDirection));
 }
开发者ID:dedimarco,项目名称:evemarketmonitorapp,代码行数:8,代码来源:MultisortDataGridView.cs

示例2: VarietiesViewModel

        public VarietiesViewModel(IProjectService projectService, IDialogService dialogService, IAnalysisService analysisService, VarietiesVarietyViewModel.Factory varietyFactory)
            : base("Varieties")
        {
            _projectService = projectService;
            _dialogService = dialogService;
            _analysisService = analysisService;
            _varietyFactory = varietyFactory;

            _projectService.ProjectOpened += _projectService_ProjectOpened;

            _sortPropertyName = "Meaning.Gloss";
            _sortDirection = ListSortDirection.Ascending;

            Messenger.Default.Register<SwitchViewMessage>(this, HandleSwitchView);

            _findCommand = new RelayCommand(Find);

            TaskAreas.Add(new TaskAreaItemsViewModel("Common tasks",
                    new TaskAreaCommandViewModel("Add a new variety", new RelayCommand(AddNewVariety)),
                    new TaskAreaCommandViewModel("Rename variety", new RelayCommand(RenameSelectedVariety, CanRenameSelectedVariety)),
                    new TaskAreaCommandViewModel("Remove variety", new RelayCommand(RemoveSelectedVariety, CanRemoveSelectedVariety)),
                    new TaskAreaCommandViewModel("Find words", _findCommand),
                    new TaskAreaItemsViewModel("Sort words by", new TaskAreaCommandGroupViewModel(
                        new TaskAreaCommandViewModel("Gloss", new RelayCommand(() => SortWordsBy("Meaning.Gloss", ListSortDirection.Ascending))),
                        new TaskAreaCommandViewModel("Form", new RelayCommand(() => SortWordsBy("StrRep", ListSortDirection.Ascending)))))));

            TaskAreas.Add(new TaskAreaItemsViewModel("Other tasks",
                new TaskAreaCommandViewModel("Remove affixes from words", new RelayCommand(RunStemmer, CanRunStemmer))));
        }
开发者ID:sillsdev,项目名称:cog,代码行数:29,代码来源:VarietiesViewModel.cs

示例3: CaseListSort

        public CaseListSort(ListSortDirection direction, DataGridColumn column)
        {
           int dir = (direction == ListSortDirection.Ascending) ? 1: -1;

            string path = BindingOperations.GetBindingExpression(column, DataGridColumn.HeaderProperty).ParentBinding.Path.Path;
            switch (path)
            {
                case "CaseId":
                    myComparer = (a, b) => { return a.CaseId.CompareTo(b.CaseId) * dir; };
                    break;

                case "AnalystComment":
                    myComparer = (a, b) => { return a.AnalystComment.CompareTo(b.AnalystComment) * dir;};
                    break;

                case "ObjectId":
                    myComparer = (a, b) => { return a.ObjectId.CompareTo(b.ObjectId) * dir;};
                    break;

                case "FlightNumber":
                    myComparer = (a, b) => { return a.FlightNumber.CompareTo(b.FlightNumber) * dir; };
                    break;

                case "Analyst":
                    myComparer = (a, b) => { return a.Analyst.CompareTo(b.Analyst) * dir; };
                    break;

                case "CaseDirectory":
                    myComparer = (a, b) => { return a.CaseDirectory.CompareTo(b.CaseDirectory) * dir; };
                    break;

                case "ReferenceImage":
                    myComparer = (a, b) => { return a.ReferenceImage.CompareTo(b.ReferenceImage) * dir; };
                    break;

                case "Result":
                    myComparer = (a, b) => { return a.Result.CompareTo(b.Result) * dir; };
                    break;

                case "UpdateTime":
                    myComparer = (a, b) => { return a.UpdateTime.CompareTo(b.UpdateTime) * dir; };
                    break;

                case "CreateTime":
                    myComparer = (a, b) => { return a.CreateTime.CompareTo(b.CreateTime) * dir; };
                    break;

                case "Archived":
                    myComparer = (a, b) => { return a.Archived.CompareTo(b.Archived) * dir; };
                    break;
                    
                case "AnalysisTime":
                    myComparer = (a, b) => { return a.AnalysisTime.CompareTo(b.AnalysisTime) * dir; };
                    break;

                default:
                    myComparer = (a, b) => { return 0; };
                    break;
            }
        }
开发者ID:BdGL3,项目名称:CXPortal,代码行数:60,代码来源:CaseListSort.cs

示例4: _SetSortOrder

 private void _SetSortOrder( IEnumerable itemsSource, string propertyName, ListSortDirection direction )
 {
     var view = CollectionViewSource.GetDefaultView( itemsSource );
     view.SortDescriptions.Clear( );
     view.SortDescriptions.Add( new SortDescription( propertyName, direction ) );
     view.Refresh( );
 }
开发者ID:BGCX261,项目名称:ziveirc-svn-to-git,代码行数:7,代码来源:NetworkConnectDialog.xaml.cs

示例5: GroupColumn

		public GroupColumn(string columnName,int groupLevel, ListSortDirection sortDirection):base(columnName,sortDirection)
		{
			this.groupLevel = groupLevel;
			if (groupLevel < 0) {
				throw new GroupLevelException();
			}
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:7,代码来源:GroupColumn.cs

示例6: dataGrid1_Sorting

        private void dataGrid1_Sorting(object sender, DataGridSortingEventArgs e)
        {
            sortMemberPath = e.Column.SortMemberPath;
            sortDirection = e.Column.SortDirection != ListSortDirection.Ascending ?
                ListSortDirection.Ascending : ListSortDirection.Descending;

        }
开发者ID:annastazi09,项目名称:Git-Source-Control-Provider,代码行数:7,代码来源:CommitDetails.xaml.cs

示例7: Sort

        private void Sort(string sortBy, ListSortDirection direction)
        {
            try
            {
                ICollectionView dataView = CollectionViewSource.GetDefaultView(listView_log.DataContext);

                dataView.SortDescriptions.Clear();

                SortDescription sd = new SortDescription(sortBy, direction);
                dataView.SortDescriptions.Add(sd);
                if (_lastHeaderClicked2 != null)
                {
                    if (String.Compare(sortBy, _lastHeaderClicked2) != 0)
                    {
                        SortDescription sd2 = new SortDescription(_lastHeaderClicked2, _lastDirection2);
                        dataView.SortDescriptions.Add(sd2);
                    }
                }
                dataView.Refresh();

                Settings.Instance.ResColumnHead = sortBy;
                Settings.Instance.ResSortDirection = direction;

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
开发者ID:lokippc,项目名称:EDCB,代码行数:29,代码来源:NotifyLogWindow.xaml.cs

示例8: SortGlyphAdorner

 /// <summary>
 /// Initializes a new instance of the <see cref="SortGlyphAdorner"/> class.
 /// </summary>
 /// <param name="columnHeader">The column header</param>
 /// <param name="direction">The direction</param>
 /// <param name="sortGlyph">The image glyph</param>
 public SortGlyphAdorner(GridViewColumnHeader columnHeader, ListSortDirection direction, ImageSource sortGlyph)
     : base(columnHeader)
 {
     this.columnHeader = columnHeader;
     this.direction = direction;
     this.sortGlyph = sortGlyph;
 }
开发者ID:modulexcite,项目名称:shelvesetcomparer,代码行数:13,代码来源:SortGlyphAdorner.cs

示例9: Key

		internal Key(DataTable table,DataColumn[] columns,ListSortDirection[] sort, DataViewRowState rowState, IExpression filter)
		{
			_table = table;
			_filter = filter;
			if (_filter != null)
				_tmpRow = _table.NewNotInitializedRow();
			_columns = columns;
			if (sort != null && sort.Length == columns.Length) {
				_sortDirection = sort;
			}
			else {
				_sortDirection = new ListSortDirection[columns.Length];
				for(int i=0; i < _sortDirection.Length; i++) {
					_sortDirection[i] = ListSortDirection.Ascending;
				}
			}

			if (rowState != DataViewRowState.None) {
				_rowStateFilter = rowState;
			}
			else {
				// FIXME : what is the correct value ?
				_rowStateFilter = DataViewRowState.CurrentRows;
			}
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:25,代码来源:Key.cs

示例10: ColumnOrderSet

 public ColumnOrderSet(ColumnDefinition column, ListSortDirection order)
     : this()
 {
     column.ThrowIfNull("column");
     this.Column = column;
     this.Direction = order;
 }
开发者ID:catwalkagogo,项目名称:Heron,代码行数:7,代码来源:ColumnOrderDefinition.cs

示例11: ExtendedSortDescription

 public ExtendedSortDescription(string property, ListSortDirection? sortDirection, bool clearPreviousSorting)
     : this()
 {
     this.Property = property;
     this.SortDirection = sortDirection;
     this.ClearPreviousSorting = clearPreviousSorting;
 }
开发者ID:guidgets,项目名称:XamlGrid,代码行数:7,代码来源:ExtendedSortDescription.cs

示例12: refreshOutgoing

        public void refreshOutgoing()
        {
            this.BeginInvoke((ThreadStart)delegate
            {
                int scrollPosition = dg_outgoing.FirstDisplayedScrollingRowIndex;

                DataGridViewColumn sortedColumn = dg_outgoing.SortedColumn;
                ListSortDirection sorder = new ListSortDirection();
                bool doSort = true;
                if (dg_outgoing.SortOrder == SortOrder.Ascending) sorder = ListSortDirection.Ascending;
                else if (dg_outgoing.SortOrder == SortOrder.Descending) sorder = ListSortDirection.Descending;
                else doSort = false;

                Point pp = Point.Empty;
                if (dg_outgoing.SelectedCells.Count > 0)
                    pp = dg_outgoing.CurrentCellAddress;

                dg_outgoing.Rows.Clear();
                foreach (DictionaryEntry de in mtOut.getMessages())
                {
                    canMessage cm = (canMessage)de.Key;
                    dg_outgoing.Rows.Add(cm.getDataGridViewRow(dg_outgoing,mtOut));
                }

                if (doSort) dg_outgoing.Sort(sortedColumn,(ListSortDirection) sorder);

                if (scrollPosition > 0) dg_outgoing.FirstDisplayedScrollingRowIndex = scrollPosition;

                if (dg_outgoing.Rows.Count > 0 && pp.Y < dg_outgoing.Rows.Count)
                    dg_outgoing.CurrentCell = dg_outgoing.Rows[pp.Y].Cells[pp.X];

            });
        }
开发者ID:Cougar,项目名称:HomeAutomation,代码行数:33,代码来源:main.cs

示例13: SortExpression

 public SortExpression(string propertyName)
 {
     PropertyName = propertyName;
     SortDirection = ListSortDirection.Ascending;
     PropertyDescriptor = null;
     _propertyValueCache = new Hashtable();
 }
开发者ID:arpitgold,项目名称:Exceptionless,代码行数:7,代码来源:PropertyComparer.cs

示例14: SortAdorner

        public SortAdorner(UIElement element, ListSortDirection sortDirection)
            : base(element)
        {
            this.SortDirection  = sortDirection;

            this.PaintBrush     = ((element as GridViewColumnHeader).Column as DsxColumn).DataGrid.SortAdornerIndicatorBrush;
        }
开发者ID:hansuky,项目名称:Yuhan,代码行数:7,代码来源:SortAdorner.cs

示例15: SortDescriptionInfo

 public SortDescriptionInfo(
   DataGridItemPropertyBase property,
   ListSortDirection direction )
 {
   m_property = property;
   m_direction = direction;
 }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:7,代码来源:SortedDescriptionInfo.cs


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