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


C# ICollection.Union方法代码示例

本文整理汇总了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>();
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:9,代码来源:PackageExport.cs

示例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));
 }
开发者ID:amay077,项目名称:DroidKaigi2016Xamarin,代码行数:9,代码来源:PlaceDao.cs

示例3: ElementsUnion

 internal static List<IElement> ElementsUnion(ICollection<IElement> elements1, ICollection<IElement> elements2)
 {
     return elements1.Union(elements2).ToList();
 }
开发者ID:ajlopez,项目名称:AjGroups,代码行数:4,代码来源:ElementUtilities.cs

示例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);
                }
            }
        }
开发者ID:amityo,项目名称:Flu.net,代码行数:31,代码来源:LegalSyntaxAutomataBuilder.cs


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