示例#1
0
 private void removeTracks()
 {
     Printer printer1 = new Printer(Properties.Settings.Default.SpoolerIp, "lp", username);
     foreach (ListViewItem s in this.listView1.SelectedItems)
     {
         printer1.LPRM((string)s.Tag);
         notifyIcon1.ShowBalloonTip(2000, "Removed", s.Text + " (" + s.Tag + ")", ToolTipIcon.Info);
     }
 }
示例#2
0
        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            e.Handled = true;
            if (e.KeyCode == Keys.F11)
            {
                if (fullscreen == false)
                {
                    lock (this.restore)
                    {
                        this.restore.location = this.Location;
                        this.restore.width = this.Width;
                        this.restore.height = this.Height;
                        this.restore.windowState = this.WindowState;
                        this.restore.formBorderStyle = this.FormBorderStyle;
                    }
                    this.WindowState = FormWindowState.Normal; // Hack to get a Maximized Window to fullscreen
                    this.Location = new Point(0, 0);
                    this.FormBorderStyle = FormBorderStyle.None;
                    this.Width = Screen.PrimaryScreen.Bounds.Width;
                    this.Height = Screen.PrimaryScreen.Bounds.Height;
                    this.TopMost = true;
                    fullscreen = true;
                }
                else
                {
                    this.TopMost = false;
                    lock (this.restore)
                    {
                        this.WindowState = this.restore.windowState;
                        this.FormBorderStyle = this.restore.formBorderStyle;
                        if (this.restore.windowState != FormWindowState.Maximized)
                        {
                            this.Width = this.restore.width;
                            this.Height = this.restore.height;
                            this.Location = this.restore.location;
                        }
                    }
                    fullscreen = false;
                }
            }

            if (fullscreen && e.KeyCode == Keys.Escape)
            {
                this.TopMost = false;
                lock (this.restore)
                {
                    this.WindowState = this.restore.windowState;
                    this.FormBorderStyle = this.restore.formBorderStyle;
                    if (this.restore.windowState != FormWindowState.Maximized)
                    {
                        this.Width = this.restore.width;
                        this.Height = this.restore.height;
                        this.Location = this.restore.location;
                    }
                }
                fullscreen = false;
            }

            if (e.KeyCode == Keys.Delete && listView1.SelectedItems.Count > 0)
            {
                Printer printer1 = new Printer(Properties.Settings.Default.SpoolerIp, "lp", username);
                foreach (ListViewItem s in this.listView1.SelectedItems)
                {
                    printer1.LPRM((string)s.Tag);
                    notifyIcon1.ShowBalloonTip(2000, "Removed", s.Text + " (" + s.Tag + ")", ToolTipIcon.Info);
                }
            }

            if (e.Control && e.KeyCode == Keys.S)
            {
                Properties.Settings.Default.SpoolerIp = ipTextBox.Text;
                Properties.Settings.Default.Save();
                notifyIcon1.ShowBalloonTip(2000, "Applied Settings", "Settings have been saved and applied", ToolTipIcon.Info);
            }
        }