本文整理汇总了C#中SortType类的典型用法代码示例。如果您正苦于以下问题:C# SortType类的具体用法?C# SortType怎么用?C# SortType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortType类属于命名空间,在下文中一共展示了SortType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreatePropertiesField
/// <summary>
/// Creates a field that holds <see cref="QueryTypeProperties{T}"/> for the module.
/// </summary>
protected FieldDeclarationSyntax CreatePropertiesField(
Module module, string resultClassName, FieldDeclarationSyntax propsField, SortType? sortType)
{
var queryTypePropertiesType = SyntaxEx.GenericName("QueryTypeProperties", resultClassName);
var propertiesInitializer = SyntaxEx.ObjectCreation(
queryTypePropertiesType,
SyntaxEx.Literal(module.Name),
SyntaxEx.Literal(module.Prefix),
module.QueryType == null
? (ExpressionSyntax)SyntaxEx.NullLiteral()
: SyntaxEx.MemberAccess("QueryType", module.QueryType.ToString()),
sortType == null
? (ExpressionSyntax)SyntaxEx.NullLiteral()
: SyntaxEx.MemberAccess("SortType", sortType.ToString()),
CreateTupleListExpression(GetBaseParameters(module)),
propsField == null ? (ExpressionSyntax)SyntaxEx.NullLiteral() : (NamedNode)propsField,
resultClassName == "object"
? (ExpressionSyntax)SyntaxEx.LambdaExpression("_", SyntaxEx.NullLiteral())
: SyntaxEx.MemberAccess(resultClassName, "Parse"));
return SyntaxEx.FieldDeclaration(
new[] { SyntaxKind.PrivateKeyword, SyntaxKind.StaticKeyword, SyntaxKind.ReadOnlyKeyword },
queryTypePropertiesType, ClassNameBase + "Properties", propertiesInitializer);
}
开发者ID:krk,项目名称:LINQ-to-Wiki,代码行数:28,代码来源:ModuleGeneratorBase.cs
示例2: SortedField
/// <summary>
/// Construct the object.
/// </summary>
///
/// <param name="theIndexindex">The index of the sorted field.</param>
/// <param name="t">The type of sort, the type of object.</param>
/// <param name="theAscending">True, if this is an ascending sort.</param>
public SortedField(int theIndexindex, SortType t,
bool theAscending)
{
_index = theIndexindex;
Ascending = theAscending;
_sortType = t;
}
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:14,代码来源:SortedField.cs
示例3: DrawArrow
public override void DrawArrow(Context cr, Gdk.Rectangle alloc, SortType type)
{
cr.LineWidth = 1;
cr.Translate (0.5, 0.5);
double x1 = alloc.X;
double x3 = alloc.X + alloc.Width / 2.0;
double x2 = x3 + (x3 - x1);
double y1 = alloc.Y;
double y2 = alloc.Bottom;
if (type == SortType.Ascending) {
cr.MoveTo (x1, y1);
cr.LineTo (x2, y1);
cr.LineTo (x3, y2);
cr.LineTo (x1, y1);
} else {
cr.MoveTo (x3, y1);
cr.LineTo (x2, y2);
cr.LineTo (x1, y2);
cr.LineTo (x3, y1);
}
cr.SetSourceColor (Colors.GetWidgetColor (GtkColorClass.Base, StateType.Normal));
cr.FillPreserve ();
cr.SetSourceColor (Colors.GetWidgetColor (GtkColorClass.Text, StateType.Normal));
cr.Stroke ();
cr.Translate (-0.5, -0.5);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:28,代码来源:GtkTheme.cs
示例4: CChartParameter
public CChartParameter(string ip_chart_description, string ip_Order_col_name, string ip_Caption_col_name, string ip_Data_col_name, SortType ip_sort_type)
{
strCaptionColName = ip_Caption_col_name;
strDataColName = ip_Data_col_name;
strOrderColName = ip_Order_col_name;
strCaptionOfChart = ip_chart_description;
type = ip_sort_type;
}
开发者ID:tudm,项目名称:QuanLyHanhChinh,代码行数:8,代码来源:CChartParameter.cs
示例5: SortOrder
/// <summary>
/// A simple class that holds a single sort criterion.
/// </summary>
/// <param name="property">The data class' property to sort on.</param>
/// <param name="direction">The direction to sort based on the Property.</param>
public SortOrder(string property, SortType direction)
{
if (property == null)
{
throw new ArgumentNullException("property",
"Property must be a valid property/field name from the data class.");
}
Property = property;
Direction = direction;
}
开发者ID:azavea,项目名称:net-dao,代码行数:15,代码来源:SortOrder.cs
示例6: GetFollowedChannels
public TwitchList<FollowedChannel> GetFollowedChannels(string user, PagingInfo pagingInfo = null, SortDirection sortDirection = SortDirection.desc, SortType sortType = SortType.created_at)
{
var request = GetRequest("users/{user}/follows/channels", Method.GET);
request.AddUrlSegment("user", user);
TwitchHelper.AddPaging(request, pagingInfo);
request.AddParameter("direction", sortDirection);
request.AddParameter("sortby", sortType);
var response = restClient.Execute<TwitchList<FollowedChannel>>(request);
return response.Data;
}
开发者ID:erdincay,项目名称:TwitchCSharp,代码行数:10,代码来源:TwitchReadOnlyClient.cs
示例7: GetFieldTexts
public static EnumDescription[] GetFieldTexts(Type enumType, SortType sortType)
{
if (!EnumDescription.hashtable_0.Contains(enumType.FullName))
{
FieldInfo[] fields = enumType.GetFields();
ArrayList arrayList = new ArrayList();
FieldInfo[] array = fields;
for (int i = 0; i < array.Length; i++)
{
FieldInfo fieldInfo = array[i];
object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(EnumDescription), false);
if (customAttributes.Length == 1)
{
((EnumDescription)customAttributes[0]).fieldInfo_0 = fieldInfo;
arrayList.Add(customAttributes[0]);
}
}
EnumDescription.hashtable_0.Add(enumType.FullName, arrayList.ToArray(typeof(EnumDescription)));
}
EnumDescription[] array2 = (EnumDescription[])EnumDescription.hashtable_0[enumType.FullName];
if (array2.Length <= 0)
{
int num = 0;
while (num < array2.Length && sortType != SortType.Default)
{
for (int j = num; j < array2.Length; j++)
{
bool flag = false;
switch (sortType)
{
case SortType.DisplayText:
if (string.CompareOrdinal(array2[num].EnumDisplayText, array2[j].EnumDisplayText) > 0)
{
flag = true;
}
break;
case SortType.Rank:
if (array2[num].EnumRank > array2[j].EnumRank)
{
flag = true;
}
break;
}
if (flag)
{
EnumDescription enumDescription = array2[num];
array2[num] = array2[j];
array2[j] = enumDescription;
}
}
num++;
}
}
return array2;
}
开发者ID:alexliu1987,项目名称:One.Authorization,代码行数:55,代码来源:EnumDescription.cs
示例8: QueryTypeProperties
protected QueryTypeProperties(
string moduleName, string prefix, QueryType? queryType, SortType? sortType,
IEnumerable<Tuple<string, string>> baseParameters, IDictionary<string, string[]> props)
{
ModuleName = moduleName;
Prefix = prefix;
QueryType = queryType;
SortType = sortType;
BaseParameters = baseParameters;
m_props = props ?? new Dictionary<string, string[]>();
}
开发者ID:joshbtn,项目名称:LINQ-to-Wiki,代码行数:11,代码来源:QueryTypeProperties.cs
示例9: CustomInitializeComponent
private void CustomInitializeComponent()
{
var cfg = _provider.GetRequiredService<IRsdnForumService>().GetConfig();
_sortBy =
cfg.ShowFullForumNames
? _sortByDesc
: _sortByName;
_sortType =
cfg.ShowFullForumNames
? SortType.ByDesc
: SortType.ByName;
InitListView(false);
}
开发者ID:rsdn,项目名称:janus,代码行数:13,代码来源:SubscribeForm.cs
示例10: Sort
public void Sort(Range key1=null, SortOrder? order1=null, Range key2 = null, SortType? type = null, SortOrder? order2 = null, Range key3 = null, SortOrder? order3 = null, YesNoGuess? header = YesNoGuess.No)
{
//if (!(key1 is String) && !(key1 is Range) && key1 != null)
// throw new ArgumentException("Key1 must be a string (range named) or a range object");
//if (!(key2 is String) && !(key2 is Range) && key2 != null)
// throw new ArgumentException("Key2 must be a string (range named) or a range object");
//if (!(key3 is String) && !(key3 is Range) && key3 != null)
// throw new ArgumentException("Key3 must be a string (range named) or a range object");
InternalObject.GetType().InvokeMember("Sort", System.Reflection.BindingFlags.InvokeMethod, null, InternalObject, ComArguments.Prepare(key1, order1, key2, order2, key3, order3, header));
}
开发者ID:dixonte,项目名称:STC.Automation.Office,代码行数:13,代码来源:Range.cs
示例11: FilterViewModel
public FilterViewModel(int columnId, string columnName, SortType sortType, BindableCollection<FilterCriteriaViewModel> filterCriteria, VideoPlayerViewModel viewModel)
{
this.columnId = columnId;
this.ColumnHeaderName = columnName;
this.sortType = sortType;
this.filterCriteria = filterCriteria;
this.viewModel = viewModel;
IsAscendingChecked = false;
IsDescendingChecked = false;
IsNoneChecked = true;
ApplyButtonVisibility = "Visible";
RemoveButtonVisibility = "Collapsed";
CloseButtonVisibility = "Visible";
}
开发者ID:jwiese-ms,项目名称:hudl-win8,代码行数:14,代码来源:FilterViewModel.cs
示例12: DetailSort
/// <summary>
/// Sorts the items in a ListView in detail view by one of the columns, remembering previous sorting.
/// </summary>
/// <param name="list">ListView being sorted.</param>
/// <param name="sortColumnIndex">Column to sort by.</param>
/// <param name="sort">How to sort the data in the column.</param>
/// <param name="reverse">True if list should be sorted in reverse order.</param>
/// <param name="indicatorColumnIndex">Column to show sort indicator on.</param>
public static void DetailSort(this ListView list, int sortColumnIndex, SortType sort, bool reverse, int indicatorColumnIndex) {
if(list.View != View.Details)
throw new ArgumentException(Properties.Resources.DetailsViewRequiredMessage, "list");
ListViewItemSorter sorter = list.ListViewItemSorter as ListViewItemSorter;
if(sorter == null) {
sorter = new ListViewItemSorter(sortColumnIndex, sort, reverse, indicatorColumnIndex);
list.ListViewItemSorter = sorter;
} else {
if(sorter.IndicatorColumn != indicatorColumnIndex)
HideSortIndicator(list, sorter.IndicatorColumn);
sorter.SortBy(sortColumnIndex, sort, reverse, indicatorColumnIndex);
}
ShowSortIndicator(list, indicatorColumnIndex, reverse);
list.Sort();
}
开发者ID:misterhaan,项目名称:au.util,代码行数:23,代码来源:ListViewUtil.cs
示例13: OperationSearch
/// <summary>
/// Constructor for Search operation. Takes in the following parameters
/// to define the search filters to be used when the operation is executed.
/// </summary>
/// <param name="searchString">The string which the task name must contain to match the search.</param>
/// <param name="startTime">The start time by which the task must within to match the search.</param>
/// <param name="endTime">The end time by which the task must within to match the search.</param>
/// <param name="isSpecific">The specificty of the time ranges.</param>
/// <param name="searchType">The type of search filter to use in addition to the other filters.</param>
/// <param name="sortType">The type of sort to sort the diplay list by after the operation is executed.</param>
/// <returns>Response containing the search results, the operation's success or failure, and the new sort type if any.</returns>
public OperationSearch(
string searchString,
DateTime? startTime,
DateTime? endTime,
DateTimeSpecificity isSpecific,
SearchType searchType,
SortType sortType)
: base(sortType)
{
this.searchString = searchString;
this.startTime = startTime;
this.endTime = endTime;
this.isSpecific = isSpecific;
this.searchType = searchType;
}
开发者ID:RavenXce,项目名称:ToDo_PlusPlus,代码行数:26,代码来源:OperationSearch.cs
示例14: OperationSchedule
/// <summary>
/// This is the constructor for the Schedule operation.
/// This operation accepts a time range and tries to schedule a task
/// for the specified time period within the time range at the earliest
/// possible point on execution.</summary>
/// <param name="taskName">The name of the task to schedule.</param>
/// <param name="startDateTime">The start date/time which the task should be scheduled within.</param>
/// <param name="endDateTime">The end date/time which the task should be scheduled within.</param>
/// <param name="isSpecific">The specificity of the start and end date time ranges.</param>
/// <param name="timeRangeAmount">The numerical value of the task length of the task to be scheduled.</param>
/// <param name="timeRangeType">The type of time length the task uses: hour, day, week or month.</param>
/// <param name="sortType">The type of sort to sort the diplay list by after the operation is executed.</param>
/// <returns>Nothing.</returns>
public OperationSchedule(
string taskName,
DateTime startDateTime,
DateTime? endDateTime,
DateTimeSpecificity isSpecific,
int timeRangeAmount,
TimeRangeType timeRangeType,
SortType sortType)
: base(sortType)
{
this.taskName = taskName;
this.startDateTime = startDateTime;
this.endDateTime = endDateTime;
this.isSpecific = isSpecific;
this.taskDurationAmount = timeRangeAmount;
this.taskDurationType = timeRangeType;
}
开发者ID:soulslicer,项目名称:ToDoPlusPlus,代码行数:30,代码来源:OperationSchedule.cs
示例15: MainWindowViewModel
public MainWindowViewModel(MainWindow window)
{
_window = window;
_selectedTasks = new List<Task>();
Log.LogLevel = User.Default.DebugLoggingOn ? LogLevel.Debug : LogLevel.Error;
Log.Debug("Initializing Todotxt.net");
SortType = (SortType)User.Default.CurrentSort;
if (!string.IsNullOrEmpty(User.Default.FilePath))
{
LoadTasks(User.Default.FilePath);
}
}
开发者ID:aviera,项目名称:todotxt.net,代码行数:17,代码来源:MainWindowViewModel.cs
示例16: SortItems
private void SortItems(SortType sortType)
{
IOrderedEnumerable<ExplorerItem> sortedSource = null;
if (sortType == SortType.Date)
sortedSource = SortByDate(ExplorerItems);
else if (sortType == SortType.Name)
sortedSource = SortByName(ExplorerItems);
else if (sortType == SortType.Size)
sortedSource = SortBySize(ExplorerItems);
else if (sortType == SortType.Type)
sortedSource = SortByType(ExplorerItems);
else if (sortType == SortType.None)
return;
if (sortedSource != null)
{
RerangeDataSource(sortedSource);
_counterForLoadUnloadedItems = 0;
}
}
开发者ID:CasaTeam,项目名称:MetroExplorer,代码行数:19,代码来源:PageExplorerSort.cs
示例17: FlightResponseSettings
/// <summary>
/// Initializes a new instance of the FlightResponseSettings with the specified parameters
/// </summary>
/// <param name="sortType">The property to sort on</param>
/// <param name="sortOrder">Sort direction</param>
/// <param name="maxStops">Filter for maximum number of stops. Between 0 and 3</param>
/// <param name="maxDuration">Filter for maximum duration in minutes</param>
/// <param name="outboundDepartureTime">Filter for outbound departure time by time period of the day </param>
/// <param name="outboundDepartureStartTime">Filter for start of range for outbound departure time</param>
/// <param name="outboundDepartureEndTime">Filter for end of range for outbound departure time</param>
/// <param name="inboundDepartureTime">Filter for inbound departure time by time period of the day </param>
/// <param name="inboundDepartureStartTime">Filter for start of range for inbound departure time</param>
/// <param name="inboundDepartureEndTime">Filter for end of range for inbound departure time</param>
/// <param name="originAirports">Origin airports to filter on. List of airport codes</param>
/// <param name="destinationAirports">Destination airports to filter on. List of airport codes</param>
/// <param name="includeCarriers">Filter flights by the specified carriers. Must be Iata carrier codes</param>
/// <param name="excludeCarriers">Filter flights by any but the specified carriers. Must be Iata carrier codes</param>
/// <param name="carrierSchema">The code schema to use for carriers</param>
/// <param name="locationSchema">The code schema used for locations</param>
public FlightResponseSettings(
SortType sortType = SortType.Price, SortOrder sortOrder = SortOrder.Ascending,
int? maxStops = null, int? maxDuration = null,
DayTimePeriod? outboundDepartureTime = null, LocalTime? outboundDepartureStartTime = null,
LocalTime? outboundDepartureEndTime = null,
DayTimePeriod? inboundDepartureTime = null, LocalTime? inboundDepartureStartTime = null,
LocalTime? inboundDepartureEndTime = null,
IEnumerable<string> originAirports = null, IEnumerable<string> destinationAirports = null,
IEnumerable<string> includeCarriers = null, IEnumerable<string> excludeCarriers = null,
CarrierSchema carrierSchema = CarrierSchema.Iata, LocationSchema locationSchema = LocationSchema.Iata)
{
if (maxStops.HasValue && (maxStops.Value < 0 || maxStops.Value > 3))
{
throw new ArgumentException("The filter for maximum number of stops must be between 0 and 3", nameof(maxStops));
}
if (maxDuration.HasValue && (maxDuration.Value < 0 || maxDuration.Value > 1800))
{
throw new ArgumentException("The filter for maximum duration must be between 0 and 1800", nameof(maxDuration));
}
MaxDuration = maxDuration;
MaxStops = maxStops;
SortOrder = sortOrder;
SortType = sortType;
CarrierSchema = carrierSchema;
LocationSchema = locationSchema;
OriginAirports = originAirports;
DestinationAirports = destinationAirports;
IncludeCarriers = includeCarriers;
ExcludeCarriers = excludeCarriers;
OutboundDepartureTime = outboundDepartureTime;
OutboundDepartureStartTime = outboundDepartureStartTime;
OutboundDepartureEndTime = outboundDepartureEndTime;
InboundDepartureTime = inboundDepartureTime;
InboundDepartureStartTime = inboundDepartureStartTime;
InboundDepartureEndTime = inboundDepartureEndTime;
}
开发者ID:jochenvanwylick,项目名称:SkyScanner,代码行数:62,代码来源:FlightResponseSettings.cs
示例18: GetList
public static List<string> GetList(SortType type, int zone,int page,DateTime from,DateTime to)
{
Log.Info("正在获取排行 - 依据" + type.ToString().ToLower() + "/分区" + zone + "/分页" + page + "/时间" + from.ToString("yyyy-MM-dd") + "~" + to.ToString("yyyy-MM-dd"));
string url = "http://www.bilibili.com/list/" + type.ToString() + "-" + zone + "-" + page + "-" + from.ToString("yyyy-MM-dd") + "~" + to.ToString("yyyy-MM-dd") + ".html";
string html = BiliInterface.GetHtml(url);
if (html == null) return null;
int p = 0;
List<string> r = new List<string>();
while (html.IndexOf("o/av", p) > 0)
{
p = html.IndexOf("o/av", p);
string s = html.Substring(p + 2, html.IndexOf("/", p + 2) - p - 2);
if (!r.Contains(s))
r.Add(s);
p += 3;
}
return r;
}
开发者ID:SkiTiSu,项目名称:BiliRanking,代码行数:19,代码来源:BiliParse.cs
示例19: OperationModify
/// <summary>
/// This is the constructor for the Modify operation.
/// It will modify the task indicated by the index range to the new
/// parameters specified by the given arguments. If an arguement
/// is left empty or null, that parameter will remain unchanged.
/// </summary>
/// <param name="taskName">The name of the task to modified. Can be a substring of it.</param>
/// <param name="indexRange">The display index of the task to be modified.</param>
/// <param name="startTime">The new start date to set for the task.</param>
/// <param name="endTime">The new end date to set for the task.</param>
/// <param name="isSpecific">The new Specificity of the dates for the task.</param>
/// <param name="isAll">If this boolean is true, the operation will be invalid.</param>
/// <param name="searchType">The type of search to be carried out (in addition to the other filters) if required.</param>
/// <param name="sortType">The type of sort to sort the diplay list by after the operation is executed.</param>
/// <returns>Nothing.</returns>
public OperationModify(string taskName, int[] indexRange, DateTime? startTime,
DateTime? endTime, DateTimeSpecificity isSpecific, bool isAll, SearchType searchType, SortType sortType)
: base(sortType)
{
if (indexRange == null) hasIndex = false;
else
{
hasIndex = true;
this.startIndex = indexRange[TokenIndexRange.START_INDEX] - 1;
this.endIndex = indexRange[TokenIndexRange.END_INDEX] - 1;
}
if (taskName == null) this.taskName = "";
else this.taskName = taskName;
this.startTime = startTime;
this.endTime = endTime;
this.isSpecific = isSpecific;
this.isAll = isAll;
this.searchType = searchType;
}
开发者ID:RavenXce,项目名称:ToDo_PlusPlus,代码行数:34,代码来源:OperationModify.cs
示例20: Get
public ResponseResult<OrderModel> Get(int page, int page_size, DateTime start_date, DateTime end_date, OrderState order_state, string optional_fields = "", SortType sortType = SortType.Ase, DateType dateType = DateType.Modify_Time)
{
IJdClient client = new DefaultJdClient("","","");
//http://jos.jd.com/api/detail.htm?id=691 接口地址
var response = client.Execute(new UnionOrderServiceQueryOrdersRequest());
//判断 是否接受错误 可忽略
if (response.IsError)
{
}
//对结果进行解析 理论上是响应的结果
var t = response.queryordersResult;
//是一窜json格式 OrderModel需要 对响应结果解析并且转换
var parse=JsonConvert.DeserializeObject<OrderModel>(t);
return new ResponseResult<OrderModel> {
Code = int.Parse(response.ErrCode),
Result = parse
};
//throw new NotImplementedException();
}
开发者ID:thk-liu,项目名称:ERP--10-21,代码行数:21,代码来源:Order.cs
注:本文中的SortType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论