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


C# List.Select方法代码示例

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


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

示例1: AddCenters

 public void AddCenters()
 {
     havecentre_list = havecentre_list.OrderBy(o => o.Name).ToList();
     xml_centers.DataSource = havecentre_list.Select(o => o.Name).ToList();
     status_text_label.Text = "Klar til brug";
     load_img.Hide();
 }
开发者ID:Ckrag,项目名称:Havecentre,代码行数:7,代码来源:Havecentre.cs

示例2: editFootnoteMaps

        public ActionResult editFootnoteMaps(Int16 fiscalYear, Int16? indicatorID)
        {
            List<Indicator_Footnote_Maps> footnoteMaps = new List<Indicator_Footnote_Maps>();
            foreach (var footnote in db.Indicator_Footnote_Maps.Where(x => x.Fiscal_Year == fiscalYear).OrderBy(e => e.Map_ID).ToList())
            {
                footnoteMaps.Add(footnote);
            }

            var allIndicator = new List<Indicators>();
            if (indicatorID.HasValue)
            {
                allIndicator = db.Indicators.Where(x => x.Indicator_ID == indicatorID).OrderBy(x => x.Indicator_ID).ToList();
            }
            else
            {
                allIndicator = db.Indicators.OrderBy(x => x.Indicator_ID).ToList();
            }

            var viewModel = allIndicator.Select(x => new Indicator_Footnote_MapsViewModel
            {
                Indicator_ID = x.Indicator_ID,
                Indicator = x.Indicator,
                Fiscal_Year = fiscalYear,
            }).ToList();

            viewModel.FirstOrDefault().allFootnotes = new List<string>();

            viewModel.FirstOrDefault().allFootnotes.AddRange(db.Footnotes.Select(x => x.Footnote_Symbol + ", " + x.Footnote).ToList());

            foreach (var Indicator in viewModel)
            {
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 0)
                {
                    Indicator.Footnote_ID_1 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).First().Footnote_ID;
                    Indicator.Map_ID_1 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).First().Map_ID;
                    Indicator.Footnote_Symbol_1 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_1).Footnote_Symbol;
                }
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 1)
                {
                    Indicator.Footnote_ID_2 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(1).First().Footnote_ID;
                    Indicator.Map_ID_2 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(1).First().Map_ID;
                    Indicator.Footnote_Symbol_2 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_2).Footnote_Symbol;
                }
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 2)
                {
                    Indicator.Footnote_ID_3 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(2).First().Footnote_ID;
                    Indicator.Map_ID_3 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(2).First().Map_ID;
                    Indicator.Footnote_Symbol_3 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_3).Footnote_Symbol;
                }
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 3)
                {
                    Indicator.Footnote_ID_4 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(3).First().Footnote_ID;
                    Indicator.Map_ID_4 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(3).First().Map_ID;
                    Indicator.Footnote_Symbol_4 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_4).Footnote_Symbol;
                }
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 4)
                {
                    Indicator.Footnote_ID_5 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(4).First().Footnote_ID;
                    Indicator.Map_ID_5 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(4).First().Map_ID;
                    Indicator.Footnote_Symbol_5 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_5).Footnote_Symbol;
                }
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 5)
                {
                    Indicator.Footnote_ID_6 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(5).First().Footnote_ID;
                    Indicator.Map_ID_6 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(5).First().Map_ID;
                    Indicator.Footnote_Symbol_6 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_6).Footnote_Symbol;
                }
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 6)
                {
                    Indicator.Footnote_ID_7 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(6).First().Footnote_ID;
                    Indicator.Map_ID_7 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(6).First().Map_ID;
                    Indicator.Footnote_Symbol_7 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_7).Footnote_Symbol;
                }
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 7)
                {
                    Indicator.Footnote_ID_8 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(7).First().Footnote_ID;
                    Indicator.Map_ID_8 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(7).First().Map_ID;
                    Indicator.Footnote_Symbol_8 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_8).Footnote_Symbol;
                }
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 8)
                {
                    Indicator.Footnote_ID_9 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(8).First().Footnote_ID;
                    Indicator.Map_ID_9 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(8).First().Map_ID;
                    Indicator.Footnote_Symbol_9 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_9).Footnote_Symbol;
                }
                if (footnoteMaps.Count(e => e.Indicator_ID == Indicator.Indicator_ID) > 9)
                {
                    Indicator.Footnote_ID_10 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(9).First().Footnote_ID;
                    Indicator.Map_ID_10 = footnoteMaps.Where(e => e.Indicator_ID == Indicator.Indicator_ID).OrderBy(e => e.Map_ID).Skip(9).First().Map_ID;
                    Indicator.Footnote_Symbol_10 = db.Footnotes.FirstOrDefault(e => e.Footnote_ID == Indicator.Footnote_ID_10).Footnote_Symbol;
                }
            }

            return View(viewModel);
        }
