本文整理汇总了C#中SortOrder类的典型用法代码示例。如果您正苦于以下问题:C# SortOrder类的具体用法?C# SortOrder怎么用?C# SortOrder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortOrder类属于命名空间,在下文中一共展示了SortOrder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: FindAllPlaylists
/// <summary>
/// Find all playlists in this account.
/// </summary>
/// <param name="pageSize">Number of playlists returned per page. A page is a subset of all of the playlists that
/// satisfy the request. The maximum page size is 50.</param>
/// <param name="pageNumber">The zero-indexed number of the page to return.</param>
/// <param name="sortBy">The property that you'd like to sort the results by.</param>
/// <param name="sortOrder">The order that you'd like the results sorted - ascending or descending.</param>
/// <param name="videoFields">A list of the fields you wish to have populated in the Videos
/// contained in the playlists. If you omit this parameter, the method returns the following fields of the
/// Video: id, name, shortDescription, longDescription, creationDate, publisheddate, lastModifiedDate, linkURL,
/// linkText, tags, videoStillURL, thumbnailURL, referenceId, length, economics, playsTotal, playsTrailingWeek.
/// If you use a token with URL access, this method also returns the Videos' FLVURL, renditions, FLVFullLength,
/// videoFullLength.</param>
/// <param name="playlistFields">A list of the fields you wish to have populated in the Playlists
/// contained in the returned object. If you omit this parameter, all playlist fields are returned.</param>
/// <param name="customFields">A list of the custom fields you wish to have populated in the videos
/// contained in the returned object. If you omit this parameter, no custom fields are returned, unless you include
/// the value 'customFields' in the video_fields parameter.</param>
/// <param name="getItemCount">If true, also return how many total results there are.</param>
/// <returns>A collection of Playlists that is the specified subset of all the playlists in this account.</returns>
public BrightcoveItemCollection<BrightcovePlaylist> FindAllPlaylists(int pageSize, int pageNumber, SortBy sortBy, SortOrder sortOrder, IEnumerable<string> videoFields,
IEnumerable<string> playlistFields, IEnumerable<string> customFields, bool getItemCount)
{
NameValueCollection parms = BuildBasicReadParams("find_all_playlists");
parms.Add("page_size", pageSize.ToString());
parms.Add("page_number", pageNumber.ToString());
parms.Add("sort_by", sortBy.ToBrightcoveName());
parms.Add("sort_order", sortOrder.ToBrightcoveName());
parms.Add("get_item_count", getItemCount.ToString().ToLower());
if (videoFields != null)
{
parms.AddRange("video_fields", videoFields);
}
if (playlistFields != null)
{
parms.AddRange("playlist_fields", playlistFields);
}
if (customFields != null)
{
parms.AddRange("custom_fields", customFields);
}
return RunQuery<BrightcoveItemCollection<BrightcovePlaylist>>(parms);
}
开发者ID:Velir,项目名称:Brightcove4net,代码行数:49,代码来源:BrightcoveApi.playlist.read.cs
示例17: SetSortIcon
public static void SetSortIcon(this ColumnHeader column, SortOrder order)
{
ListView listView = column.ListView;
IntPtr columnHeader = SendMessage(listView.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero);
for (int i = 0; i <= listView.Columns.Count - 1; i++)
{
IntPtr ColumnPtr = new IntPtr(i);
LVCOLUMN lvColumn = new LVCOLUMN();
lvColumn.mask = HDI_FORMAT;
SendMessage(columnHeader, HDM_GETITEM, ColumnPtr, ref lvColumn);
if (!(order == SortOrder.None) && i == column.Index)
{
switch (order)
{
case SortOrder.Ascending:
lvColumn.fmt &= ~HDF_SORTDOWN;
lvColumn.fmt |= HDF_SORTUP;
break;
case SortOrder.Descending:
lvColumn.fmt &= ~HDF_SORTUP;
lvColumn.fmt |= HDF_SORTDOWN;
break;
}
}
else
{
lvColumn.fmt &= ~HDF_SORTDOWN & ~HDF_SORTUP;
}
SendMessage(columnHeader, HDM_SETITEM, ColumnPtr, ref lvColumn);
}
}
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:34,代码来源:ColumnHeaderExtensions.cs
示例18: OrderBy
public static SearchParams OrderBy(this SearchParams qry, string paramName, SortOrder order = SortOrder.Ascending)
{
if (paramName == null) throw Error.ArgumentNull("paramName");
qry.Sort.Add(Tuple.Create(paramName, order));
return qry;
}
开发者ID:alexandru360,项目名称:fhir-net-api,代码行数:7,代码来源:SearchParamsExtensions.cs
示例19: FindAllAsync
public async static Task<PagedList<Article>> FindAllAsync(string type, string query = null, IEnumerable<string> fields = null, int page = 1, int pageSize = 20, string orderBy = null, SortOrder sortOrder = SortOrder.Descending )
{
var service = ObjectFactory.Build<IArticleService>();
var request = new FindAllArticleRequest()
{
Type = type,
Query = query,
PageNumber = page,
PageSize = pageSize,
OrderBy = orderBy,
SortOrder = sortOrder
};
var response = await service.FindAllAsync(request);
if (response.Status.IsSuccessful == false)
throw response.Status.ToFault();
var articles = new PagedList<Article>()
{
PageNumber = response.PagingInfo.PageNumber,
PageSize = response.PagingInfo.PageSize,
TotalRecords = response.PagingInfo.TotalRecords,
GetNextPage = async skip => await FindAllAsync(type, query, fields, page+skip+1, pageSize)
};
articles.AddRange(response.Articles);
return articles;
}
开发者ID:beer-bahadur,项目名称:appacitive-dotnet-sdk,代码行数:26,代码来源:Article.cs
示例20: StockReaderForm
public StockReaderForm()
{
InitializeComponent();
stockDataGridView.AutoGenerateColumns = false;
LoadConfigInfo();
BindColumns();
notifyIcon1.Visible = false;
dataList = new SortableBindingList<TickerData>();
portfolioPath = "";
if (portfolio != null)
ProcessTickers();
sortColumn = stockDataGridView.Columns[0];
sortOrder = stockDataGridView.SortOrder;
//int interval = info.TimerInterval;
if (config.ConfigData.Timer.interval <= 0)
{
tickerTimer.Interval = 60000; // default to 1 minute
}
else
{
tickerTimer.Interval = config.ConfigData.Timer.interval * 60000;
}
tickerTimer.Enabled = true;
}
开发者ID:cdkmoose,项目名称:StockReader,代码行数:31,代码来源:StockReaderForm.cs
注:本文中的SortOrder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论