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


C# IList.ToList方法代码示例

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


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

示例1: AnteprimaReportRipartoPersona

        public AnteprimaReportRipartoPersona(IList<ReportRipartizioneBilancioDTO> dataSource, CondominioDTO condominio, EsercizioDTO esercizio, IList<PersonaContattoDTO> personeRiparto, Dictionary<int, IList<IList<UnitaImmobiliareListaDTO>>> listaUnitaImmobiliare, BilancioConsuntivoReportParameters parameters, ImpostazioneReportDTO impostazioneReportDTO, string reportKey, string note)
        {
            InitializeComponent();
            _dataSource = dataSource;
            _condominio = condominio;
            _esercizio = esercizio;
            _parameters = parameters;
            _personeRiparto = personeRiparto;
            _impostazioneReportDTO = impostazioneReportDTO;
            _note = note;

            Text = $"Riparto {_impostazioneReportDTO.Descrizione}";

            try
            {
                _importoTotale = getBilancioService().GetTotale(dataSource.ToList());
                _importoPreventivo = getBilancioService().GetTotalePreventivo(dataSource.ToList());

                IReportProvider document = new RipartoAnnualePersona(dataSource, _condominio, _esercizio, personeRiparto, listaUnitaImmobiliare, _parameters, _impostazioneReportDTO, reportKey, _note);
                SetDataSource(document.GetReport(), _impostazioneReportDTO);
            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Errore nell'apertura della maschera di anteprima per riparto - {0} - condominio:{1} - azienda:{2}", ex, Utility.GetMethodDescription(), _condominio?.ID.ToString(CultureInfo.InvariantCulture) ?? "<NULL>", Login.Instance.CurrentLogin().Azienda);
                throw;
            }
        }
开发者ID:gipasoft,项目名称:Sfera,代码行数:27,代码来源:AnteprimaReportRipartoPersona.cs

示例2: AnteprimaReportRiparto

        public AnteprimaReportRiparto(IList<ReportRipartizioneBilancioDTO> dataSource, CondominioDTO condominio, EsercizioDTO esercizio, BilancioConsuntivoReportParameters parameters, ImpostazioneReportDTO impostazioneReportDTO)
        {
            InitializeComponent();
            _dataSource = dataSource;
            _condominio = condominio;
            _esercizio = esercizio;
            _parameters = parameters;
            _impostazioneReportDTO = impostazioneReportDTO;

            Text = $"Riparto {_impostazioneReportDTO.Descrizione}";

            try
            {
                _importoTotale = getBilancioService().GetTotale(dataSource.ToList());
                _importoPreventivo = getBilancioService().GetTotalePreventivo(dataSource.ToList());

                IReportProvider document;
                if(_impostazioneReportDTO.MultiPageOrdered)
                    document = new RipartoMerge(dataSource, _condominio, _esercizio, _parameters, _impostazioneReportDTO, _importoTotale, _importoPreventivo);
                else
                    document = new RipartoSubreport(dataSource, _condominio, _esercizio, _parameters, _impostazioneReportDTO, _importoTotale, _importoPreventivo);
                
                SetDataSource(document.GetReport(), _impostazioneReportDTO);
            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Errore nell'apertura della maschera di anteprima per riparto - {0} - condominio:{1} - azienda:{2}", ex, Utility.GetMethodDescription(), _condominio?.ID.ToString(CultureInfo.InvariantCulture) ?? "<NULL>", Login.Instance.CurrentLogin().Azienda);
                Close();
            }
        }
开发者ID:gipasoft,项目名称:Sfera,代码行数:30,代码来源:AnteprimaReportRiparto.cs

