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));
        }
예제 #2
0
 public static void Use(IMessagePeekLockControlProvider messagePeekLockControlProvider)
 {
     MessagePeekLockControlProvider.Instance = messagePeekLockControlProvider;
 }