Client/Program.cs
author StephaneLenclud
Mon, 09 Feb 2015 11:09:33 +0100
changeset 116 5fc39c560179
parent 31 f19b04646b6a
child 123 0df386e37e29
permissions -rw-r--r--
Audio tab now displaying default audio device name.
Consolidating audio management, adding comments.
sl@18
     1
using System;
sl@18
     2
using System.Collections.Generic;
sl@18
     3
using System.Linq;
sl@18
     4
using System.Threading.Tasks;
sl@18
     5
using System.Windows.Forms;
StephaneLenclud@106
     6
using System.Drawing;
sl@18
     7
sl@18
     8
namespace SharpDisplayClient
sl@18
     9
{
sl@25
    10
    static public class Program
sl@18
    11
    {
sl@18
    12
        /// <summary>
sl@18
    13
        /// The main entry point for the application.
sl@18
    14
        /// </summary>
sl@18
    15
        [STAThread]
sl@25
    16
        static public void Main()
sl@18
    17
        {
sl@27
    18
            //Set high priority to our process to avoid lags when rendering to our screen
sl@27
    19
            System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal;
sl@27
    20
sl@18
    21
            Application.EnableVisualStyles();
sl@18
    22
            Application.SetCompatibleTextRenderingDefault(false);
StephaneLenclud@106
    23
			Application.Run(new MainForm());
sl@18
    24
        }
StephaneLenclud@106
    25
StephaneLenclud@106
    26
		[STAThread]
StephaneLenclud@106
    27
		static public void MainWithParams(object aParams)
StephaneLenclud@106
    28
		{
StephaneLenclud@106
    29
			//Set high priority to our process to avoid lags when rendering to our screen
StephaneLenclud@106
    30
			System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal;
StephaneLenclud@106
    31
StephaneLenclud@106
    32
			Application.EnableVisualStyles();
StephaneLenclud@106
    33
			Application.SetCompatibleTextRenderingDefault(false);
StephaneLenclud@106
    34
			MainForm mainForm = new MainForm();
StephaneLenclud@106
    35
			mainForm.Params = (StartParams)aParams;
StephaneLenclud@106
    36
			Application.Run(mainForm);
StephaneLenclud@106
    37
		}
StephaneLenclud@106
    38
sl@18
    39
    }
StephaneLenclud@106
    40
StephaneLenclud@106
    41
	public class StartParams
StephaneLenclud@106
    42
	{
StephaneLenclud@106
    43
		public StartParams(Point aLocation, string aTopText="", string aBottomText="")
StephaneLenclud@106
    44
		{
StephaneLenclud@106
    45
			TopText = aTopText;
StephaneLenclud@106
    46
			BottomText = aBottomText;
StephaneLenclud@106
    47
			Location = aLocation;
StephaneLenclud@106
    48
		}
StephaneLenclud@106
    49
StephaneLenclud@106
    50
		public string TopText { get; set; }
StephaneLenclud@106
    51
		public string BottomText { get; set; }
StephaneLenclud@106
    52
		public Point Location { get; set; }
StephaneLenclud@106
    53
	}
sl@18
    54
}