Example #1
0
 private void FormSwitcher_FormClosing(object sender, FormClosingEventArgs e)
 {
     GlobalHotkeys.UnregisterAll();
     Program.settings.FreePosLeft = Left;
     Program.settings.FreePosTop  = Top;
     Program.settings.Save();
 }
        public SystrayDispatcher()
        {
            InitializeComponent();

            _hotkeys = new GlobalHotkeys(this);
            _hotkeys.RegisterGlobalHotkey(Keys.NumPad0, ModifierKeys.Alt,
                (() => new JournalEntry().Show()));
        }
Example #3
0
 public Startup(ThemeService themeService, WindowManager windowManager, TerminalHandler terminalHandler,
                GlobalHotkeys globalHotkeys, IConfig config, UpdateChecker updateChecker)
 {
     _themeService    = themeService;
     _windowManager   = windowManager;
     _terminalHandler = terminalHandler;
     _globalHotkeys   = globalHotkeys;
     _config          = config;
     _updateChecker   = updateChecker;
 }
Example #4
0
        public FormSwitcher()
        {
            InitializeComponent();
            ledLeft.OldStyle = Program.settings.ColorVU;
            ledLeft.SetValue((float)0.1);
            ledRight.OldStyle = Program.settings.ColorVU;
            ledRight.SetValue((float)0.1);

            SetWindowTheme(listDevices.Handle, "explorer", null);

            using (var gr = CreateGraphics())
                DpiFactor = gr.DpiX / 96;
            var tile = new Size(listDevices.ClientSize.Width + 2, (int)(listDevices.TileSize.Height * DpiFactor));

            DeviceIcons.InitImageLists(DpiFactor);

            listDevices.TileSize       = tile;
            listDevices.Scroll        += VolBar.DoScroll;
            listDevices.LargeImageList = DeviceIcons.ActiveIcons;

            if (DpiFactor <= 1)
            {
                DefaultTrayIcons.Add(getIcon(Resources.mute));
                DefaultTrayIcons.Add(getIcon(Resources.zero));
                DefaultTrayIcons.Add(getIcon(Resources._1_33));
                DefaultTrayIcons.Add(getIcon(Resources._33_66));
                DefaultTrayIcons.Add(getIcon(Resources._66_100));
            }
            else
            {
                DefaultTrayIcons.Add(getIcon(Resources.mute_highDPI));
                DefaultTrayIcons.Add(getIcon(Resources.zero_highDPI));
                DefaultTrayIcons.Add(getIcon(Resources._1_33_highDPI));
                DefaultTrayIcons.Add(getIcon(Resources._33_66_highDPI));
                DefaultTrayIcons.Add(getIcon(Resources._66_100_highDPI));
            }

            RenderType = Program.settings.DefaultDataFlow;
            RefreshDevices(RenderType);
            SetTrayIcons();

            VolBar.VolumeMuteChanged += IconChanged;
            VolBar.RegisterDevice(RenderType);
            EndPoints.NotifyClient.DefaultChanged += DefaultChanged;
            EndPoints.NotifyClient.DeviceAdded    += DeviceAdded;
            EndPoints.NotifyClient.DeviceRemoved  += DeviceRemoved;

            GlobalHotkeys.Handle = Handle;
            GlobalHotkeys.RegisterAll();

            ScrollVolume.VolumeScroll += ScrollTheVolume;
            ScrollVolume.RegisterVolScroll(Program.settings.VolumeScroll.Enabled);
        }
Example #5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.webBrowser1.Navigate(HomeUrl);
            lsProducts = new List <ProductItem>();
            //this.dateTimePicker1.Value = DateTime.Now.AddYears(-1);
            //this.dateTimePicker2.Value = DateTime.Now.AddYears(1);

            //this.dateTimePickerModifyB.Value = this.dateTimePicker1.Value;
            //this.dateTimePickerModifyF.Value = this.dateTimePicker2.Value;
            DateTime dtInit = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));

            this.dateTimePickerModifyB.Value = dtInit;
            this.dateTimePickerModifyF.Value = dtInit;
            this.dateTimePickerQueryB.Value  = dtInit;
            this.dateTimePickerQueryE.Value  = dtInit;
            this.dateTimePickerAddB.Value    = dtInit;
            this.dateTimePickerAddF.Value    = dtInit;


            this.backgroundWorker1.DoWork             += backgroundWorker1_DoWork;
            this.backgroundWorker1.RunWorkerCompleted += backgroundWorker1_RunWorkerCompleted;
            this.backgroundWorker1.ProgressChanged    += backgroundWorker1_ProgressChanged;

            appconifg.ReadConfig(configFileName);
            if (string.IsNullOrEmpty(appconifg.ReadConfig(configFileName)))
            {
                this.textBoxDbServer.Text         = appconifg.ServerAdd;
                this.textBoxDbPort.Text           = appconifg.ServerPort;
                this.textBoxDbUser.Text           = appconifg.UserID;
                this.textBoxDbPass.Text           = appconifg.Password;
                this.textBoxDbName.Text           = appconifg.DataBase;
                this.textBoxProductTableName.Text = appconifg.ProductTableName;
            }

            dt = new DataTable();
            for (int i = 0; i < captionProductGrid.Length; i++)
            {
                //DataColumn col=dt.Columns.Add(captionProductGrid[i]);
                DataColumn col = dt.Columns.Add(colNameProductGrid[i]);
            }

            hotkey = new GlobalHotkeys();
            hotkey.RegisterGlobalHotKey((int)Keys.F1, 0, this.Handle);

            UpdateTreeNode(string.Empty);
        }
