本文整理汇总了C#中ICollection.Union方法的典型用法代码示例。如果您正苦于以下问题:C# ICollection.Union方法的具体用法?C# ICollection.Union怎么用?C# ICollection.Union使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICollection
的用法示例。
在下文中一共展示了ICollection.Union方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAssetItemsForExport
internal static IEnumerable<ExportPackageItem> GetAssetItemsForExport(ICollection<string> guids, bool includeDependencies)
{
if (guids.Count == 0)
guids = (ICollection<string>) new HashSet<string>((IEnumerable<string>) AssetServer.CollectAllChildren(AssetServer.GetRootGUID(), new string[0]));
ExportPackageItem[] exportPackageItemArray = PackageUtility.BuildExportPackageItemsList(guids.ToArray<string>(), includeDependencies);
if (includeDependencies && ((IEnumerable<ExportPackageItem>) exportPackageItemArray).Any<ExportPackageItem>((Func<ExportPackageItem, bool>) (asset => InternalEditorUtility.IsScriptOrAssembly(asset.assetPath))))
exportPackageItemArray = PackageUtility.BuildExportPackageItemsList(guids.Union<string>(InternalEditorUtility.GetAllScriptGUIDs()).ToArray<string>(), includeDependencies);
return (IEnumerable<ExportPackageItem>) ((IEnumerable<ExportPackageItem>) exportPackageItemArray).Where<ExportPackageItem>((Func<ExportPackageItem, bool>) (val => val.assetPath != "Assets")).ToArray<ExportPackageItem>();
}
示例2: InsertAll
public IObservable<Unit> InsertAll(ICollection<Place> places)
{
return blob.GetOrCreateObject<IList<Place>>(KEY_PLACES, () => new List<Place>())
.Select(source =>
{
return places.Union(source);
})
.SelectMany(merged => blob.InsertObject(KEY_PLACES, merged));
}
示例3: ElementsUnion
internal static List<IElement> ElementsUnion(ICollection<IElement> elements1, ICollection<IElement> elements2)
{
return elements1.Union(elements2).ToList();
}
示例4: GatherTypeToMethods
/// <summary>
/// Inner implementation of <see cref="GatherTypeToMethods()"/>.
/// </summary>
/// <param name="currentType">The current type to scan for methods.</param>
/// <param name="gatheredMethods">The methods inherited from parent.</param>
/// <param name="typeToMethods">The mapping to fill.</param>
private void GatherTypeToMethods(Type currentType, ICollection<MethodInfo> gatheredMethods, IDictionary<Type, ICollection<MethodInfo>> typeToMethods)
{
ICollection<MethodInfo> methodsForChildren = gatheredMethods;
List<MethodInfo> currentMethods =
gatheredMethods.Union(currentType.GetMethods(),
new ToStringComparer<MethodInfo>()).ToList();
typeToMethods[currentType] = currentMethods;
if (currentType.HasAttribute<InheritedAttribute>())
{
methodsForChildren = currentMethods;
}
foreach (var method in currentType.GetMethods())
{
if (!typeToMethods.ContainsKey(method.ReturnType))
{
GatherTypeToMethods(method.ReturnType,
methodsForChildren,
typeToMethods);
}
}
}