Esempio n. 1
0
 public CreateForm(out GliderConnection connection)
 {
     InitializeComponent();
     connection  = new GliderConnection();
     _connection = connection;
     name_txt.Focus();
 }
Esempio n. 2
0
        private void view_btn_Click(object sender, EventArgs e)
        {
            GliderConnection _conn = getSelectedConnection();

            if (_conn != null)
            {
                new ViewForm(_conn).ShowDialog();
            }
        }
Esempio n. 3
0
 public ViewForm(GliderConnection connection)
 {
     InitializeComponent();
     _connection     = connection;
     _timer          = new Timer();
     _timer.Interval = 40;
     _timer.Tick    += new System.EventHandler(this.timer_Tick);
     _last           = null;
     _eventAdded     = false;
 }
Esempio n. 4
0
        private GliderConnection getSelectedConnection()
        {
            GliderConnection _conn = null;

            if (connections_tc.Controls.Count > 0)
            {
                _conn = ((objects.TabPage)connections_tc.SelectedTab).Connection;
            }
            return(_conn);
        }
Esempio n. 5
0
        private void disconnect_btn_Click(object sender, EventArgs e)
        {
            GliderConnection _conn = getSelectedConnection();

            if (_conn != null && _conn.Status)
            {
                _conn.Disconnect();
            }
            CheckButton();
        }
Esempio n. 6
0
        private void connectTimer_Tick(object sender, EventArgs e)
        {
            GliderConnection _conn = getSelectedConnection();

            if (_conn != null && !_conn.Connecting)
            {
                System.Windows.Forms.Timer timer = ((System.Windows.Forms.Timer)sender);
                timer.Enabled = false;
                timer.Dispose();
            }
            CheckButton();
        }
Esempio n. 7
0
        private void connect_btn_Click(object sender, EventArgs e)
        {
            GliderConnection _conn = getSelectedConnection();

            if (!_conn.Connecting)
            {
                connect_btn.Image = LenHandler.Properties.Resources.loader;
                Thread thread = new Thread(new ThreadStart(_conn.Connect));
                thread.IsBackground = false;
                thread.Start();
                _openThread.Add(thread);
                System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
                timer.Interval = 500;
                timer.Tick    += new System.EventHandler(this.connectTimer_Tick);
                timer.Enabled  = true;
            }
        }
Esempio n. 8
0
        private void CheckButton()
        {
            bool _status = false;

            connect_btn.Enabled = false;
            GliderConnection _conn = getSelectedConnection();

            if (_conn != null)
            {
                _status = _conn.Status;
                if (!_conn.Connecting)
                {
                    connect_btn.Image = null;
                }
                else
                {
                    connect_btn.Image = LenHandler.Properties.Resources.loader;
                }
                connect_btn.Enabled = !_status;
            }
            disconnect_btn.Enabled = _status;
            view_btn.Enabled       = _status;
            cmd_btn.Enabled        = _status;
        }
Esempio n. 9
0
 public CommandForm(GliderConnection connection)
 {
     InitializeComponent();
     _connection = connection;
 }