Ejemplo n.º 1
0
        public static LoggerAuditSinkConfiguration RabbitMq(
            this LoggerAuditSinkConfiguration configuration,
            Action <RabbitMqSinkOptions> optionsSetup,
            IConnection connection,
            IBinaryFormatter binaryFormatter,
            LogEventLevel restrictedToMinimumLevel = LogEventLevel.Verbose,
            LoggingLevelSwitch levelSwitch         = null,
            bool autoCloseConnection = true)
        {
            RabbitMqSinkOptions options = configuration.Create(optionsSetup);

            RabbitMqSink rabbitMqSink = new RabbitMqSink(options, connection, binaryFormatter,
                                                         autoCloseConnection);

            configuration.Sink(rabbitMqSink, restrictedToMinimumLevel, levelSwitch);

            return(configuration);
        }
Ejemplo n.º 2
0
        public static LoggerSinkConfiguration RabbitMq(
            this LoggerSinkConfiguration configuration,
            Action <RabbitMqSinkOptions> optionsSetup,
            AmqpTcpEndpoint endpoint,
            Action <ConnectionFactory> connectionFactorySetup,
            IBinaryFormatter binaryFormatter,
            LogEventLevel restrictedToMinimumLevel = LogEventLevel.Verbose,
            LoggingLevelSwitch levelSwitch         = null,
            string clientProviderName = null)
        {
            RabbitMqSinkOptions options = configuration.Create(optionsSetup);

            RabbitMqSink rabbitMqSink = new RabbitMqSink(options, endpoint, connectionFactorySetup, binaryFormatter,
                                                         clientProviderName);

            configuration.Sink(rabbitMqSink, restrictedToMinimumLevel, levelSwitch);

            return(configuration);
        }
Ejemplo n.º 3
0
 public static void DeserializeTo <T>(this IBinaryFormatter binaryFormatter, HGlobalCache <byte> hGCache, T obj)
 {
     binaryFormatter.DeserializeTo(hGCache, RWHelper.CreateWriter(obj));
 }
Ejemplo n.º 4
0
 public static void DeserializeTo <T>(this IBinaryFormatter binaryFormatter, Stream stream, T obj)
 {
     binaryFormatter.DeserializeTo(stream, RWHelper.CreateWriter(obj));
 }
Ejemplo n.º 5
0
 public static void DeserializeTo <T>(this IBinaryFormatter binaryFormatter, byte[] bytes, T obj)
 {
     binaryFormatter.DeserializeTo(bytes, RWHelper.CreateWriter(obj));
 }
Ejemplo n.º 6
0
 public static void DeserializeTo <T>(this IBinaryFormatter binaryFromatter, ReadOnlySpan <byte> text, T obj)
 {
     binaryFromatter.DeserializeTo(text, RWHelper.CreateWriter(obj));
 }