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


C# IEnumerable.ToList方法代码示例

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


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

示例1: GenerateTestFixture

 public string GenerateTestFixture(IEnumerable<Test> tests, string fileName)
 {
     var generator = new CodeGenerator(TemplateEnum.MbUnitTestFixture, TestText, MethodText, PropertyText, TypeText,
                                       AssertText);
     var code = generator.GenerateTestFixture(tests.ToList(), fileName);
     return code;
 }
开发者ID:lynchjames,项目名称:bdUnit,代码行数:7,代码来源:MbUnitCodeGenerator.cs

示例2: Manage

        public ActionResult Manage(IEnumerable<RoleRights> changes)
        {
            MasterService srv = new MasterService(_Session.MasterTbl);
            bool CanCommit = true; string err = "";
            //Make sure If there's any DELETE - it is NOT being referred
            CanCommit = !MasterController.isDeletedBeingReferred(changes, true, ref err);//.Cast<Master>().ToList()
            //Check duplicates among New records only
            if (CanCommit && changes != null && changes.ToList<Master>().Exists(r => r.IsAdded))
                CanCommit = !MasterController.hasDuplicateInNewEntries(changes, ref err);

            #region All OK so go ahead
            if (CanCommit)//Commit
            {
                new SecurityService().BulkAddEditDel(changes.ToList<RoleRights>());//Performs Add, Edit & Delete by chacking each item
                base.operationSuccess = true; // Set operation sucess
                //Log Activity
                new ActivityLogService(ActivityLogService.Activity.RoleManage).Add(new CPM.DAL.ActivityHistory());
            }
            else // worst case or hack
                return Json(err, JsonRequestBehavior.AllowGet);

            #endregion

            return Json(string.Empty, JsonRequestBehavior.AllowGet);
        }
开发者ID:HSG-PSG-1,项目名称:CPM_Source,代码行数:25,代码来源:RoleController.cs

示例3: RequiresRenumbering

 public static bool RequiresRenumbering(IEnumerable<int> numbers)
 {
     List<int> SortedList = Renumber(numbers.ToList());
     if (AreEqual(numbers.ToList(), SortedList))
         return false;
     return true;
 }
开发者ID:modulexcite,项目名称:CR_SortFormatTokens,代码行数:7,代码来源:SequenceRenumberer.cs

示例4: EnrichirAvecSoldeArchivable

        // Calcul des soldes opérations pour une série d'opérations et une série de comte banque
        public void EnrichirAvecSoldeArchivable(IEnumerable<Budget> budgets)
        {
            // Reset solde opérations
            budgets.ToList().ForEach(c => c.SoldeOperationArchivables = 0.0M);
            budgets.ToList().ForEach(c => c.SoldeFinancementArchivables = 0.0M);
            budgets.ToList().ForEach(c => c.SoldeProvisionArchivables = 0.0M);
            budgets.ToList().ForEach(c => c.SoldeArchivable = 0.0M);

            // Contrats
            var s1 = new BudgetContratEnrichisseur(uow, groupeId);
            s1.EnrichirAvecNbContrats(budgets);

            // Inputs: opérations
            FacadeRepo facade = new FacadeRepo(uow, groupeId);
            InputSoldeBudgets inputs = facade.InputSoldeArchivableBudgets(dateLimiteArchivage);

            // Enrichissement solde des opérations
            var enrichisseur = new BudgetSoldeOperationArchivableEnrichisseur();
            enrichisseur.Executer(inputs, budgets);

            // Enrichissement solde archive
            foreach (var budget in budgets)
            {
                budget.EnrichirAvecSoldeArchivable();
            }
        }
开发者ID:paulkornikov,项目名称:Pragonas,代码行数:27,代码来源:BudgetSoldeArchivableServices.cs

