public StatusService(Form mainForm) { m_mainForm = mainForm; m_statusStrip = new StatusStrip(); m_statusStrip.Name = "StatusBar"; m_statusStrip.Dock = DockStyle.Bottom; // statusStrip items are laid out horizontally and overflow as necessary. m_statusStrip.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow; m_statusStrip.ShowItemToolTips = false; // main status text m_mainPanel = new ToolStripStatusLabel(); m_mainPanel.Width = 256; m_mainPanel.AutoSize = true; m_mainPanel.Spring = true; m_mainPanel.TextAlign = ContentAlignment.MiddleLeft; m_statusStrip.Items.Add(m_mainPanel); m_progressTimer = new Timer( progressCallback, this, Timeout.Infinite, ProgressInterval); m_progressDialog = new ThreadSafeProgressDialog(false, true); m_progressDialog.Cancelled += progressDialog_Cancelled; }
public BackgroundThread(ThreadSafeProgressDialog parent) { m_parent = parent; m_thread = new Thread(Run); m_thread.Name = "progress dialog"; m_thread.IsBackground = true; //so that the thread can be killed if app dies. m_thread.SetApartmentState(ApartmentState.STA); m_thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture; m_thread.Start(); }
public StatusService(Form mainForm) { m_mainForm = mainForm; m_statusStrip = new StatusStrip(); m_statusStrip.Name = "StatusBar"; m_statusStrip.Dock = DockStyle.Bottom; // main status text m_mainPanel = new ToolStripStatusLabel(); m_mainPanel.Width = 256; m_mainPanel.AutoSize = true; m_mainPanel.Spring = true; m_mainPanel.TextAlign = ContentAlignment.MiddleLeft; m_statusStrip.Items.Add(m_mainPanel); m_progressTimer = new Timer( new TimerCallback(progressCallback), this, Timeout.Infinite, ProgressInterval); m_progressDialog = new ThreadSafeProgressDialog(false, true); m_progressDialog.Cancelled += new EventHandler(progressDialog_Cancelled); }
public ProgressBarWrapper(string description) { m_dialog = new ThreadSafeProgressDialog( true, true, false) { Description = description }; }