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


C# List.Sort方法代码示例

本文整理汇总了C#中fyiReporting.RDL.List.Sort方法的典型用法代码示例。如果您正苦于以下问题:C# List.Sort方法的具体用法?C# List.Sort怎么用?C# List.Sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fyiReporting.RDL.List的用法示例。


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

示例1: BuildTable

        private string BuildTable()
        {
            StringBuilder sb = new StringBuilder();
            float width = TableWidth();
            sb.AppendFormat("<table style=\"table-layout:fixed;width:{0}pt;border-style:none;border-collapse:collapse;\">", width);

            // Define the columns
            sb.Append("<colgroup>");
            List<ReportItem> riSort = new List<ReportItem>(_ris.Items);
            riSort.Sort(CompareRIsByX);

          //  float last_offset=0;
            float offset;
            float pt;
            for (int i = 0; i < riSort.Count; i++)
            {
                pt = riSort[i].LeftCalc(_rpt);

                sb.AppendFormat("<col style=\"width:{0}pts;\">", pt);

                offset = pt + riSort[i].WidthOrOwnerWidth(_rpt);

             //   if (last_offset < offset)
            }
            sb.Append("</colgroup>");

            // Define the rows
            riSort.Sort(CompareRIsByY);

            sb.Append("</table>");
            return sb.ToString();
        }
开发者ID:NelsonSantos,项目名称:fyiReporting-Android,代码行数:32,代码来源:TablePositioner.cs

示例2: InitFunctions

        void InitFunctions(TreeNode ndRoot)
        {
            List<string> ar = new List<string>();

            ar.AddRange(StaticLists.FunctionList);

            // Build list of methods in the  VBFunctions class
            fyiReporting.RDL.FontStyleEnum fsi = FontStyleEnum.Italic;	// just want a class from RdlEngine.dll assembly
            Assembly a = Assembly.GetAssembly(fsi.GetType());
            if (a == null)
                return;
            Type ft = a.GetType("fyiReporting.RDL.VBFunctions");
            BuildMethods(ar, ft, "");

            // build list of financial methods in Financial class
            ft = a.GetType("fyiReporting.RDL.Financial");
            BuildMethods(ar, ft, "Financial.");

            a = Assembly.GetAssembly("".GetType());
            ft = a.GetType("System.Math");
            BuildMethods(ar, ft, "Math.");

            ft = a.GetType("System.Convert");
            BuildMethods(ar, ft, "Convert.");

            ft = a.GetType("System.String");
            BuildMethods(ar, ft, "String.");

            ar.Sort();
            string previous = "";
            foreach (string item in ar)
            {
                if (item != previous)	// don't add duplicates
                {
                    // Add the node to the tree
                    TreeNode aRoot = new TreeNode(item);
                    ndRoot.Nodes.Add(aRoot);
                }
                previous = item;
            }
        }
开发者ID:yw0903,项目名称:My-FyiReporting,代码行数:41,代码来源:DialogExprEditor.cs

示例3: AddParametersAsLiterals

		private string AddParametersAsLiterals(Report rpt, IDbConnection cn, string sql, bool bValue)
		{
			// No parameters means nothing to do
			if (this._QueryParameters == null ||
				this._QueryParameters.Items == null ||
				this._QueryParameters.Items.Count == 0)
				return sql;

			// Only do this for ODBC datasources - AddParameters handles it in other cases
            if (!RdlEngineConfig.DoParameterReplacement(Provider, cn))
            {
                if (!_QueryParameters.ContainsArray)    // when array we do substitution
                    return sql;
            }

			StringBuilder sb = new StringBuilder(sql);
            List<QueryParameter> qlist;
			if (_QueryParameters.Items.Count <= 1)
				qlist = _QueryParameters.Items;
			else
			{	// need to sort the list so that longer items are first in the list
				// otherwise substitution could be done incorrectly
                qlist = new List<QueryParameter>(_QueryParameters.Items);
				qlist.Sort();
			}

			foreach(QueryParameter qp in qlist)
			{
				string paramName;

				// force the name to start with @
				if (qp.Name.Nm[0] == '@')
					paramName = qp.Name.Nm;
				else
					paramName = "@" + qp.Name.Nm;

				// build the replacement value
				string svalue;
				if (bValue)
				{	// use the value provided
                    svalue = this.ParameterValue(rpt, qp);
				}
				else
				{	// just need a place holder value that will pass parsing
					switch (qp.Value.Expr.GetTypeCode())
					{
						case TypeCode.Char:
							svalue = "' '";
							break;
						case TypeCode.DateTime:
							svalue = "'1900-01-01 00:00:00'";
							break;
						case TypeCode.Decimal:
						case TypeCode.Double:
						case TypeCode.Int32:
						case TypeCode.Int64:
							svalue = "0";
							break;
						case TypeCode.Boolean:
							svalue = "'false'";
							break;
						case TypeCode.String:
						default:
							svalue = "' '";
							break;
					}
				}
				sb.Replace(paramName, svalue);
			}
			return sb.ToString();
		}
开发者ID:romeroyonatan,项目名称:opendental,代码行数:71,代码来源:Query.cs


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