Example #6
0
        public frmSuperPutty(string[] args)
        {
            this.children  = new ConcurrentDictionary <IntPtr, bool>();
            m_panelMapping = new ConcurrentDictionary <IntPtr, ctlPuttyPanel>();
            m_hotkeys      = new GlobalHotkeys();
            m_keyboard     = new KeyboardListener(this, m_hotkeys);
            m_titleTracker = new WindowTitleTracker(this);
            //m_outputDetector = new MinttyOutputDetector(this, m_outputMapping);
            registerHotkeys();

            // Check SQLite Database
            openOrCreateSQLiteDatabase();
            this.AddChild(this.Handle);

            #region Exe Paths
            // Get putty executable path
            if (File.Exists(this.m_db.GetKey("putty_exe")))
            {
                PuttyExe = this.m_db.GetKey("putty_exe");
            }

            // Get pscp executable path
            if (File.Exists(this.m_db.GetKey("pscp_exe")))
            {
                PscpExe = this.m_db.GetKey("pscp_exe");
            }

            // Get mintty executable path
            if (File.Exists(this.m_db.GetKey("mintty_exe")))
            {
                MinttyExe = this.m_db.GetKey("mintty_exe");
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                editLocations();
            }

            if (String.IsNullOrEmpty(PuttyExe))
            {
                MessageBox.Show("Cannot find PuTTY installation. Please visit http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to download a copy",
                                "PuTTY Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                System.Environment.Exit(1);
            }
            #endregion

            InitializeComponent();

#if DEBUG
            menuStrip1.BackColor = Color.Pink;
            // Only show the option for the debug log viewer when we're compiled with DEBUG defined.
            debugLogToolStripMenuItem.Visible = true;
#endif

            //Activate PasswordChar for passwordfield in connectbar
            PasswordTextBox.TextBox.UseSystemPasswordChar = true;

            //Select protocol SSH
            ProtocolBox.SelectedItem = ProtocolBox.Items[0];

            dockPanel1.ActiveDocumentChanged += dockPanel1_ActiveDocumentChanged;
            dockPanel1.LostFocus             += dockPanel1_ActiveDocumentChanged;

            /*
             * Open the session treeview and dock it on the right
             */
            m_Sessions = new SessionTreeview(this, dockPanel1);
            if (Classes.Database.GetBooleanKey("ShowSessionTreeview", true))
            {
                ShowSessionTreeview();
            }

            if (!Classes.Database.GetBooleanKey("ShowQuickConnectBar", true))
            {
                this.ConnectToolStrip.Hide();
                this.quickConnectToolStripMenuItem.Checked = false;
            }

            if (!Classes.Database.GetBooleanKey("ShowTopMenu", true))
            {
                this.menuStrip1.Hide();
            }

            /*
             * Parsing CL Arguments
             */
            ParseClArguments(args);

            // First time automatic update check
            firstTimeAutomaticUpdateCheck();

            // Set automatic update check menu item
            setAutomaticUpdateCheckMenuItem();

            // Set addtional timing menu item
            setAdditionalTimingMenuItem();

            // Check for updates.
            checkForUpdate(true);

            // Set window state and size
            setWindowStateAndSize();


            focusHacks();
        }
Example #7
0
        public FormSwitcher()
        {
            InitializeComponent();

            IsWin10 = Environment.OSVersion.Version.Major == 10;
            if (IsWin10)
            {
                FormBorderStyle = FormBorderStyle.FixedToolWindow;
            }
            SetWindowTheme(listDevices.Handle, "explorer", null);

            ledLeft.OldStyle = Program.settings.ColorVU;
            ledLeft.SetValue((float)0.1);
            ledRight.OldStyle = Program.settings.ColorVU;
            ledRight.SetValue((float)0.1);

            DpiFactor = getScalingFactor();
            var tile = new Size(listDevices.ClientSize.Width + 2, (int)(listDevices.TileSize.Height * DpiFactor));

            DeviceIcons.InitImageLists(DpiFactor);

            listDevices.TileSize       = tile;
            listDevices.Scroll        += VolBar.DoScroll;
            ledLeft.DoScroll          += VolBar.DoScroll;
            ledRight.DoScroll         += VolBar.DoScroll;
            listDevices.LargeImageList = DeviceIcons.ActiveIcons;

            if (DpiFactor <= 1)
            {
                DefaultTrayIcons.Add(getIcon(Resources.mute));
                DefaultTrayIcons.Add(getIcon(Resources.zero));
                DefaultTrayIcons.Add(getIcon(Resources._1_33));
                DefaultTrayIcons.Add(getIcon(Resources._33_66));
                DefaultTrayIcons.Add(getIcon(Resources._66_100));
            }
            else
            {
                DefaultTrayIcons.Add(getIcon(Resources.mute_highDPI));
                DefaultTrayIcons.Add(getIcon(Resources.zero_highDPI));
                DefaultTrayIcons.Add(getIcon(Resources._1_33_highDPI));
                DefaultTrayIcons.Add(getIcon(Resources._33_66_highDPI));
                DefaultTrayIcons.Add(getIcon(Resources._66_100_highDPI));
            }

            RenderType = Program.settings.DefaultDataFlow;
            RefreshDevices(RenderType);
            SetTrayIcons();

            VolBar.VolumeMuteChanged += IconChanged;
            VolBar.RegisterDevice(RenderType);

            EndPoints.NotifyClient.DefaultChanged += DefaultChanged;
            EndPoints.NotifyClient.DeviceAdded    += DeviceAdded;
            EndPoints.NotifyClient.DeviceRemoved  += DeviceRemoved;

            GlobalHotkeys.Handle = Handle;
            GlobalHotkeys.RegisterAll();

            ScrollVolume.VolumeScroll += ScrollTheVolume;
            ScrollVolume.RegisterVolScroll(Program.settings.VolumeScroll.Enabled);

            if (Program.settings.AlwaysVisible)
            {
                OpenAlwaysVisible();
            }
        }
Example #8
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.webBrowser1.Navigate(HomeUrl);
            lsProducts = new List<ProductItem>();
            //this.dateTimePicker1.Value = DateTime.Now.AddYears(-1);
            //this.dateTimePicker2.Value = DateTime.Now.AddYears(1);

            //this.dateTimePickerModifyB.Value = this.dateTimePicker1.Value;
            //this.dateTimePickerModifyF.Value = this.dateTimePicker2.Value;
            DateTime dtInit = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
            this.dateTimePickerModifyB.Value = dtInit;
            this.dateTimePickerModifyF.Value = dtInit;
            this.dateTimePickerQueryB.Value = dtInit;
            this.dateTimePickerQueryE.Value = dtInit;
            this.dateTimePickerAddB.Value = dtInit;
            this.dateTimePickerAddF.Value = dtInit;

            this.backgroundWorker1.DoWork += backgroundWorker1_DoWork;
            this.backgroundWorker1.RunWorkerCompleted += backgroundWorker1_RunWorkerCompleted;
            this.backgroundWorker1.ProgressChanged += backgroundWorker1_ProgressChanged;

            appconifg.ReadConfig(configFileName);
            if (string.IsNullOrEmpty(appconifg.ReadConfig(configFileName)))
            {
                this.textBoxDbServer.Text = appconifg.ServerAdd;
                this.textBoxDbPort.Text = appconifg.ServerPort;
                this.textBoxDbUser.Text = appconifg.UserID;
                this.textBoxDbPass.Text = appconifg.Password;
                this.textBoxDbName.Text = appconifg.DataBase;
                this.textBoxProductTableName.Text = appconifg.ProductTableName;
            }

            dt = new DataTable();
            for (int i = 0; i < captionProductGrid.Length; i++)
            {
                //DataColumn col=dt.Columns.Add(captionProductGrid[i]);
                DataColumn col = dt.Columns.Add(colNameProductGrid[i]);
            }

            hotkey = new GlobalHotkeys();
            hotkey.RegisterGlobalHotKey((int)Keys.F1, 0,this.Handle);

            UpdateTreeNode(string.Empty);
        }