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


C# ISet.AddAll方法代码示例

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


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

示例1: ProcessCertD

		internal static PkixPolicyNode ProcessCertD(
			PkixCertPath	certPath,
			int				index,
			ISet			acceptablePolicies,
			PkixPolicyNode	validPolicyTree,
			IList[]			policyNodes,
			int				inhibitAnyPolicy)
			//throws CertPathValidatorException
		{
			IList certs = certPath.Certificates;
			X509Certificate cert = (X509Certificate)certs[index];
			int n = certs.Count;
			// i as defined in the algorithm description
			int i = n - index;
			//
			// (d) policy Information checking against initial policy and
			// policy mapping
			//
			Asn1Sequence certPolicies = null;
			try
			{
				certPolicies = DerSequence.GetInstance(
					PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.CertificatePolicies));
			}
			catch (Exception e)
			{
				throw new PkixCertPathValidatorException(
					"Could not read certificate policies extension from certificate.", e, certPath, index);
			}
			if (certPolicies != null && validPolicyTree != null)
			{
				//
				// (d) (1)
				//
				ISet pols = new HashSet();

				foreach (Asn1Encodable ae in certPolicies)
				{
					PolicyInformation pInfo = PolicyInformation.GetInstance(ae.ToAsn1Object());
					DerObjectIdentifier pOid = pInfo.PolicyIdentifier;

					pols.Add(pOid.Id);

					if (!Rfc3280CertPathUtilities.ANY_POLICY.Equals(pOid.Id))
					{
						ISet pq = null;
						try
						{
							pq = PkixCertPathValidatorUtilities.GetQualifierSet(pInfo.PolicyQualifiers);
						}
						catch (PkixCertPathValidatorException ex)
						{
							throw new PkixCertPathValidatorException(
								"Policy qualifier info set could not be build.", ex, certPath, index);
						}

						bool match = PkixCertPathValidatorUtilities.ProcessCertD1i(i, policyNodes, pOid, pq);

						if (!match)
						{
							PkixCertPathValidatorUtilities.ProcessCertD1ii(i, policyNodes, pOid, pq);
						}
					}
				}

				if (acceptablePolicies.IsEmpty || acceptablePolicies.Contains(Rfc3280CertPathUtilities.ANY_POLICY))
				{
					acceptablePolicies.Clear();
					acceptablePolicies.AddAll(pols);
				}
				else
				{
					ISet t1 = new HashSet();

					foreach (object o in acceptablePolicies)
					{
						if (pols.Contains(o))
						{
							t1.Add(o);
						}
					}
					acceptablePolicies.Clear();
					acceptablePolicies.AddAll(t1);
				}

				//
				// (d) (2)
				//
				if ((inhibitAnyPolicy > 0) || ((i < n) && PkixCertPathValidatorUtilities.IsSelfIssued(cert)))
				{
					foreach (Asn1Encodable ae in certPolicies)
					{
						PolicyInformation pInfo = PolicyInformation.GetInstance(ae.ToAsn1Object());
						if (Rfc3280CertPathUtilities.ANY_POLICY.Equals(pInfo.PolicyIdentifier.Id))
						{
							ISet _apq = PkixCertPathValidatorUtilities.GetQualifierSet(pInfo.PolicyQualifiers);
							IList _nodes = policyNodes[i - 1];

							for (int k = 0; k < _nodes.Count; k++)
							{
//.........这里部分代码省略.........
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:101,代码来源:Rfc3280CertPathUtilities.cs

示例2: ExtractTerms

 public override void ExtractTerms(ISet<Term> terms)
 {
     terms.AddAll(this.terms);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:4,代码来源:CommonTermsQuery.cs

示例3: RecurseUpTree

        /// <summary>
        /// Recurse all the way up the tree until all referenced structures are found - in the order in which they are found
        /// </summary>
        /// <param name="getParentsFor">
        /// The list of structures to get the parents for.
        /// </param>
        /// <param name="ignoreParents">
        /// The list of structures to ignore the parents.
        /// </param>
        /// <param name="filterSet">
        /// The filter set.
        /// </param>
        /// /// <returns>
        /// The referenced structures.
        /// </returns>
        private IEnumerable<IMaintainableObject> RecurseUpTree(
            IEnumerable<IMaintainableObject> getParentsFor,
            ISet<IMaintainableObject> ignoreParents,
            ISet<IMaintainableObject> filterSet)
        {
            var crossReferencingStructures = new List<IMaintainableObject>();

            foreach (IMaintainableObject oldBean in getParentsFor)
            {
                crossReferencingStructures.AddAll(this._crossReferencingRetrievalManager.GetCrossReferencingStructures(oldBean.AsReference, false));
            }
            //Filter out the parents we do not want to reversion
            crossReferencingStructures.RemoveItemList(ignoreParents);
            this.FilterReferencingStructures(crossReferencingStructures, filterSet);

            ignoreParents.AddAll(crossReferencingStructures);

            if (crossReferencingStructures.Count > 0)
            {
                IEnumerable<IMaintainableObject> ancestors = this.RecurseUpTree(
                    crossReferencingStructures, ignoreParents, filterSet);
                foreach (IMaintainableObject currentAncestor in ancestors)
                {
                    if (!crossReferencingStructures.Contains(currentAncestor))
                    {
                        crossReferencingStructures.AddAll(ancestors);
                    }
                }
            }
            return crossReferencingStructures;
        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:46,代码来源:StructureVersionIncrementManager.cs

示例4: AddRegistrations

		public void AddRegistrations(ISet<IRegistrationObject> registrations0) {
			if (registrations0 != null) {
				registrations0.AddAll(this.registrations);
			}
		}
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:5,代码来源:InMemoryRegistrationRetrievalManager.cs


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