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


C# ISet.Intersect方法代码示例

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


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

示例1: Negotiate

        public string Negotiate(ISet<string> server, ISet<string> client)
        {
            if (!server.Any() || !client.Any())
                return null;

            var matches = client.Intersect(server);
            if (!matches.Any())
                throw new SubProtocolNegotiationFailureException("Unable to negotiate a subprotocol");

            return matches.First();
        }
开发者ID:ReactiveMarkets,项目名称:Styx,代码行数:11,代码来源:SubProtocolNegotiator.cs

示例2: Intersect

 /// <summary>
 /// Performs an "intersection" of the two sets, where only the elements
 /// that are present in both sets remain.  That is, the element is included only if it exists in
 /// both <c>a</c> and <c>b</c>.  Neither input object is modified by the operation.
 /// The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <c>null</c>) containing the
 /// elements from the intersect operation.
 /// </summary>
 /// <param name="a">The left hand side set of elements to intersect.</param>
 /// <param name="b">The right hand side set of elements to intersect.</param>
 /// <returns>The intersection of the two input sets.  <c>null</c> if both sets are <c>null</c>.</returns>
 public static ISet Intersect(ISet a, ISet b)
 {
     if (a == null && b == null)
         return null;
     return a == null ? b.Intersect(a) : a.Intersect(b);
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:16,代码来源:Set.cs

示例3: Intersect

		/// <summary>
		/// Performs an "intersection" of the two sets, where only the elements
		/// that are present in both sets remain.  That is, the element is included only if it exists in
		/// both <c>a</c> and <c>b</c>.  Neither input object is modified by the operation.
		/// The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <see langword="null" />) containing the
		/// elements from the intersect operation. 
		/// </summary>
		/// <param name="a">A set of elements.</param>
		/// <param name="b">A set of elements.</param>
		/// <returns>The intersection of the two input sets.  <see langword="null" /> if both sets are <see langword="null" />.</returns>
		public static ISet Intersect(ISet a, ISet b)
		{
			if (a == null && b == null)
				return null;
			else if (a == null)
			{
				return b.Intersect(a);
			}
			else
				return a.Intersect(b);
		}
开发者ID:tkellogg,项目名称:NHibernate3-withProxyHooks,代码行数:21,代码来源:Set.cs

示例4: Intersect

		/// <summary>
		/// Performs an "intersection" of the two sets, where only the elements
		/// that are present in both sets remain. 
		/// </summary>
		/// <remarks>
		/// <p>
		/// That is, the element is included only if it exists in both
		/// <paramref name="setOne"/> and <paramref name="anotherSet"/>. Neither input
		/// object is modified by the operation. The result object is a
		/// <b>clone</b> of one of the input objects (<paramref name="setOne"/>
		/// if it is not <see langword="null"/>) containing the elements from
		/// the intersect operation.
		/// </p>
		/// </remarks>
		/// <param name="setOne">A set of elements.</param>
		/// <param name="anotherSet">A set of elements.</param>
		/// <returns>
		/// The intersection of the two input sets; <see langword="null"/> if
		/// both sets are <see langword="null"/>.
		/// </returns>
		public static ISet Intersect(ISet setOne, ISet anotherSet)
		{
			if (setOne == null && anotherSet == null)
			{
				return null;
			}
			else if (setOne == null)
			{
				return anotherSet.Intersect(setOne);
			}
			else
			{
				return setOne.Intersect(anotherSet);
			}
		}
开发者ID:fgq841103,项目名称:spring-net,代码行数:35,代码来源:Set.cs

示例5: Intersect

 public static ISet Intersect(ISet s1, ISet s2)
 {
     return s1.Intersect(s2);
 }
开发者ID:kiler398,项目名称:baseframeworktemplate,代码行数:4,代码来源:SetBase.cs


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