示例3: Filter

        private static IList<SignatureHelpItem> Filter(IList<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:Rickinio,项目名称:roslyn,代码行数:10,代码来源:AbstractSignatureHelpProvider.cs

示例4: CalculateTotalScore

        /// <summary>
        /// Accepts a collection of frames and returns the total score
        /// </summary>
        /// <param name="scores"></param>
        /// <returns></returns>
        public int CalculateTotalScore(IList<IFrame> scores)
        {

            ValidateFrames(scores.ToList());

            var totalScore = 0;

            scores.ToList().ForEach(sc => totalScore += sc.Score);

            return totalScore;
        }
开发者ID:pwhyton,项目名称:CTM,代码行数:16,代码来源:BowlingScoreCalculator.cs

示例5: Run

        public long Run(IList<int> numbers)
        {
            long total = 0;
            int amount = this.maximum;
            int k;

            var rest = numbers.ToList();

            for (k = 0; k < numbers.Count - 1; k++)
            {
                int move = this.Decide(amount, rest);
                total += (long)move * numbers[k];
                amount -= move;
                amount += this.reload;

                if (amount > this.maximum)
                    amount = this.maximum;

                rest = rest.Skip(1).ToList();
            }

            total += (long)amount * numbers[k];

            return total;
        }
开发者ID:ajlopez,项目名称:TddRocks,代码行数:25,代码来源:Planner.cs

示例6: GetToolbarItem

        /// <summary>
        /// Get the ToolbarItem reference by it's name.
        /// </summary>
        /// <returns>The ToolbarItem object that references the UIBarButtonInfo.</returns>
        /// <param name="items">The list of Items.</param>
        /// <param name="title">The button title.</param>
        ToolbarItem GetToolbarItem(IList<ToolbarItem> items, string title)
        {
            if (string.IsNullOrEmpty(title) || items == null)
                return null;

            return items.ToList().FirstOrDefault(itemData => title.Equals(itemData.Text));
        }
开发者ID:Caeno,项目名称:Lib-XamarinForms-Toolkit,代码行数:13,代码来源:BasePageRenderer.cs

示例7: OnCreate

        /// <summary>
        /// When the activity is created
        /// </summary>
        /// <param name="bundle">Any data passed to the activity</param>
        protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

            //Allow this inbox to be retrieved by other classes
            //This allows the inbox to be updated when a new message arrives
			MainActivity.references.Put ("Inbox", this);

			SetContentView(Resource.Layout.messaging_inbox);

			taskListView = (ListView)FindViewById (Resource.Id.listView);
            
            //Get all the users that this user has had a conversation with
            users = MessageRepository.GetMessagedUsers().ToArray<string>();
            tasks = new List<Message>();

            //Get the most recent message from each user to display in the "main" messaging list
            foreach (string s in users)
            {
                tasks.Add(MessageRepository.GetMostRecentMessageFrom(s));
            }
            
            // create our adapter
            taskList = new MsgListAdapterInbox(this, users.ToList());

			//Hook up our adapter to our ListView
			taskListView.Adapter = taskList;
		}
开发者ID:Byuunion,项目名称:Senior_project,代码行数:32,代码来源:ViewInbox.cs

示例8: CreatePackage

        public Validation CreatePackage(ref Package package, IList<long> items)
        {
            var val = _validator.ValidateNewPackage(package, null);

            var trans = _factory.BuildTransaction("InsertPackage");
            try
            {
                //validate
                if (val.IsValid)
                {
                    _repo.Insert(ref package, ref trans);
                    long packageId = package.Id;
                    items.ToList().ForEach(i => _itemRepo.SetItemPackage(i, packageId, ref trans));
                }
                trans.Commit();
            }
            catch (Exception e)
            {
                trans.Rollback();
                val.AddError(string.Format("Unable to create package: {0}", e.Message));
            }
            finally
            {
                trans.Dispose();
            }
            return val;
        }
开发者ID:danappleyard,项目名称:auction-csharp,代码行数:27,代码来源:PackageService.cs

示例9: OptionsForSyncUp

 public static SyncOptions OptionsForSyncUp(IList<string> fieldList, MergeModeOptions mergeMode)
 {
     var nativeMergeMode = JsonConvert.SerializeObject(mergeMode);
     var nativeSyncOptions = SDK.SmartSync.Model.SyncOptions.OptionsForSyncUp(fieldList.ToList(), JsonConvert.DeserializeObject<SDK.SmartSync.Model.SyncState.MergeModeOptions>(nativeMergeMode));
     var syncOptions = JsonConvert.SerializeObject(nativeSyncOptions);
     return JsonConvert.DeserializeObject<SyncOptions>(syncOptions);
 }
开发者ID:joaoamaral,项目名称:SalesforceMobileSDK-CordovaPlugin,代码行数:7,代码来源:SyncOptions.cs

示例10: ListController

 /// <summary>
 /// Initializes a new instance of the <see cref="ListController"/> class.
 /// </summary>
 /// <param name="list">
 /// The list. 
 /// </param>
 /// <param name="dialogTitle">
 /// The dialog title. 
 /// </param>
 public ListController(IList<string> list, string dialogTitle)
 {
     // Clone the list. That way, if the close button is used
     // the original list won't be affected.
     this.List = new BindingList<string>(list.ToList());
     this.Title = dialogTitle;
 }
