コード例 #1
0
        protected Subscription(ICRUDSubscriptionStoreImplementation store, string name, Query query, Mailbox mailbox, object correlate) : base(store)
        {
            if (store == null ||
                query == null ||
                mailbox == null)
            {
                throw new CRUDException(StringConsts.ARGUMENT_ERROR + GetType().FullName + ".ctor(args...null)");
            }

            if (mailbox.Store != store)
            {
                throw new CRUDException(StringConsts.ARGUMENT_ERROR + GetType().FullName + ".ctor(mailbox.Store!=this.Store)");
            }

            m_Store   = store;
            m_Name    = name.IsNullOrWhiteSpace() ? Guid.NewGuid().ToString() : name;
            m_Query   = query;
            m_Mailbox = mailbox;
            Correlate = correlate;

            var          reg = m_Store.Subscriptions as Registry <Subscription>;
            Subscription existing;

            if (!reg.RegisterOrReplace(this, out existing))
            {
                existing.Dispose();
            }

            ((Registry <Subscription>)mailbox.Subscriptions).Register(this);
        }
コード例 #2
0
ファイル: Mailbox.cs プロジェクト: vlapchenko/nfx
  protected internal Mailbox(ICRUDSubscriptionStoreImplementation store, string name) : base(store)
  {
    m_Store = store;
    m_Name = name.IsNullOrWhiteSpace() ? Guid.NewGuid().ToString() : name;
 
    var reg = m_Store.Mailboxes as Registry<Mailbox>;
    Mailbox existing;
    if (!reg.RegisterOrReplace(this, out existing))
     existing.Dispose();
  }
コード例 #3
0
ファイル: Mailbox.cs プロジェクト: azist/azos
        protected internal Mailbox(ICRUDSubscriptionStoreImplementation store, string name) : base(store)
        {
            m_Store = store;
            m_Name  = name.IsNullOrWhiteSpace() ? Guid.NewGuid().ToString() : name;

            var reg = m_Store.Mailboxes as Registry <Mailbox>;

            if (!reg.RegisterOrReplace(this, out Mailbox existing))
            {
                existing.Dispose();
            }
        }
コード例 #4
0
ファイル: Subscription.cs プロジェクト: vlapchenko/nfx
    protected Subscription(ICRUDSubscriptionStoreImplementation store, string name, Query query, Mailbox mailbox) : base(store)
    {
      if (store==null ||
          query==null||
          mailbox==null) 
        throw new CRUDException(StringConsts.ARGUMENT_ERROR+GetType().FullName+".ctor(args...null)");

      if (mailbox.Store!=store)
        throw new CRUDException(StringConsts.ARGUMENT_ERROR+GetType().FullName+".ctor(mailbox.Store!=this.Store)");

      m_Store = store;
      m_Name = name.IsNullOrWhiteSpace() ? Guid.NewGuid().ToString() : name;
      m_Query = query;
      m_Mailbox = mailbox;

      var reg = m_Store.Subscriptions as Registry<Subscription>;
      Subscription existing;
      if (!reg.RegisterOrReplace(this, out existing))
       existing.Dispose();

      ((Registry<Subscription>)mailbox.Subscriptions).Register(this);
    }