Esempio n. 1
0
        private void LoadContainerList()
        {
            //
            // When we keep reconnecting the memory usage goes thru the roof
            //
            GC.Collect();

            if (m_listingThread != null && m_listingThread.ThreadState == ThreadState.Running)
            {
                return;
            }

            containersListView.Items.Clear();
            m_containerList.Clear();

            m_listingThread = new Thread(delegate()
            {
                TioClient.Connection cn = new TioClient.Connection(m_connection.Host, m_connection.Port);

                m_containerCount = cn.Open("__meta__/containers").Count;

                cn.Open("__meta__/containers").Query(
                    delegate(object key, object value, object metadata)
                {
                    if (m_stopping)
                    {
                        m_connection.Close();
                        return;
                    }

                    lock (m_containerList)
                    {
                        m_containerList.Add(new ContainerItem {
                            key = key.ToString(), value = value.ToString()
                        });
                    }
                });

                cn.Close();
            });

            m_listingThread.Start();
        }
Esempio n. 2
0
        private void connectButton_Click(object sender, EventArgs e)
        {
            if (m_connection != null)
            {
                m_connection.Disconnect();
            }

            m_connection = new TioClient.Connection(m_server, m_port);

            Application.UserAppDataRegistry.SetValue("server", m_server);
            Application.UserAppDataRegistry.SetValue("port", m_port);

            statusLabel.Text = "Connected! Click \"update list\" to download container list";

            if (m_server == "localhost" || m_server == "127.0.0.1")
            {
                LoadContainerList();
                filterTextBox.Focus();
            }
        }
Esempio n. 3
0
        private void ContainerViewer_Load(object sender, EventArgs e)
        {
            Text = m_containerName;
            containerNameTextBox.Text = m_containerName;

            Application.DoEvents();

            try
            {
                m_connection = new TioClient.Connection(m_server, m_port);
                m_container = m_connection.Open(m_containerName);
            }
            catch (Exception ex)
            {
                MessageBox.Show("ERROR: " + ex.Message);
                Close();
                return;
            }

            UpdateData();
        }
Esempio n. 4
0
        private void ContainerViewer_Load(object sender, EventArgs e)
        {
            Text = m_containerName;
            containerNameTextBox.Text = m_containerName;

            Application.DoEvents();

            try
            {
                m_connection = new TioClient.Connection(m_server, m_port);
                m_container  = m_connection.Open(m_containerName);
            }
            catch (Exception ex)
            {
                MessageBox.Show("ERROR: " + ex.Message);
                Close();
                return;
            }

            UpdateData();
        }
Esempio n. 5
0
        private void connectButton_Click(object sender, EventArgs e)
        {
            if (m_connection != null)
                m_connection.Disconnect();

            m_connection = new TioClient.Connection(m_server, m_port);

            Application.UserAppDataRegistry.SetValue("server", m_server);
            Application.UserAppDataRegistry.SetValue("port", m_port);

            statusLabel.Text = "Connected! Click \"update list\" to download container list";

            if (m_server == "localhost" || m_server == "127.0.0.1")
            {
                LoadContainerList();
                filterTextBox.Focus();
            }
        }
Esempio n. 6
0
        private void LoadContainerList()
        {
            //
            // When we keep reconnecting the memory usage goes thru the roof
            //
            GC.Collect();

            if (m_listingThread != null && m_listingThread.ThreadState == ThreadState.Running)
                return;

            containersListView.Items.Clear();
            m_containerList.Clear();

            m_listingThread = new Thread(delegate()
            {
                TioClient.Connection cn = new TioClient.Connection(m_connection.Host, m_connection.Port);

                m_containerCount = cn.Open("__meta__/containers").Count;

                cn.Open("__meta__/containers").Query(
                    delegate(object key, object value, object metadata)
                    {
                        if (m_stopping)
                        {
                            m_connection.Close();
                            return;
                        }

                        lock (m_containerList)
                        {
                            m_containerList.Add(new ContainerItem { key=key.ToString(), value=value.ToString() });
                        }
                    });

                cn.Close();
            });

            m_listingThread.Start();
        }