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


C# Collection.SelectMany方法代码示例

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


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

示例1: Load

        /// <summary>
        /// Initialize static certificates.
        /// </summary>
        internal static void Load()
        {
            CertificatesDatafile datafile = Util.DeserializeDatafile<CertificatesDatafile>(DatafileConstants.CertificatesDatafile,
                    Util.LoadXslt(Properties.Resources.DatafilesXSLT));

            AllGroups = new Collection<StaticCertificateGroup>();

            foreach (SerializableCertificateGroup srcGroup in datafile.Groups)
            {
                AllGroups.Add(new StaticCertificateGroup(srcGroup));
            }

            // Build inner collections
            foreach (StaticCertificateClass certClass in AllGroups.SelectMany(certClass => certClass))
            {
                s_classesByName[certClass.Name] = certClass;
                s_certificatesByID[certClass.Certificate.ID] = certClass.Certificate;
            }

            // Completes intialization
            foreach (SerializableCertificateClass srcClass in datafile.Groups.SelectMany(srcGroup => srcGroup.Classes))
            {
                s_classesByName[srcClass.Name].Certificate.CompleteInitialization(srcClass.Certificate.Prerequisites);
            }

            GlobalDatafileCollection.OnDatafileLoaded();
        }
开发者ID:,项目名称:,代码行数:30,代码来源:

示例2: AddBindingParameters

 public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints,
     BindingParameterCollection bindingParameters)
 {
     foreach (var operation in endpoints.SelectMany(val => val.Contract.Operations.Where(x => x.Behaviors.Find<ExceptionHandlerOperationBehavior>() == null)))
     {
         operation.Behaviors.Add(new ExceptionHandlerOperationBehavior());
     }
 }
开发者ID:emretiryaki,项目名称:Blog,代码行数:8,代码来源:ExceptionHandlerServiceBehaviorAttribute.cs

示例3: typeof

 /// <summary>
 /// Provides the ability to pass custom data to binding elements to support the contract implementation.
 /// </summary>
 /// <param name="serviceDescription">The service description of the service.</param><param name="serviceHostBase">The host of the service.</param><param name="endpoints">The service endpoints.</param><param name="bindingParameters">Custom objects to which binding elements have access.</param>
 void IServiceBehavior.AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
 {
     endpoints
         .SelectMany(x => x.Contract.Operations)
         .Where(x => x.DeclaringContract.ContractType != typeof(IMetadataExchange))
         .ToList()
         .ForEach(x =>
         {
             if (!x.Behaviors.Any(b => b.GetType() == GetType()))
                 x.Behaviors.Add(this);
         });
 }
开发者ID:broccliman,项目名称:Presentation.WCF,代码行数:16,代码来源:ServiceExtensionsAttribute.cs


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