本文整理汇总了C#中ILogger.ShouldNotBeNull方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.ShouldNotBeNull方法的具体用法?C# ILogger.ShouldNotBeNull怎么用?C# ILogger.ShouldNotBeNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILogger
的用法示例。
在下文中一共展示了ILogger.ShouldNotBeNull方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MultiServiceHost
/// <summary>
/// Initialises an instance of a <see cref="MultiServiceHost"/> class.
/// </summary>
/// <param name="logger">
/// Logging provider.
/// </param>
public MultiServiceHost(ILogger logger)
{
logger.ShouldNotBeNull();
m_ServiceEntries = new Hashtable();
m_Logger = logger;
m_ResourceLoader = new ServicesResourceLoader();
}
示例2: AmqpConnection
/// <summary>
/// Initialises an instance of the <see cref="AmqpConnection"/> class.
/// </summary>
/// <param name="logger">
/// </param>
/// <param name="registration">
/// Details required to connect to the queued message server.
/// </param>
public AmqpConnection(ILogger logger, RegistrationData registration)
{
registration.ShouldNotBeNull();
logger.ShouldNotBeNull();
m_Address = registration.Address;
m_Logger = logger;
}
示例3: ArchiveDataService
/// <summary>
/// Initialises an instance of the <see cref="ArchiveDataService"/> class.
/// </summary>
/// <param name="logger"></param>
/// <param name="fileHelper"></param>
/// <param name="configuration"></param>
public ArchiveDataService(ILogger logger, IFileHelper fileHelper, BufferedConfiguration configuration) : base(logger, typeof(ArchiveDataService))
{
logger.ShouldNotBeNull();
fileHelper.ShouldNotBeNull();
configuration.ShouldNotBeNull();
m_FileHelper = fileHelper;
m_Configuration = configuration;
m_Logger = logger;
m_SyncObject = new object();
}
示例4: AmqpMessagePublisher
/// <summary>
/// Initialises an instance of the publisher.
/// </summary>
/// <param name="logger"></param>
/// <param name="connection">
/// The AMQP connection to use.
/// </param>
/// <param name="topicName">
/// The topic name to publish to.
/// </param>
/// <param name="name">
/// The unique name to associate with the link used to send messages on.
/// </param>
/// <param name="isDurable">
/// Indicates whether the messages should be durable (Persistent).
/// </param>
public AmqpMessagePublisher(ILogger logger, AmqpConnection connection, string topicName, string name, bool isDurable = true)
{
connection.ShouldNotBeNull();
topicName.ShouldNotBeEmpty();
name.ShouldNotBeEmpty();
logger.ShouldNotBeNull();
m_Logger = logger;
m_ConnectionId = string.Empty;
m_Connection = connection;
m_TopicName = topicName;
m_Name = name;
m_IsDurable = isDurable;
m_SendTimeoutInMilliseconds = 10000;
}
示例5: ThreadedService
/// <summary>
/// Initializes a new instance of the <see cref="ThreadedService"/> class.
/// </summary>
/// <param name="logger">
/// A logging provider.
/// </param>
protected ThreadedService(ILogger logger, Type serviceType) : this(serviceType)
{
logger.ShouldNotBeNull();
m_Logger = logger;
m_IsLoggingEnabled = true;
}
示例6: NetworkHelper
/// <summary>
/// Initialises an instance of the <see cref="NetworkHelper"/> class.
/// </summary>
/// <param name="logger">
/// A logging provider.
/// </param>
public NetworkHelper(ILogger logger)
{
logger.ShouldNotBeNull();
m_Interfaces = NetworkInterface.GetAllNetworkInterfaces();
m_WaitForNetwork = new AutoResetEvent(false);
m_WaitForAddressChange = new AutoResetEvent(false);
m_SyncLock = new object();
m_Logger = logger;
m_WaitForNetworkEventInMilliseconds = 2000;
}
示例7: BufferedLoggingService
/// <summary>
/// Initialises an instance of the <see cref="BufferedLoggingService"/> class.
/// </summary>
/// <param name="fileHelper">
/// Helper for working with files.
/// </param>
/// <param name="configuration">
/// Configuration details for buffered data persistence.
/// </param>
public BufferedLoggingService(LogContainer container, ILogger logger, IFileHelper fileHelper, BufferedConfiguration configuration) : base(logger, typeof(BufferedLoggingService))
{
logger.ShouldNotBeNull();
fileHelper.ShouldNotBeNull();
configuration.ShouldNotBeNull();
m_LogEntries = container;
m_BatchSize = 2;
m_BufferSize = 512;
m_FileHelper = fileHelper;
m_WorkingFilePath = configuration.WorkingPath;
m_TargetFilePath = configuration.TargetPath;
m_TargetFileExtension = configuration.TargetFileExtension;
m_WorkingFileExtension = configuration.WorkingFileExtension;
}
示例8: AmqpMessageSubscriber
/// <summary>
/// Initialises an instance of the publisher.
/// </summary>
/// <param name="connection">
/// The AMQP connection to use.
/// </param>
/// <param name="topicName">
/// The topic name to publish to.
/// </param>
/// <param name="name">
/// The unique name to associate with the link used to receive messages on.
/// </param>
/// <param name="handler">
/// Processes incoming messages from the AMQP server.
/// </param>
public AmqpMessageSubscriber(ILogger logger, AmqpConnection connection, string topicName, string name, IMessageHandler handler, int windowSize = 20)
{
connection.ShouldNotBeNull();
topicName.ShouldNotBeEmpty();
handler.ShouldNotBeNull();
name.ShouldNotBeEmpty();
logger.ShouldNotBeNull();
m_Logger = logger;
m_Connection = connection;
m_ConnectionId = string.Empty;
m_TopicName = topicName;
m_MessageHandler = handler;
m_WindowSize = windowSize;
m_Name = name;
}