开发者ID:vadimPoliansky,项目名称:TestPR_Dev,代码行数:95,代码来源:IndicatorController.cs

示例3: fillEmployeeList

        private void fillEmployeeList()
        {
            List<string[]> list = new List<string[]>();
            list = DataAccess.requestUserList();

            lb_employeeList.DataSource = list.Select(x => new {ID = x[0], FirstName = x[1], LastName = x[2] }).ToList();
            lb_employeeList.DisplayMember = "FirstName";
            lb_employeeList.ValueMember = "ID";
        }
开发者ID:vits-team,项目名称:vits,代码行数:9,代码来源:Manager.cs

示例4: InputData

        private void InputData(List<ReportExcursion> excursions, PdfPTable table)
        {
            for (int i = 0; i < excursions.Count; i++)
            {
                table.AddCell(this.CreateCell(new Phrase(excursions[i].ExcName)));
                table.AddCell(this.CreateCell(new Phrase(excursions[i].Destination +
                    " (" + excursions[i].Distance + "km)")));
                table.AddCell(this.CreateCell(new Phrase(excursions[i].ClientCount.ToString())));
                table.AddCell(this.CreateCell(new Phrase((excursions[i].Experience * 10).ToString() + "%")));

                if (excursions[i].EndDate != null && excursions[i].StartDate != null)
                {
                    var endDate = excursions[i].EndDate ?? DateTime.Now;
                    var startDate = excursions[i].StartDate ?? DateTime.Now;
                    var duration = endDate.Subtract(startDate);
                    table.AddCell(this.CreateCell(new Phrase(duration.Days.ToString())));
                }
                else
                {
                    table.AddCell(this.CreateCell(new Phrase("Undifined(is not a function)")));
                }
            }

            var allClients = excursions.Select(x => x.ClientCount).Sum();

            table.AddCell(this.CreateCell(new Phrase("Total number of clients:"), false, 4));
            table.AddCell(this.CreateCell(new Phrase(allClients.ToString())));
        }
开发者ID:DataBaseTeamSilver,项目名称:Travel-Agency,代码行数:28,代码来源:PdfGenerator.cs

示例5: Main