开发者ID:nicolaspierre1990,项目名称:tvsorter,代码行数:16,代码来源:ListController.cs

示例11: Execute

        public void Execute(IList<IAggregateCommand> commands, int expectedVersion)
        {
            if (commands.Count == 0)
            {
                return;
            }

            // readModelBuilderBus will publish events to a bus that will build read models and then pass events off to
            // the real eventBus
            var readModelBuilderBus = new ReadModelBuildingEventBus(this.registration.ImmediateReadModels(this.scope), this.eventBus);

            // holds the events that were raised from the aggregate and will push them to the read model building bus
            var aggregateEvents = new UnitOfWorkEventBus(readModelBuilderBus);

            // subscribe to the changes in the aggregate and publish them to aggregateEvents
            var aggregateRepo = new AggregateRepository(registration.New, this.scope.GetRegisteredObject<IEventStore>(), scope.GetRegisteredObject<ISnapshotRepository>());
            var subscription = aggregateRepo.Changes.Subscribe(aggregateEvents.Publish);
            this.scope.Add(new UnitOfWorkDisposable(subscription));

            // add them in this order so that aggregateEvents >> readModelBuilderBus >> read model builder >> eventBus
            this.scope.Add(aggregateEvents);
            this.scope.Add(readModelBuilderBus);

            var cmd = new CommandExecutor(aggregateRepo);
            cmd.Execute(commands.ToList(), expectedVersion);

            // enqueue pending commands
            this.EnqueueCommands(this.scope.GetRegisteredObject<IPendingCommandRepository>(), commands);

            // enqueue read models to be built - for non-immediate read models
            var typeName = AggregateRootBase.GetAggregateTypeDescriptor(registration.AggregateType);
            this.EnqueueReadModels(this.scope.GetRegisteredObject<IReadModelQueueProducer>(), typeName, aggregateEvents.GetEvents().Select(x => x.Event).OfType<IAggregateEvent>().ToList());
        }
开发者ID:sgmunn,项目名称:Mobile.CQRS,代码行数:33,代码来源:DomainCommandExecutor.cs

示例12: setupElems

        private void setupElems(IList<Profile.ElementComponent> elements)
        {
            if (elements == null) throw Error.ArgumentNull("elements");

            _elements = elements.ToList();      // make a *shallow* copy of the list of elements
            OrdinalPosition = null;
        }
开发者ID:wdebeau1,项目名称:fhir-net-api,代码行数:7,代码来源:ElementNavigator.cs

示例13: UpdateMarkers

        public void UpdateMarkers(IList<MediaMarker> markers, bool forceRefresh)
        {
            var markersHash = markers.ToDictionary(i => i.Id, i => i);

            List<MediaMarker> newMarkers;
            List<MediaMarker> removedMarkers;

            if (forceRefresh)
            {
                newMarkers = markers.ToList();
                removedMarkers = _previousMarkers.Values.ToList();
            }
            else
            {
                newMarkers = markers.Where(i => !_previousMarkers.ContainsKey(i.Id)).ToList();
                removedMarkers = _previousMarkers.Values.Where(i => !markersHash.ContainsKey(i.Id)).ToList();
            }

            if (removedMarkers.Any() && MarkersRemoved != null)
            {
                MarkersRemoved(removedMarkers);
            }

            if (newMarkers.Any() && NewMarkers != null)
            {
                NewMarkers(newMarkers);
            }

            _previousMarkers = markersHash;
        }
开发者ID:bondarenkod,项目名称:pf-arm-deploy-error,代码行数:30,代码来源:CaptionMarkerFactory.cs

示例14: GetButtonInfo

		private ToolbarItem GetButtonInfo(IList<ToolbarItem> items, string name)
		{
			if (string.IsNullOrEmpty(name) || items == null)
				return null;

			return items.ToList().Where(itemData => name.Equals(itemData.Name)).FirstOrDefault();
		}
开发者ID:fadafido,项目名称:tojeero,代码行数:7,代码来源:ContentPageRenderer.cs

示例15: CompletedItemReviewer

        public CompletedItemReviewer(IList<SuspiciousPhrase> basicSuspiciousPhrases)
        {
            if (basicSuspiciousPhrases == null)
                throw new ArgumentNullException(nameof(basicSuspiciousPhrases));

            _basicSuspiciousPhrases = basicSuspiciousPhrases.ToList();
        }
开发者ID:craigshaw,项目名称:SoldOut,代码行数:7,代码来源:CompletedItemReviewer.cs


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