Пример #1
0
        private string GetConnectionString(string connectionString)
        {
            DataLinksClass dataLinks  = new DataLinksClass();
            _Connection    connection = null;

            if (String.IsNullOrEmpty(connectionString))
            {
                connection = dataLinks.PromptNew() as _Connection;
                if (connection == null)
                {
                    return("");
                }
                return(connection.ConnectionString);
            }

            connection = new ConnectionClass();
            connection.ConnectionString = connectionString;
            object objConnection = connection;

            if (dataLinks.PromptEdit(ref objConnection))
            {
                return(connection.ConnectionString);
            }
            return(connectionString);
        }
        public static string PromptEdit(string connectionString)
        {
            var inputConnection = new ConnectionClass();

            try
            {
                inputConnection.ConnectionString = connectionString;
                var dataLinks = new DataLinksClass();
                try
                {
                    object connectionRef = inputConnection;
                    if (dataLinks.PromptEdit(ref connectionRef))
                    {
                        _Connection outputConnection = (_Connection)connectionRef;
                        try
                        {
                            return(outputConnection.ConnectionString);
                        }
                        finally
                        {
                            Marshal.ReleaseComObject(connectionRef);
                        }
                    }
                    return(null);
                }
                finally
                {
                    Marshal.ReleaseComObject(dataLinks);
                }
            }
            finally
            {
                Marshal.ReleaseComObject(inputConnection);
            }
        }
Пример #3
0
        private void btnConnectString_Click(object sender, EventArgs e)
        {
            var         dlDlg = new DataLinksClass();
            _Connection con   = null;

            con = (_Connection)dlDlg.PromptNew();
            if (con == null)
            {
                return;
            }
            var str = con.ConnectionString;

            if (!str.Contains(MULTI))
            {
                str = str + MULTI;
            }
            tbConnectionString.Text = str;
        }
Пример #4
0
 public virtual void Update()
 {
     if (Application.isPlaying)
     {
         return;
     }
     if (connectTo != null && connectToNothingPreviously)
     {
         _Connection connection = Instantiate(connectionPrefab);
         connection.start = this;
         connection.end   = connectTo;
         connection.Update();
         connectTo = null;
     }
     connections                = GetComponentsInChildren <_Connection>();
     image.color                = color;
     text.text                  = title;
     text.color                 = textColor;
     gameObject.name            = title;
     connectToNothingPreviously = connectTo == null;
 }
Пример #5
0
 void ev_connectionfailed(_Connection connection)
 {
     lock (_lock) {
         if (_isdisposed) return;
         _connections.Remove(connection);
     }
 }
Пример #6
0
 void ev_accept(IAsyncResult r)
 {
     Socket socket;
     try {
         lock (_lock) {
             if (_isdisposed) return;
             ev_debug("accepting connection");
             socket = _listensock.EndAccept(r);
             socket.NoDelay = true;
             _AcceptLoop();
             var connection = new _Connection(this, socket);
             _connections.Add(connection);
         }
     } catch (IOException) {
         _AcceptLoop();
     } catch (SocketException) {
         _AcceptLoop();
     } catch (ObjectDisposedException) {
         return;
     } catch (Exception e) {
         ev_error("Error accepting connection", e);
     }
 }
Пример #7
0
 internal ResponseBodyBuffer(_Connection connection)
 {
     _connection = connection;
 }
Пример #8
0
 internal RequestBodyBuffer(_Connection connection)
 {
     _connection = connection;
 }
Пример #9
0
 public DALClass()
 {
     getConn = new _Connection();
 }