Example #1
0
        // Token: 0x06000556 RID: 1366 RVA: 0x0001EDD0 File Offset: 0x0001CFD0
        public static DeviceBehavior GetDeviceBehavior(Guid userGuid, DeviceIdentity deviceIdentity, GlobalInfo globalInfo, object traceObject, ProtocolLogger protocolLogger)
        {
            string token = DeviceBehaviorCache.GetToken(userGuid, deviceIdentity);

            globalInfo.DeviceBehavior.ProtocolLogger = protocolLogger;
            globalInfo.DeviceBehavior.CacheToken     = token;
            DeviceBehavior deviceBehavior;

            if (globalInfo.DeviceADObjectId == null || !DeviceBehaviorCache.TryGetAndRemoveValue(userGuid, deviceIdentity, out deviceBehavior))
            {
                if (protocolLogger != null)
                {
                    protocolLogger.SetValue(ProtocolLoggerData.DeviceBehaviorLoaded, 7);
                }
                AirSyncDiagnostics.TraceInfo(ExTraceGlobals.RequestsTracer, traceObject, "No device in cache, return GlobalInfo.DeviceBehavior");
                return(globalInfo.DeviceBehavior);
            }
            if (deviceBehavior.AutoBlockReason != globalInfo.DeviceBehavior.AutoBlockReason)
            {
                if (protocolLogger != null)
                {
                    protocolLogger.SetValue(ProtocolLoggerData.DeviceBehaviorLoaded, 1);
                }
                AirSyncDiagnostics.TraceInfo(ExTraceGlobals.RequestsTracer, traceObject, "AutoBlockReason changed, return GlobalInfo.DeviceBehavior");
                return(globalInfo.DeviceBehavior);
            }
            int num = globalInfo.DeviceBehavior.IsNewerThan(deviceBehavior.WhenLoaded);

            if (num > -1)
            {
                string arg = DeviceBehavior.dateCollections[num];
                if (protocolLogger != null)
                {
                    protocolLogger.SetValue(ProtocolLoggerData.DeviceBehaviorLoaded, num + 2);
                }
                AirSyncDiagnostics.TraceInfo <string>(ExTraceGlobals.RequestsTracer, traceObject, "{0} is newer, return GlobalInfo.DeviceBehavior", arg);
                return(globalInfo.DeviceBehavior);
            }
            AirSyncDiagnostics.TraceInfo(ExTraceGlobals.RequestsTracer, traceObject, "Return cached DeviceBehavior");
            deviceBehavior.Owner          = globalInfo;
            deviceBehavior.ProtocolLogger = protocolLogger;
            return(deviceBehavior);
        }
Example #2
0
        // Token: 0x06000578 RID: 1400 RVA: 0x000209A8 File Offset: 0x0001EBA8
        public static void AddOrReplace(Guid userGuid, DeviceIdentity deviceIdentity, DeviceBehavior data)
        {
            string token = DeviceBehaviorCache.GetToken(userGuid, deviceIdentity);

            DeviceBehaviorCache.AddOrReplace(token, data);
        }
Example #3
0
        // Token: 0x06000574 RID: 1396 RVA: 0x000208C4 File Offset: 0x0001EAC4
        public static bool TryGetValue(Guid userGuid, DeviceIdentity deviceIdentity, out DeviceBehavior data)
        {
            string token = DeviceBehaviorCache.GetToken(userGuid, deviceIdentity);

            return(DeviceBehaviorCache.TryGetValue(token, out data));
        }
Example #4
0
        // Token: 0x06000576 RID: 1398 RVA: 0x00020938 File Offset: 0x0001EB38
        public static bool ContainsKey(Guid userGuid, DeviceIdentity deviceIdentity)
        {
            string token = DeviceBehaviorCache.GetToken(userGuid, deviceIdentity);

            return(DeviceBehaviorCache.ContainsKey(token));
        }