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


C# EvaluationContext.RecordExpirationTime方法代码示例

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


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

示例1: Evaluate

		// This method is expected to be thread safe
		public bool Evaluate (EvaluationContext ec, ref object state)
		{
			lock (ec) {
				ec.AddClaimSet (this, CreateClaims ());
				List<IIdentity> list;
				if (!ec.Properties.ContainsKey ("Identities")) {
					list = new List<IIdentity> ();
					ec.Properties ["Identities"] = list;
				} else {
					IList<IIdentity> ilist = (IList<IIdentity>) ec.Properties ["Identities"];
					list = ilist as List<IIdentity>;
					if (list == null) {
						list = new List<IIdentity> (ilist);
						ec.Properties ["Identities"] = list;
					}
				}
				list.Add (CreateIdentity ());
				ec.RecordExpirationTime (ExpirationTime);
			}
			// FIXME: is it correct that this should always return true?
			return true;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:23,代码来源:SystemIdentityAuthorizationPolicy.cs

示例2: Evaluate

        public virtual bool Evaluate(EvaluationContext evaluationContext, ref object state)
        {
            ThrowIfDisposed();
            if (this.issuance != null)
            {
                evaluationContext.AddClaimSet(this, this.issuance);
            }
            else
            {
                for (int i = 0; i < this.issuances.Count; ++i)
                {
                    if (this.issuances[i] != null)
                    {
                        evaluationContext.AddClaimSet(this, this.issuances[i]);
                    }
                }
            }

            // Preferably Non-Anonymous
            if (this.PrimaryIdentity != null && this.PrimaryIdentity != SecurityUtils.AnonymousIdentity)
            {
                IList<IIdentity> identities;
                object obj;
                if (!evaluationContext.Properties.TryGetValue(SecurityUtils.Identities, out obj))
                {
                    identities = new List<IIdentity>(1);
                    evaluationContext.Properties.Add(SecurityUtils.Identities, identities);
                }
                else
                {
                    // null if other overrides the property with something else
                    identities = obj as IList<IIdentity>;
                }

                if (identities != null)
                {
                    identities.Add(this.PrimaryIdentity);
                }
            }

            evaluationContext.RecordExpirationTime(this.expirationTime);
            return true;
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:43,代码来源:UnconditionalPolicy.cs

示例3: Evaluate

			public bool Evaluate (EvaluationContext ec, ref Object state)
			{
				ec.AddClaimSet (this, new DefaultClaimSet (Claim.CreateRsaClaim (rsa)));
				ec.RecordExpirationTime (DateTime.MaxValue.AddDays (-1));
				return true;
			}
开发者ID:nlhepler,项目名称:mono,代码行数:6,代码来源:RsaSecurityTokenAuthenticator.cs

示例4: Evaluate

            public bool Evaluate(EvaluationContext evaluationContext, ref object state)
            {
                for (int i = 0; i < this.claimSets.Count; ++i)
                {
                    evaluationContext.AddClaimSet(this, this.claimSets[i]);
                }

                if (this.identities != null)
                {
                    object obj;
                    if (!evaluationContext.Properties.TryGetValue(SecurityUtils.Identities, out obj))
                    {
                        evaluationContext.Properties.Add(SecurityUtils.Identities, this.identities);
                    }
                    else
                    {
                        // null if other overrides the property with something else
                        List<IIdentity> dstIdentities = obj as List<IIdentity>;
                        if (dstIdentities != null)
                        {
                            dstIdentities.AddRange(this.identities);
                        }
                    }
                }
                evaluationContext.RecordExpirationTime(this.expirationTime);
                return true;
            }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:27,代码来源:SecurityContextCookieSerializer.cs

示例5: Evaluate

 public bool Evaluate(EvaluationContext evaluationContext, ref object state)
 {
     for (int num1 = 0; num1 < this.claimSets.Count; num1++)
     {
         evaluationContext.AddClaimSet(this, this.claimSets[num1]);
     }
     if (this.identities != null)
     {
         object obj;
         if (!evaluationContext.Properties.TryGetValue("Identities", out obj))
         {
             evaluationContext.Properties.Add("Identities", (object)this.identities);
         }
         else
         {
             List<IIdentity> identities = obj as List<IIdentity>;
             if (identities != null)
             {
                 identities.AddRange(this.identities);
             }
         }
     }
     evaluationContext.RecordExpirationTime(this.expirationTime);
     return true;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:25,代码来源:SerializableAuthorizationContext.cs

示例6: Evaluate

 public bool Evaluate(EvaluationContext evaluationContext, ref object state)
 {
     evaluationContext.AddClaimSet(this, issuance);
     evaluationContext.RecordExpirationTime(DateTime.UtcNow.AddDays(1.0));
     return true;
 }
开发者ID:svn2github,项目名称:ehi,代码行数:6,代码来源:DummyAuthorizationPolicy.cs

示例7: Evaluate

        public bool Evaluate(EvaluationContext evaluationContext, ref object state)
        {
            evaluationContext.AddClaimSet(this, this.issuance);

            if (this.identities != null)
            {
                object value;
                IList<IIdentity> contextIdentities;
                if (!evaluationContext.Properties.TryGetValue("Identities", out value))
                {
                    contextIdentities = new List<IIdentity>(this.identities.Count);
                    evaluationContext.Properties.Add("Identities", contextIdentities);
                }
                else
                {
                    contextIdentities = value as IList<IIdentity>;
                }
                foreach (IIdentity identity in this.identities)
                {
                    contextIdentities.Add(identity);
                }
            }

            evaluationContext.RecordExpirationTime(this.expirationTime);
            return true;
        }
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:26,代码来源:MyTokenAuthenticator.cs

示例8: Evaluate

 public bool Evaluate(EvaluationContext evaluationContext, ref object state)
 {
     for (int i = 0; i < this.claimSets.Count; i++)
     {
         evaluationContext.AddClaimSet(this, this.claimSets[i]);
     }
     if (this.identities != null)
     {
         object obj2;
         if (!evaluationContext.Properties.TryGetValue("Identities", out obj2))
         {
             evaluationContext.Properties.Add("Identities", this.identities);
         }
         else
         {
             List<IIdentity> list = obj2 as List<IIdentity>;
             if (list != null)
             {
                 list.AddRange(this.identities);
             }
         }
     }
     evaluationContext.RecordExpirationTime(this.expirationTime);
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:SecurityContextCookieSerializer.cs


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