Ejemplo n.º 1
0
        public ViewManager(RegClientInfor clientInfor)
        {
            _clientInfor = clientInfor;
            _components  = new System.ComponentModel.Container();
            _notifyIcon  = new System.Windows.Forms.NotifyIcon(_components)
            {
                ContextMenuStrip = new ContextMenuStrip(),
                Icon             = FileTracking.Client.Application.Properties.Resources.NotReadyIcon,
                Text             = "File Tracking",
                Visible          = true,
            };


            _notifyIcon.ContextMenuStrip.Opening += ContextMenuStrip_Opening;
            _notifyIcon.DoubleClick += notifyIcon_DoubleClick;
            _notifyIcon.MouseUp     += notifyIcon_MouseUp;

            _hiddenWindow = new System.Windows.Window();
            _hiddenWindow.Hide();

            _frmLog             = new frmLogging();
            _frmLog.LoggingText = "";

            InitConnect();
            checkWebSocketTimer          = new System.Timers.Timer();
            checkWebSocketTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            checkWebSocketTimer.Interval = 60000;
            checkWebSocketTimer.Enabled  = true;
        }
Ejemplo n.º 2
0
 private void btLogging_Click(object sender, EventArgs e)
 {
     using (frmLogging form = new frmLogging())
     {
         form.ShowDialog();
     }
 }
Ejemplo n.º 3
0
 private void ShowLogFrom_Click(object sender, EventArgs e)
 {
     if ((_frmLog == null) || (!_frmLog.Visible))
     {
         _frmLog = new frmLogging();
         _frmLog.Show();
     }
 }
Ejemplo n.º 4
0
 private void LogMessage(string message)
 {
     if (_frmLog == null)
     {
         _frmLog = new frmLogging();
     }
     _frmLog.LoggingText = message;
 }
Ejemplo n.º 5
0
        private IDockContent GetContentFromPersistString(string persistString)
        {
            if (persistString == typeof(frmLogging).ToString())
            {
                loggingForm = new frmLogging();
                Log("Loading Logging Window");
                loggingToolStripMenuItem.Checked = true;
                return(loggingForm);
            }

            return(null);
        }
Ejemplo n.º 6
0
        private void loggingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (loggingToolStripMenuItem.Checked)
            {
                loggingForm.Close();
                loggingForm = null;
            }
            else
            {
                if (loggingForm == null)
                {
                    loggingForm = new frmLogging();
                    loggingForm.Show(dockPanel, DockState.DockBottom);
                    Log("Loading Logging Window");
                }
            }

            loggingToolStripMenuItem.Checked = !loggingToolStripMenuItem.Checked; // Toggle the check state
        }