Client/Program.cs
author StephaneLenclud
Sat, 07 Feb 2015 14:39:03 +0100
changeset 110 31e63bd07dfa
parent 31 f19b04646b6a
child 123 0df386e37e29
permissions -rw-r--r--
Cleaning up design tab by removing layout debug buttons.
Separator changes now reflected instantly.
     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 }