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; } } }
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); }