Exemple #1
0
        public void Start()
        {
            worker = new MediaDisplayServiceWorker(externalDisplay);
            worker.Start();

            showToolStripMenuItem        = new ToolStripMenuItem();
            showToolStripMenuItem.Name   = "showToolStripMenuItem";
            showToolStripMenuItem.Size   = new Size(103, 22);
            showToolStripMenuItem.Text   = "Show";
            showToolStripMenuItem.Click += new EventHandler(ShowToolStripMenuItem_Click);

            exitToolStripMenuItem        = new ToolStripMenuItem();
            exitToolStripMenuItem.Name   = "exitToolStripMenuItem";
            exitToolStripMenuItem.Size   = new Size(103, 22);
            exitToolStripMenuItem.Text   = "Exit";
            exitToolStripMenuItem.Click += new EventHandler(ExitToolStripMenuItem_Click);

            contextMenuStrip = new ContextMenuStrip();
            contextMenuStrip.Items.AddRange(new ToolStripItem[] {
                showToolStripMenuItem,
                exitToolStripMenuItem
            });
            contextMenuStrip.Name = "contextMenuStrip";
            contextMenuStrip.Size = new Size(104, 48);

            ComponentResourceManager resources = new ComponentResourceManager(typeof(MainForm));

            icon = new NotifyIcon();
            icon.ContextMenuStrip = contextMenuStrip;
            icon.Icon             = (Icon)resources.GetObject("$this.Icon");
            icon.Text             = "Media-Display";
            icon.Visible          = true;
        }
Exemple #2
0
 public MainForm(MediaDisplayServiceWorker worker)
 {
     InitializeComponent();
     this.worker         = worker;
     worker.Listener    += Worker_Listener;
     pictureBox1.Image   = Icon.ToBitmap();
     trb_frames.Value    = 1000 / Convert.ToInt32(worker.Refreshrate);
     lbl_frames_set.Text = Convert.ToString(1000 / Convert.ToInt32(worker.Refreshrate));
     editStatus(worker.ConnectionStatus);
     trb_display_brightness.Value    = worker.GetBrightness() / 10;
     lbl_display_brightness_set.Text = Convert.ToString(worker.GetBrightness() / 10);
 }