Exemplo n.º 1
0
        public IndexedHashtable connect(AbstractCredentials credentials, AbstractPermission permission, DataSource validationDataSource)
        {
            permission.IsPrimary = true;
            QueryTemplate qt = new ConnectQuery(this);

            if (validationDataSource == null)
            {
                validationDataSource = new DataSource();
            }
            qt.QueryMethod("AbstractConnection", "authorizedConnect", new object[] { credentials, permission, validationDataSource });
            IndexedHashtable t = buildResults();

            // KLUGE:  This is here to make the number of connections come out right.
            // Note that the first element in the table will be a connection, but
            // the rest either User or Exception.
            if (HasBaseConnection && myResults.Count < myCxns.Count)
            {
                IndexedHashtable t2 = new IndexedHashtable(myCxns.Count);
                t2.Add(BaseConnection.DataSource.SiteId.Id, BaseConnection);
                for (int i = 0; i < t.Count; i++)
                {
                    t2.Add(t.GetKey(i), t.GetValue(i));
                }
                t = t2;
            }
            return(t);
        }
Exemplo n.º 2
0
        public IndexedHashtable connect(AbstractCredentials credentials, AbstractPermission permission, DataSource validationDataSource)
        {
            permission.IsPrimary = true;
            QueryTemplate qt = new ConnectQuery(this);
            if (validationDataSource == null)
            {
                validationDataSource = new DataSource();
            }
            qt.QueryMethod("AbstractConnection", "authorizedConnect", new object[] { credentials, permission, validationDataSource });
            IndexedHashtable t = buildResults();

            // KLUGE:  This is here to make the number of connections come out right.
            // Note that the first element in the table will be a connection, but
            // the rest either User or Exception.
            if (HasBaseConnection && myResults.Count < myCxns.Count)
            {
                IndexedHashtable t2 = new IndexedHashtable(myCxns.Count);
                t2.Add(BaseConnection.DataSource.SiteId.Id, BaseConnection);
                for (int i = 0; i < t.Count; i++)
                {
                    t2.Add(t.GetKey(i), t.GetValue(i));
                }
                t = t2;
            }
            return t;
        }