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


C# List.AddRange方法代码示例

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


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

示例1: Page_Load

        //public ResultLogs ModelResultLogs;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                    {
                        //显示初始化三个ref的值
                        //double ymax = 0;
                        //double xmax = 0;
                        //StringBuilder sb = new StringBuilder();
                        //ReadFileForChart("C:\\out\\initialization.dat", 3, 1, 3, ref ymax, ref xmax, ref sb);
                        //litForScript.Value = sb.ToString();

                        //显示初始化三个ref的值
                        double ymax = 0;
                        double xmax = 0;
                        StringBuilder sb = new StringBuilder();
                        string TaskID = Request["TaskID"];
                        //ModelYunBLL.ResultLogs BLLResultLogs = new ModelYunBLL.ResultLogs();
                        ResultLogsServiceClient rs = new ResultLogsServiceClient();
                        //ModelResultLogs = new ResultLogs();
                        //ModelResultLogs = rs.GetModelOne(TaskID);
                        TaskProcessedDataServiceClient taskProcessedDataService=new TaskProcessedDataServiceClient();
                        List<TaskProcessedDataSet> taskProcessedDataSetList=new List<TaskProcessedDataSet>();
                        taskProcessedDataSetList.AddRange(taskProcessedDataService.GetDataSetByTaskGuid(TaskID));
                        foreach(TaskProcessedDataSet oneDataSet in taskProcessedDataSetList){
                            List<TaskProcessedDataRecord> dataSetRecords=new List<TaskProcessedDataRecord>();
                            dataSetRecords.AddRange(taskProcessedDataService.QueryDataSet(oneDataSet.guid,1,0));
                            foreach(TaskProcessedDataRecord one in dataSetRecords){
                                string temp = "sin.push([" + SerializationUtil.ToArray(one.record)[0] + "," + one.seq + "]);";
                                sb.Append(temp);
                            }
                        }
                        //   StringBuilder strForScript
                        //   string temp = "sin.push([" + ss[Col1year] + "," + ss[Col2SEQ] + "]);";
                        //   strForScript.Append(temp);
                        //
                        litForScript.Value = sb.ToString();
                    }
        }
开发者ID:KangChaofan,项目名称:OOC,代码行数:39,代码来源:statistics.aspx.cs

示例2: CollectPackages

        public static Package[] CollectPackages()
        {
            List<int> viewIds = new List<int>(), editIds = new List<int>(), ownIds = new List<int>();

            // [Hack]: Empty string returns all files.
            foreach (var info in SearchFileInfos(""))
            {
                var id = info.Id;

                if (IsOwnerOf(id))
                {
                    ownIds.Add(id);
                }
                else if (HasEditRights(id))
                {
                    editIds.Add(id);
                }
                else if (HasViewRights(id))
                {
                    viewIds.Add(id);
                }
                else
                {
                    throw new Exception("Leak in SearchPackages. A FileInfo to which the current user has no rights, has been retrieved.");
                }
            }

            var viewable = new Package() { Description = "Contains all viewable files.", Id = -1, Name = "Viewable Files", OwnerEmail = _sessionUser.Email, FileIds = viewIds.ToArray<int>() };
            var editable = new Package() { Description = "Contains all editable files.", Id = -2, Name = "Editable Files", OwnerEmail = _sessionUser.Email, FileIds = editIds.ToArray<int>() };
            var owned    = new Package() { Description = "Contains all owned files.",    Id = -3, Name = "Owned Files",    OwnerEmail = _sessionUser.Email, FileIds = ownIds.ToArray<int>()  };

            // [Hack]: Empty string returns all packages.
            var packs = new List<Package>(SearchPackages(""));

            packs.AddRange(new Package[] {viewable,editable,owned});

            return packs.ToArray<Package>();
        }
开发者ID:Crelde,项目名称:ClientBNDN,代码行数:38,代码来源:Controller.cs

示例3: IsOwnerOf

 /// <summary>Checks whether the current user is the owner of the item with the specified Id.</summary>
 /// <param name="itemId">The Id of the item in question.</param>
 /// <returns>True if the user owns the item, false if not.</returns>
 public static bool IsOwnerOf(int itemId)
 {
     List<Item> items = new List<Item>(GetOwnedFileInfosByEmail(_sessionUser.Email));
     items.AddRange(GetOwnedPackagesByEmail(_sessionUser.Email));
     return items.Any<Item>(item => item.Id == itemId);
 }
开发者ID:Crelde,项目名称:ClientBNDN,代码行数:9,代码来源:Controller.cs


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