Пример #1
0
        private IEventDispatcher GetEventDispatcher(IEvent @event)
        {
            var domainModel = _store.GetDomainModel(@event.Domain);

            if (domainModel.EventDispatcher != null)
            {
                return(domainModel.EventDispatcher);
            }
            if (_defaultDispatcher == null)
            {
                _defaultDispatcher = _store.Services.Resolve <IEventDispatcher>();
                DebugContract.Assert(_defaultDispatcher != null);
            }
            return(_defaultDispatcher);
        }
        ///-------------------------------------------------------------------------------------------------
        /// <summary>
        ///  Activation d'un domaine ou de son extension.
        /// </summary>
        /// <remarks>
        ///  L'activation d'un domaine s'effectue une fois qu'il a fini d'être initialisé. Il est alors
        ///  visible par tout le monde.
        /// </remarks>
        /// <param name="domain">
        ///  .
        /// </param>
        ///-------------------------------------------------------------------------------------------------
        public void EnableScope(T domain)
        {
            DebugContract.Requires(domain != null);

            _sync.EnterWriteLock();
            try
            {
                var item = FindDomainStack(domain.Name);
                DebugContract.Assert(item != null);
                item.Activate(domain);
            }
            finally
            {
                _sync.ExitWriteLock();
            }
        }
        public object Parse(string text, object obj = null)
        {
            if (String.IsNullOrEmpty(text))
            {
                return(null);
            }

            lexer = new Lexer(text);
            TokenInfo token = lexer.NextToken();

            if (token.Kind == TokenKind.LCurly)
            {
                DebugContract.Assert(obj != null);
                ParseObject(obj);
                return(obj);
            }

            return(ParseValue());
        }
 public EnlistNotificationWrapper(ITransaction transaction)
 {
     DebugContract.Requires(transaction);
     _transaction = transaction as ISessionEnlistmentNotification;
     DebugContract.Assert(_transaction != null);
 }