public static IMessagePeekLockControl GetPeekLockControl <TMessage>(this TMessage message) where TMessage : class { if (message == null) { throw new ArgumentNullException(nameof(message)); } IMessagePeekLockControlProvider configuredMessagePeekLockControlProvider = MessagePeekLockControlProvider.ConfiguredInstance; if (configuredMessagePeekLockControlProvider == null) { throw new InvalidOperationException($"No {nameof(IMessagePeekLockControlProvider)} has been configured."); } return(configuredMessagePeekLockControlProvider.GetMessagePeekLockControl(message)); }
public static void Use(IMessagePeekLockControlProvider messagePeekLockControlProvider) { MessagePeekLockControlProvider.Instance = messagePeekLockControlProvider; }