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