本文整理汇总了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();
}
示例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());
}
}
示例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);
});
}