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


C# SortType类代码示例

本文整理汇总了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);
        }
开发者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


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