コード例 #1
0
 private static void Stop(AuditingOpticsLoggerType loggerType)
 {
     EnumValidator.AssertValid <AuditingOpticsLoggerType>(loggerType);
     lock (AuditingOpticsLogger.instanceLock)
     {
         AuditingOpticsLoggerInstance auditingOpticsLoggerInstance = AuditingOpticsLogger.instances[(int)loggerType];
         if (auditingOpticsLoggerInstance != null)
         {
             auditingOpticsLoggerInstance.Stop();
             AuditingOpticsLogger.instances[(int)loggerType] = null;
         }
     }
 }
コード例 #2
0
        internal static IAuditingOpticsLoggerInstance GetInstance(AuditingOpticsLoggerType loggerType)
        {
            EnumValidator.AssertValid <AuditingOpticsLoggerType>(loggerType);
            if (AuditingOpticsLogger.auditingOpticsLoggerInstanceHook.Value != null)
            {
                return(AuditingOpticsLogger.auditingOpticsLoggerInstanceHook.Value);
            }
            IAuditingOpticsLoggerInstance result;

            lock (AuditingOpticsLogger.instanceLock)
            {
                AuditingOpticsLoggerInstance auditingOpticsLoggerInstance = AuditingOpticsLogger.instances[(int)loggerType];
                if (auditingOpticsLoggerInstance == null)
                {
                    auditingOpticsLoggerInstance = new AuditingOpticsLoggerInstance(loggerType);
                    AuditingOpticsLogger.instances[(int)loggerType] = auditingOpticsLoggerInstance;
                }
                result = auditingOpticsLoggerInstance;
            }
            return(result);
        }