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


C# SortOrder类代码示例

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


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

示例1: FindAllAsync

        public async static Task<PagedList<Connection>> FindAllAsync(string type, string query = null, IEnumerable<string> fields = null, int page = 1, int pageSize = 20, string orderBy = null, SortOrder sortOrder = SortOrder.Descending)
        {
            var request = new FindAllConnectionsRequest()
            {
                Type = type,
                Query = query,
                PageNumber = page,
                PageSize = pageSize,
                OrderBy = orderBy,
                SortOrder = sortOrder
            };

            var response = await request.ExecuteAsync();
            if (response.Status.IsSuccessful == false)
                throw response.Status.ToFault();
            var connections = new PagedList<Connection>()
            {
                PageNumber = response.PagingInfo.PageNumber,
                PageSize = response.PagingInfo.PageSize,
                TotalRecords = response.PagingInfo.TotalRecords,
                GetNextPage = async skip => await FindAllAsync(type, query, fields, page + skip + 1, pageSize)
            };
            connections.AddRange(response.Connections);
            return connections;

        }
开发者ID:neilunadkat,项目名称:appacitive-dotnet-sdk,代码行数:26,代码来源:Connections.cs

示例2: HandleColumnClicked

        public void HandleColumnClicked(System.Windows.Forms.ListView listView, ColumnClickEventArgs e)
        {
            // Determine if clicked column is already the column that is being sorted.
            if (e.Column == this.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (this.Order == SortOrder.Ascending)
                {
                    this.Order = SortOrder.Descending;
                }
                else
                {
                    this.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                this.SortColumn = e.Column;
                this.Order = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            listView.Sort();            
        }
开发者ID:rlugojr,项目名称:Alferd-Spritesheet-Unpacker,代码行数:25,代码来源:ListViewSorter.cs

示例3: GetBestExistingData

 protected virtual List<BestMessageInfo> GetBestExistingData(string orderBy, SortOrder sortOrder, int count)
 {
     List<MessageData> list2;
     Assert.ArgumentNotNullOrEmpty(orderBy, "orderBy");
     this.AssertOrderBy(orderBy);
     Guid managerRoot = this.managerRoot.InnerItem.ID.ToGuid();
     List<BestMessageInfo> list = new List<BestMessageInfo>();
     do
     {
     list2 = analyticsDataGateway.GetAllCampaignsSorted(managerRoot, orderBy, sortOrder);
     if (list2.Count == 0)
     {
         return list;
     }
     int num = Math.Min(list.Count + list2.Count, count);
     List<Guid> campaigns = new List<Guid>();
     foreach (MessageData data in list2)
     {
         MessageItem message = this.FindMessage(data, managerRoot);
         if ((message != null) && (this.messageSentOnlyByContextUser(message)))
         {
             list.Add(this.CreateRow(message, data));
             if (list.Count >= num)
             {
                 return list;
             }
         }
     }
     this.analyticsDataGateway.MarkRemovedMessages(campaigns);
     }
     while (list2.Count >= 20);
     return list;
 }
开发者ID:katebutenko,项目名称:RecipientListManagement,代码行数:33,代码来源:BestMessagesRepository.cs

示例4: ReverseSortOrder

 public void ReverseSortOrder()
 {
     if (SortOrder == SortOrder.Ascending)
         SortOrder = SortOrder.Descending;
     else
         SortOrder = SortOrder.Ascending;
 }
开发者ID:NathanW2,项目名称:PhotoMapper,代码行数:7,代码来源:ListViewColumnSorter.cs

示例5: TryParseSortOrder

 private bool TryParseSortOrder(string direction, out SortOrder sortOrder)
 {
     switch (direction.Trim().ToLower())
     {
         case "asc":
         case "ascending":
         case "a":
         case "0":
             sortOrder = SortOrder.Ascending;
             return true;
         case "desc":
         case "descending":
         case "d":
         case "1":
             sortOrder = SortOrder.Descending;
             return true;
         case "":
         case null:
             sortOrder = SortOrder.Unspecified;
             return true;
         default:
             sortOrder = SortOrder.Unspecified;
             return false;
     }
 }
开发者ID:denholms,项目名称:LSCS,代码行数:25,代码来源:SortParameter.cs

示例6: Sort

 internal Sort(LocationField field, SortOrder order, double latitude, double longitude)
 {
     SortField = field;
     Order = order;
     Latitude = latitude;
     Longitude = longitude;
 }
开发者ID:dustrider,项目名称:Idol.net,代码行数:7,代码来源:Sort.cs

示例7: GetStudentsSorted

        private IList<Student> GetStudentsSorted(int pageIndex, int pageSize, string sortField, SortOrder order)
        {
            //Off course you are going to use a web service/wcf/EF call instead of this
            if (_students == null)
            {
                fillAllStudents();
            }
            
            IList<Student> result= new List<Student>();
            if (order == SortOrder.ASC)
            {
                if (sortField.ToLower() == "age")
                {
                    _students.OrderBy(x => x.Age).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList<Student>().ForEach(x=>result.Add(x));
                }
                else
                {
                    _students.OrderBy(x => x.Name).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList<Student>().ForEach(x => result.Add(x));
                }
            }
            else
            {
                if (sortField.ToLower() == "age")
                {
                    _students.OrderByDescending(x => x.Age).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList<Student>().ForEach(x => result.Add(x));
                }
                else
                {
                    _students.OrderByDescending(x => x.Name).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList<Student>().ForEach(x => result.Add(x));
                }
            }

            return result;
        }
开发者ID:Eugene-Murray,项目名称:EM.Cloud.KO_PagedGrid,代码行数:34,代码来源:HomeController.cs

示例8: Search

        /// <summary>
        /// Initializes a new instance of the <see cref="T:Switchvox.CallLogs.Search"/> class for searches where a single search criterion must be specified.
        /// </summary>
        /// <param name="startDate">The minimum date to search from.</param>
        /// <param name="endDate">The maximum date to search to.</param>
        /// <param name="searchData">A <see cref="Switchvox.CallLogs.Search.SingleItemSearchData"/> value representing the type of data this request will search for.</param>
        /// <param name="data">A single value corresponding with the type of data specified in <paramref name="searchData"/></param>
        /// <param name="sortOrder">How the response will be sorted</param>
        /// <param name="itemsPerPage">The maximum number of records to be returned by the response. An additional <paramref name="itemsPerPage"/> number of records can be retrieved by making additional requests and modifying the <paramref name="pageNumber"/></param>
        /// <param name="pageNumber">The page number of call record results to return.</param>
        public Search(DateTime startDate, DateTime endDate, SingleItemSearchData searchData, string data, SortOrder sortOrder = SortOrder.Desc, int itemsPerPage = 50, int pageNumber = 1)
            : base("switchvox.callLogs.search")
        {
            var searchDataElms = GetSingleItemSearchDataElms(searchData, data);

            ConstructXml(startDate, endDate, searchDataElms, sortOrder, itemsPerPage, pageNumber);
        }
开发者ID:brentj,项目名称:SwitchvoxAPI,代码行数:17,代码来源:Search.cs

示例9: ListViewColumnSorter

 //---------------------------------------------------------------------
 public ListViewColumnSorter()
 {
     ColumnToSort = 0;
     OrderOfSort = SortOrder.None;
     ObjectCompare = new CaseInsensitiveComparer();
     Order = SortOrder.Ascending;
 }
开发者ID:JanVanMeirvenne,项目名称:mpviewer,代码行数:8,代码来源:SortableListView.cs

示例10: ListViewColumnSorter

 public ListViewColumnSorter()
 {
     ColumnToSort = 0;
       OrderOfSort = SortOrder.None;
       numCompare = false;
       ObjectCompare = new CaseInsensitiveComparer();
 }
开发者ID:hdf,项目名称:Patcher2,代码行数:7,代码来源:ListViewColumnSorterClass.cs

示例11: ListViewColumnSorter

		/// <summary>
		/// Class constructor.  Initializes various elements
		/// </summary>
		public ListViewColumnSorter() {
			// Initialize the sort order to 'none'
			_orderOfSort = SortOrder.None;

			// Initialize the CaseInsensitiveComparer object
			_objectCompare = new CaseInsensitiveComparer(CultureInfo.CurrentCulture);
		}
开发者ID:Alex-Jaeger,项目名称:BitcoinFindAndRecover,代码行数:10,代码来源:ListViewColumnSorter.cs

示例12: ColumnSort

        /// <summary>
        /// call this from column click.
        /// </summary>
        /// <param name="lvs">an instance of listviewsorter</param>
        /// <param name="lv">The lv.</param>
        /// <param name="column">The column.</param>
        /// <param name="forceorder">if set to a value, will sort by that all the time, otherwise will sort as normal</param>
        public static void ColumnSort(ListViewSorter lvs, ListView lv, int column, SortOrder? forceorder = null)
        {
            try
            {
                lv.ListViewItemSorter = lvs;
                if (!(lv.ListViewItemSorter is ListViewSorter))
                    return;
                lvs = (ListViewSorter) lv.ListViewItemSorter;
            }
            catch (Exception)
            {
                return;
            }

            if (forceorder != null)
            {
                lv.Sorting = (SortOrder) forceorder;
            }
            else
            {
                //invert sorting
                lv.Sorting = lv.Sorting == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending;
            }
            lvs.ByColumn = column;

            lv.Sort();
        }
开发者ID:andreigec,项目名称:ANDREICSLIB,代码行数:34,代码来源:ListViewSorter.cs

示例13: Add

        public SortFields Add(Range key, SortOn sortOn = SortOn.Values, SortOrder order = SortOrder.Ascending, SortDataOption dataOption = SortDataOption.Normal)
        {
            InternalObject.GetType().InvokeMember("Add", System.Reflection.BindingFlags.InvokeMethod, null, InternalObject, ComArguments.Prepare(key, sortOn, order, dataOption));

            // I'm returning this since the documentation says it returns 'SortFields' not 'SortField'
            return this;
        }
开发者ID:dixonte,项目名称:STC.Automation.Office,代码行数:7,代码来源:SortFields.cs

示例14: OrderBy

 /// <summary>performance tip: expect to have only 1 order item</summary>
 public OrderBy(IExpression expr, SortOrder order)
 {
     orderByList = new List<Pair<IExpression, SortOrder>>(1)
                   {
                       new Pair<IExpression, SortOrder>(expr, order)
                   };
 }
开发者ID:tupunco,项目名称:Tup.Cobar4Net,代码行数:8,代码来源:OrderBy.cs

示例15: SetSortIcons

		public static void SetSortIcons(ListView listView, int previouslySortedColumn, int newSortColumn, SortOrder sorting) {
			IntPtr headerHandle = SendMessage(listView.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero);
			IntPtr newColumn = new IntPtr(newSortColumn);
			IntPtr prevColumn = new IntPtr(previouslySortedColumn);
			HDITEM hditem;
			// Only update the previous item if it existed and if it was a different one.
			if (previouslySortedColumn != -1 && previouslySortedColumn != newSortColumn) {
				// Clear icon from the previous column.
				hditem = new HDITEM();
				hditem.mask = HDI_FORMAT;
				ItemSendMessage(headerHandle, HDM_GETITEM, prevColumn, ref hditem);
				hditem.fmt &= ~HDF_SORTDOWN & ~HDF_SORTUP;
				ItemSendMessage(headerHandle, HDM_SETITEM, prevColumn, ref hditem);
			}
			// Set icon on the new column.
			hditem = new HDITEM();
			hditem.mask = HDI_FORMAT;
			ItemSendMessage(headerHandle, HDM_GETITEM, newColumn, ref hditem);
			if (sorting == SortOrder.Ascending) {
				hditem.fmt &= ~HDF_SORTDOWN;
				hditem.fmt |= HDF_SORTUP;
			}
			else {
				hditem.fmt &= ~HDF_SORTUP;
				hditem.fmt |= HDF_SORTDOWN;
			}
			ItemSendMessage(headerHandle, HDM_SETITEM, newColumn, ref hditem);
		}
开发者ID:TargetProcess,项目名称:Tp.Integration.Ide.VisualStudio,代码行数:28,代码来源:ListViewHelper.cs


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