Ejemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();

            CablecastFactory.Update();

            lock (m_lockObject)
            {
                m_list.AllowEdit = m_list.AllowNew = false;
                m_list.AllowRemove = true;
                m_list.RaiseListChangedEvents = true;
                dataGridView1.DataSource = m_list;
            }

            // set up columns to have the right type
            if (dataGridView1.Columns.Contains("Name"))
                dataGridView1.Columns["Name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            if (dataGridView1.Columns.Contains("Progress"))
            {
                dataGridView1.Columns.Remove("Progress");

                DataGridViewProgressColumn column = new DataGridViewProgressColumn();
                column.Name = "Progress";
                column.HeaderText = "Progress";
                column.DataPropertyName = "Progress";
                dataGridView1.Columns.Add(column);
            }

            if (dataGridView1.Columns.Contains("Action"))
            {
                dataGridView1.Columns.Remove("Action");

                //DataGridViewButtonColumn column = new DataGridViewButtonColumn();
                //DataGridViewLinkColumn column = new DataGridViewLinkColumn();
                DataGridViewDisableButtonColumn column = new DataGridViewDisableButtonColumn();
                column.Name = "Action";
                column.HeaderText = "Action";
                column.DataPropertyName = "Action";
                dataGridView1.Columns.Add(column);
            }
        }
Ejemplo n.º 2
0
Archivo: Form1.cs Proyecto: trms/tracm
        public MainForm()
        {
            LogHelper.Logger.Info("TRACM starting");
            m_Context = SynchronizationContext.Current;

            InitializeComponent();

            CablecastFactory.Update();

            lock (m_lockObject)
            {
                m_list.AllowEdit = m_list.AllowNew = false;
                m_list.AllowRemove = true;
                m_list.RaiseListChangedEvents = true;
                dataGridView1.DataSource = m_list;
            }

            // set up columns to have the right type
            if (dataGridView1.Columns.Contains("Name"))
                dataGridView1.Columns["Name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            if (dataGridView1.Columns.Contains("Progress"))
            {
                dataGridView1.Columns.Remove("Progress");

                DataGridViewProgressColumn column = new DataGridViewProgressColumn();
                column.Name = "Progress";
                column.HeaderText = "Progress";
                column.DataPropertyName = "Progress";
                dataGridView1.Columns.Add(column);
            }

            if (dataGridView1.Columns.Contains("Action"))
            {
                dataGridView1.Columns.Remove("Action");

                //DataGridViewButtonColumn column = new DataGridViewButtonColumn();
                //DataGridViewLinkColumn column = new DataGridViewLinkColumn();
                DataGridViewDisableButtonColumn column = new DataGridViewDisableButtonColumn();
                column.Name = "Action";
                column.HeaderText = "Action";
                column.DataPropertyName = "Action";
                dataGridView1.Columns.Add(column);
            }

            //Setup poller
            m_Poller = new Thread(PollingThread);
            m_Poller.IsBackground = true;
            m_Poller.Start();
        }