示例#1
0
        /// <summary>
        /// Sets all required synchronization properties.
        /// </summary>
        /// <param name="checkBehavior">Defines the checking behavior for Publish calls.</param>
        /// <param name="messengerName">The name by which this messenger should be registered.</param>
        /// <param name="syncContext">The synchronization context to be used.</param>
        public void ApplyForGlobalSynchronization(SeeingSharpMessageThreadingBehavior checkBehavior, string messengerName, SynchronizationContext syncContext)
        {
            messengerName.EnsureNotNullOrEmpty(nameof(messengerName));
            syncContext.EnsureNotNull(nameof(syncContext));

            m_messengerName = messengerName;
            m_checkBehavior = checkBehavior;
            m_syncContext   = syncContext;

            if (!string.IsNullOrEmpty(messengerName))
            {
                s_messengersByName.TryAdd(messengerName, this);
            }
        }