示例#1
1
        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;
        }
示例#2
0
 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();
 }
示例#3
0
        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 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();
 } 
示例#5
0
 public ProgressBarWrapper(string description)
 {
     m_dialog =
         new ThreadSafeProgressDialog(
             true,
             true,
             false) { Description = description };
 }