//.........这里部分代码省略.........
                //csv.WriteField("AV");
                //csv.WriteField("Avianca");
                //csv.WriteField("http://www.avianca.com");
                //csv.WriteField("America/Bogota");
                //csv.WriteField("ES");
                //csv.WriteField("");
                //csv.WriteField("");
                //csv.WriteField("");
                //csv.NextRecord();
            }

            Console.WriteLine("Creating GTFS File routes.txt ...");

            using (var gtfsroutes = new StreamWriter(@"gtfs\\routes.txt"))
            {
                // Route record

                var csvroutes = new CsvWriter(gtfsroutes);
                csvroutes.Configuration.Delimiter = ",";
                csvroutes.Configuration.Encoding = Encoding.UTF8;
                csvroutes.Configuration.TrimFields = true;
                // header
                csvroutes.WriteField("route_id");
                csvroutes.WriteField("agency_id");
                csvroutes.WriteField("route_short_name");
                csvroutes.WriteField("route_long_name");
                csvroutes.WriteField("route_desc");
                csvroutes.WriteField("route_type");
                csvroutes.WriteField("route_url");
                csvroutes.WriteField("route_color");
                csvroutes.WriteField("route_text_color");
                csvroutes.NextRecord();

                var routes = CIFLights.Select(m => new { m.FromIATA, m.ToIATA, m.FlightAirline }).Distinct().ToList();

                for (int i = 0; i < routes.Count; i++) // Loop through List with for)
                {
                    var FromAirportInfo = IATAAirports.Find(q => q.stop_id == routes[i].FromIATA);
                    var ToAirportInfo = IATAAirports.Find(q => q.stop_id == routes[i].ToIATA);

                    csvroutes.WriteField(routes[i].FromIATA + routes[i].ToIATA + "NK");
                    csvroutes.WriteField("NK");
                    csvroutes.WriteField(routes[i].FromIATA + routes[i].ToIATA);
                    csvroutes.WriteField(FromAirportInfo.stop_name + " - " + ToAirportInfo.stop_name);
                    csvroutes.WriteField(""); // routes[i].FlightAircraft + ";" + CIFLights[i].FlightAirline + ";" + CIFLights[i].FlightOperator + ";" + CIFLights[i].FlightCodeShare
                    csvroutes.WriteField(1101);
                    csvroutes.WriteField("");
                    csvroutes.WriteField("");
                    csvroutes.WriteField("");
                    csvroutes.NextRecord();
                }
            }

            List<string> agencyairportsiata =
             CIFLights.SelectMany(m => new string[] { m.FromIATA, m.ToIATA })
                     .Distinct()
                     .ToList();

            using (var gtfsstops = new StreamWriter(@"gtfs\\stops.txt"))
            {
                // Route record
                var csvstops = new CsvWriter(gtfsstops);
                csvstops.Configuration.Delimiter = ",";
                csvstops.Configuration.Encoding = Encoding.UTF8;
                csvstops.Configuration.TrimFields = true;
                // header
开发者ID:mvanlaar,项目名称:SpiritTimeTableParser,代码行数:67,代码来源:Program.cs

示例6: BindFieldGridList

        void BindFieldGridList()
        {
            dgFields.DataSource = null;
            dgFields.Columns.Clear();

            var result = new List<FieldGridViewModel>();

            _fieldsGridDataSource = GetFieldsList(_gridDataSource.Where(c => c.isChecked == true).Select(c => c.ID).ToArray());

            dgFields.DataSource = _fieldsGridDataSource.Select(c => new
            {
                Field = c.Field.Field,
                Kriging = c.Field.Interpolation.Name,
                Max = c.Field.Max,
                Min = c.Field.Min,
                Mean = c.Field.Mean,
                Fertilizer = c.Field.ProductValue
            }).ToList();


            DataGridViewCheckBoxColumn myCheckedColumn = new DataGridViewCheckBoxColumn()
            {
                Name = "",
                FalseValue = false,
                TrueValue = true,
                Visible = true,
            };

            dgFields.Columns.Insert(0, myCheckedColumn);

            DataGridViewTextBoxColumn textBoxColumn = new DataGridViewTextBoxColumn()
            {
                Name = "Order",
                Visible = true,
            };

            dgFields.Columns.Add(textBoxColumn);

            foreach (DataGridViewRow row in dgFields.Rows)
            {
                row.Cells[row.Cells.Count - 1].Value = 1;
            }

            AddCheckboxGridHeader();
        }
开发者ID:shoaib-ijaz,项目名称:geosoft,代码行数:45,代码来源:ManageCustomerInterpolationForm.cs

示例7: BindGridView

        void BindGridView()
        {
            try
            {
                dgInterpolationsList.DataSource = null;
                dgInterpolationsList.Columns.Clear();

                _gridDataSource = GetInterpolationsList();

                dgInterpolationsList.DataSource = _gridDataSource.Select(c => new
                {
                    Name = c.Name,
                    Customer = c.Customer,
                    Farm = c.Farm,
                    Year = c.Date != null ? c.Date.Value.Year.ToString() : ""
                }).ToList();

                dgInterpolationsList.EnableHeadersVisualStyles = false;

                if (dgInterpolationsList.Rows.Count > 0)
                {
                    dgInterpolationsList.Rows[0].Cells[0].Selected = false;
                }

                DataGridViewImageColumn openCol = new DataGridViewImageColumn();
                openCol.Image = Properties.Resources.document_empty_16x16;
                openCol.Name = "Open";
                openCol.Width = 50;
                dgInterpolationsList.Columns.Add(openCol);

                DataGridViewCheckBoxColumn myCheckedColumn = new DataGridViewCheckBoxColumn()
                {
                    Name = "",
                    FalseValue = false,
                    TrueValue = true,
                    Visible = true,
                    Width = 50
                };

                dgInterpolationsList.Columns.Insert(0, myCheckedColumn);
            }
            catch (Exception)
            {
                throw;
            }
        }
开发者ID:shoaib-ijaz,项目名称:geosoft,代码行数:46,代码来源:ManageCustomerInterpolationForm.cs


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