Пример #1
0
        private void notifyIcon1_MouseDown(object sender, MouseEventArgs e)
        {
            if (ModifierKeys == Keys.Shift)
            {
                Close();
                Application.Exit();
                return;
            }

            VolBar.UnregisterDevice();
            RenderType = ModifierKeys.HasFlag(Keys.Control) ? EDataFlow.eCapture : EDataFlow.eRender;

            if (ModifierKeys.HasFlag(Keys.Alt))
            {
                RefreshDevices(false);
                VolBar.RegisterDevice(RenderType);
                VolBar.ChangeMute();
                VolBar.UnregisterDevice();

                if (RenderType == EDataFlow.eCapture && !Program.stfu)
                {
                    var mutetxt = String.Format("Device {0}muted", VolBar.Mute ? "" : "un");
                    notifyIcon.ShowBalloonTip(0, mutetxt, EndPoints.DeviceNames[CurrentDevice], ToolTipIcon.Info);
                }

                RenderType = EDataFlow.eRender;
                RefreshDevices(false);
                VolBar.RegisterDevice(RenderType);
                return;
            }

            RefreshDevices(true);

            if (e.Button == MouseButtons.Left)
            {
                SetSizes();
            }
        }