示例5: GetFormattedTicket

 public string[] GetFormattedTicket(Ticket ticket, IEnumerable<Order> lines, PrinterTemplate printerTemplate)
 {
     var orders = printerTemplate.MergeLines ? MergeLines(lines.ToList()) : lines.ToList();
     ticket.Orders.Clear();
     orders.ToList().ForEach(ticket.Orders.Add);
     var content = _ticketValueChanger.GetValue(printerTemplate, ticket);
     content = UpdateExpressions(content);
     return content.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).ToArray();
 }
开发者ID:hperassi,项目名称:SambaPOS-3,代码行数:9,代码来源:TicketFormatter.cs

示例6: Filter

        private static IList<SignatureHelpItem> Filter(IEnumerable<SignatureHelpItem> items, IEnumerable<string> parameterNames)
        {
            if (parameterNames == null)
            {
                return items.ToList();
            }

            var filteredList = items.Where(i => Include(i, parameterNames)).ToList();
            return filteredList.Count == 0 ? items.ToList() : filteredList;
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:10,代码来源:AbstractSignatureHelpProvider.cs

示例7: AddEntities

        public void AddEntities(string variable, IEnumerable<IPersistIfcEntity> entities)
        {
            FixVariableName(ref variable);
            if (IsDefined(variable))
            {
                _data[variable] = _data[variable].Union(entities.ToList());
            }
            else
                _data.Add(variable, entities.ToList());

            _lastVariable = variable;
        }
开发者ID:bnaand,项目名称:xBim-Toolkit,代码行数:12,代码来源:XbimVariables.cs

示例8: MagicCard

        public MagicCard(Bitmap cameraBitmap, IEnumerable<IntPoint> corners)
        {
            this.CameraBitmap = cameraBitmap;

            QuadrilateralTransformation transformFilter = new QuadrilateralTransformation(corners.ToList(), 211, 298);
            this.CardBitmap = transformFilter.Apply(cameraBitmap);

            QuadrilateralTransformation cardArtFilter = new QuadrilateralTransformation(artCorners.ToList(), 183, 133);
            this.CardArtBitmap = cardArtFilter.Apply(this.CardBitmap);

            this.Corners = corners.ToList();
        }
开发者ID:aaronm67,项目名称:Magic-Vision,代码行数:12,代码来源:MagicCard.cs

示例9: EjectStorageDomainSpectraS3Request

        public EjectStorageDomainSpectraS3Request(IEnumerable<Ds3Object> objects, string storageDomainId)
        {
            this.StorageDomainId = storageDomainId;
            this.Objects = objects.ToList();
            this.QueryParams.Add("operation", "eject");

            this.QueryParams.Add("storage_domain_id", storageDomainId);

            if (!objects.ToList().TrueForAll(obj => obj.Size.HasValue))
            {
                throw new Ds3RequestException(Resources.ObjectsMissingSizeException);
            }
        }
开发者ID:rpmoore,项目名称:ds3_net_sdk,代码行数:13,代码来源:EjectStorageDomainSpectraS3Request.cs

示例10: SendToConcreteSubscribers

 public JeapieResponse SendToConcreteSubscribers(IEnumerable<string> emails, string message, string title ="",
                                                 JeapieMessagePriority priority = DefaultPriority)
 {
     var  validationCollection = ParameterValidator.ValidateArguments(message, emails.ToList());
     var  result = HttpClient.Request(providerKey,
                                         message,
                                         title,
                                         emails.ToList(),
                                         JeapieRequestType.SendToConcreteSubscribers,
                                         priority);
     result.ValidationResults.AddRange(validationCollection);
     return result;
 }
开发者ID:VladislavFurdak,项目名称:Jeapie-api-csharp-wrapper,代码行数:13,代码来源:JeapieService.cs

示例11: ValidationResult

 /// <summary>
 /// Initializes a new instance of the <see cref="ValidationResult"/> class.
 /// </summary>
 /// <param name="elementResults">The element results.</param>
 /// <param name="fieldResults">The field results.</param>
 /// <param name="childResults">The child results.</param>
 public ValidationResult(IEnumerable<ValidationElementResult> elementResults, IEnumerable<IValidationFieldResult> fieldResults, IEnumerable<ValidationResult> childResults)
 {
     ElementDirectResults = elementResults.ToList();
     ElementDirectFailures = elementResults.Where(result => result.Result.CountsAsFailure).ToList();
     ElementResults = childResults.SelectMany(res => res.ElementResults).Union(elementResults.ToList()).ToList();
     ElementFailures = ElementResults.Where(result => result.Result.CountsAsFailure);
     Results = childResults.SelectMany(res => res.Failures).Union(fieldResults.ToList()).ToList();
     Failures = Results.Where(result => result.CountsAsFailure);
     ElementResultsCount = ElementResults.AsBindable().Count();
     ElementFailureCount = ElementFailures.AsBindable().Count();
     ResultsCount = Results.AsBindable().Count();
     FailureCount = Failures.AsBindable().Count();
     IsSuccessful = FailureCount.Project(count => count == 0);
 }
开发者ID:PaulStovell,项目名称:bindable,代码行数:20,代码来源:ValidationResult.cs

示例12: PrepareToExecute

        public Action PrepareToExecute(IEnumerable<CacheElement> toInsert)
        {
            var insertList = toInsert.ToList();

            return () => 
            {
                foreach (var v in insertList) 
                {
                    try 
                    {
                        this.Checked(raw.sqlite3_bind_text(insertOp, 1, v.Key));

                        if (String.IsNullOrWhiteSpace(v.TypeName)) 
                        {
                            this.Checked(raw.sqlite3_bind_null(insertOp, 2));
                        } 
                        else 
                        {
                            this.Checked(raw.sqlite3_bind_text(insertOp, 2, v.TypeName));
                        }

                        this.Checked(raw.sqlite3_bind_blob(insertOp, 3, v.Value));
                        this.Checked(raw.sqlite3_bind_int64(insertOp, 4, v.Expiration.Ticks));
                        this.Checked(raw.sqlite3_bind_int64(insertOp, 5, v.CreatedAt.Ticks));

                        this.Checked(raw.sqlite3_step(insertOp));
                    } 
                    finally 
                    {
                        this.Checked(raw.sqlite3_reset(insertOp));
                    }
                }
            };
        }
开发者ID:jean-marc87,项目名称:Akavache,代码行数:34,代码来源:Operations.cs

示例13: ComposeEmailViewModel

        public ComposeEmailViewModel(IEnumerable<Video> videos)
        {

            Videos = videos.ToList();
            Message = new Message();

        }
开发者ID:jjabney,项目名称:Lucid.Web.Portal,代码行数:7,代码来源:ComposeEmailViewModel.cs

示例14: Write

        public void Write(IEnumerable<CommandRegistry> commands)
        {
            var list = commands.ToList();

            Writer.WriteLine("Commands found: {0}", list.Count);

            foreach (var cmd in list)
            {
                Blank();

                Writer.Write("Command: ");
                WriteCommandName(cmd.Command, cmd.Parser);

                var options = cmd.Parser.Options.ToList();

                if (options.Count > 0)
                {
                    Writer.WriteLine("Available options:");
                    foreach (var option in cmd.Parser.Options)
                        Writer.WriteLine("> {0} [{1}]", option.Name, option.Member.Type.GetRealClassName());
                }
                else
                {
                    Writer.WriteLine("No available options.");
                }
            }
        }
开发者ID:juanplopes,项目名称:simple,代码行数:27,代码来源:HelpTextWriter.cs

示例15: ContentTypeDefinition

 public ContentTypeDefinition(string name, string displayName, IEnumerable<ContentTypePartDefinition> parts, JObject settings)
 {
     Name = name;
     DisplayName = displayName;
     Parts = parts.ToList();
     Settings = settings;
 }
开发者ID:adwardliu,项目名称:Orchard2,代码行数:7,代码来源:ContentTypeDefinition.cs


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