예제 #1
0
        // Token: 0x06000901 RID: 2305 RVA: 0x000239C0 File Offset: 0x00021BC0
        internal void Register(ConditionalRegistration registration)
        {
            TimeSpan expiration = (ConditionalRegistrationCache.MaxActiveRegistrationTimeEntry.Value < registration.TimeToLive) ? ConditionalRegistrationCache.MaxActiveRegistrationTimeEntry.Value : registration.TimeToLive;

            if (this.cache.TryAddAbsolute(registration.Cookie, registration, expiration))
            {
                this.UpdateActiveProperties(registration, true);
                if (ConditionalRegistrationCache.TESTHOOK_PersistRegistration == null)
                {
                    ConditionalRegistrationLog.Save(registration);
                    return;
                }
                ConditionalRegistrationCache.TESTHOOK_PersistRegistration(registration);
            }
        }
예제 #2
0
 // Token: 0x0600090B RID: 2315 RVA: 0x00023C9C File Offset: 0x00021E9C
 private void HandleRemoveRegistration(string key, BaseConditionalRegistration value, RemoveReason reason)
 {
     ExTraceGlobals.DiagnosticHandlersTracer.TraceDebug <string, RemoveReason, string>((long)this.GetHashCode(), "[ConditionalRegistrationCache.HandleRemoveRegistration] Cookie: {0} was removed for reason {1}.  Description: '{2}'", key, reason, value.Description ?? "<NULL>");
     if (ConditionalRegistrationCache.TESTHOOK_DeleteRegistration == null)
     {
         ConditionalRegistrationLog.DeleteRegistration(key);
     }
     else
     {
         ConditionalRegistrationCache.TESTHOOK_DeleteRegistration(key);
     }
     this.UpdateActiveProperties(value, false);
     if (value.OnExpired != null)
     {
         value.OnExpired(value, reason);
     }
 }
예제 #3
0
        // Token: 0x06000907 RID: 2311 RVA: 0x00023C10 File Offset: 0x00021E10
        internal bool Remove(string cookie)
        {
            if (ConditionalRegistrationCache.TESTHOOK_DeleteRegistration == null)
            {
                ConditionalRegistrationLog.DeleteRegistration(cookie);
            }
            else
            {
                ConditionalRegistrationCache.TESTHOOK_DeleteRegistration(cookie);
            }
            BaseConditionalRegistration baseConditionalRegistration = this.cache.Remove(cookie.ToString());

            if (baseConditionalRegistration != null)
            {
                this.UpdateActiveProperties(baseConditionalRegistration, false);
            }
            return(baseConditionalRegistration != null);
        }