• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ListSortDirection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: InternalSortColumn

 private void InternalSortColumn(int column, ListSortDirection? direction)
 {
     HDF hdf;
     if (this.ReadColumnFormat(column, out hdf))
     {
         hdf &= ~(HDF.HDF_SORTUP | HDF.HDF_SORTDOWN);
         if (direction.HasValue)
         {
             hdf |= (((ListSortDirection) direction.Value) == ListSortDirection.Descending) ? 0x200 : 0x400;
         }
         HDITEM hditem = new HDITEM {
             mask = HDI.HDI_FORMAT,
             fmt = hdf
         };
         GCHandle handle = GCHandle.Alloc(hditem, GCHandleType.Pinned);
         try
         {
             this.HeaderItemPtr = handle.AddrOfPinnedObject();
             Windows.SendMessage(base.Handle, 0x120c, (IntPtr) column, this.HeaderItemPtr);
         }
         finally
         {
             handle.Free();
             this.HeaderItemPtr = IntPtr.Zero;
         }
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:27,代码来源:ListViewHeader.cs


示例17: Sort

 public static void Sort(ItemsControl listView, string sortBy, ListSortDirection direction)
 {
     listView.Items.SortDescriptions.Clear();
     var sd = new SortDescription(sortBy, direction);
     listView.Items.SortDescriptions.Add(sd);
     listView.Items.Refresh();
 }
开发者ID:naeemkhedarun,项目名称:ShoutcastBrowser,代码行数:7,代码来源:GridViewColumnSorter.cs


示例18: SortAdorner

 public SortAdorner(UIElement element, ListSortDirection sortDirection)
     : base(element)
 {
     SortDirection = sortDirection;
     // We want to let the things we're adorning handle events
     IsHitTestVisible = false;
 }
开发者ID:rsudama,项目名称:Klabr,代码行数:7,代码来源:SortAdorner.cs


示例19: AddSort

 public void AddSort(string sortColumn, ListSortDirection dir)
 {
     if (sortColumns.ContainsKey(sortColumn))
         sortColumns.Remove(sortColumn);           
    
    sortColumns.Add(sortColumn, dir);
 }
开发者ID:hpbaotho,项目名称:sambapos,代码行数:7,代码来源:ListViewCustomComparer.cs


示例20: FileListPaneSettings

 public FileListPaneSettings(string directory, string sortByField, ListSortDirection sortDirection, ColumnMode columnMode)
 {
     Directory = directory;
     SortByField = sortByField;
     SortDirection = sortDirection;
     DisplayColumnMode = columnMode;
 }
开发者ID:mousetwentytwo,项目名称:test,代码行数:7,代码来源:FileListPaneSettings.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ListTagsForResourceRequestMarshaller类代码示例发布时间:2022-05-24
下一篇:
C# ListResult类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap