本文整理汇总了C#中SortType类的典型用法代码示例。如果您正苦于以下问题:C# SortType类的具体用法?C# SortType怎么用?C# SortType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortType类属于命名空间,在下文中一共展示了SortType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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[]>();
}
示例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);
}
示例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));
}
示例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";
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
}