author | StephaneLenclud |
Sun, 24 Jul 2016 20:36:07 +0200 | |
changeset 214 | 4961ede27e0a |
parent 190 | 60977f2b3ca7 |
permissions | -rw-r--r-- |
StephaneLenclud@123 | 1 |
// |
StephaneLenclud@123 | 2 |
// Copyright (C) 2014-2015 Stéphane Lenclud. |
StephaneLenclud@123 | 3 |
// |
StephaneLenclud@123 | 4 |
// This file is part of SharpDisplayManager. |
StephaneLenclud@123 | 5 |
// |
StephaneLenclud@123 | 6 |
// SharpDisplayManager is free software: you can redistribute it and/or modify |
StephaneLenclud@123 | 7 |
// it under the terms of the GNU General Public License as published by |
StephaneLenclud@123 | 8 |
// the Free Software Foundation, either version 3 of the License, or |
StephaneLenclud@123 | 9 |
// (at your option) any later version. |
StephaneLenclud@123 | 10 |
// |
StephaneLenclud@123 | 11 |
// SharpDisplayManager is distributed in the hope that it will be useful, |
StephaneLenclud@123 | 12 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
StephaneLenclud@123 | 13 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
StephaneLenclud@123 | 14 |
// GNU General Public License for more details. |
StephaneLenclud@123 | 15 |
// |
StephaneLenclud@123 | 16 |
// You should have received a copy of the GNU General Public License |
StephaneLenclud@123 | 17 |
// along with SharpDisplayManager. If not, see <http://www.gnu.org/licenses/>. |
StephaneLenclud@123 | 18 |
// |
StephaneLenclud@123 | 19 |
|
StephaneLenclud@123 | 20 |
using System; |
sl@18 | 21 |
using System.Collections.Generic; |
sl@18 | 22 |
using System.Linq; |
sl@18 | 23 |
using System.Threading.Tasks; |
sl@18 | 24 |
using System.Windows.Forms; |
StephaneLenclud@106 | 25 |
using System.Drawing; |
sl@18 | 26 |
|
sl@18 | 27 |
namespace SharpDisplayClient |
sl@18 | 28 |
{ |
sl@25 | 29 |
static public class Program |
sl@18 | 30 |
{ |
sl@18 | 31 |
/// <summary> |
sl@18 | 32 |
/// The main entry point for the application. |
sl@18 | 33 |
/// </summary> |
sl@18 | 34 |
[STAThread] |
sl@25 | 35 |
static public void Main() |
sl@18 | 36 |
{ |
sl@27 | 37 |
//Set high priority to our process to avoid lags when rendering to our screen |
sl@27 | 38 |
System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal; |
sl@27 | 39 |
|
sl@18 | 40 |
Application.EnableVisualStyles(); |
sl@18 | 41 |
Application.SetCompatibleTextRenderingDefault(false); |
StephaneLenclud@191 | 42 |
Application.Run(new FormClientTest()); |
sl@18 | 43 |
} |
StephaneLenclud@106 | 44 |
|
StephaneLenclud@106 | 45 |
[STAThread] |
StephaneLenclud@106 | 46 |
static public void MainWithParams(object aParams) |
StephaneLenclud@106 | 47 |
{ |
StephaneLenclud@106 | 48 |
//Set high priority to our process to avoid lags when rendering to our screen |
StephaneLenclud@106 | 49 |
System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal; |
StephaneLenclud@106 | 50 |
|
StephaneLenclud@106 | 51 |
Application.EnableVisualStyles(); |
StephaneLenclud@106 | 52 |
Application.SetCompatibleTextRenderingDefault(false); |
StephaneLenclud@191 | 53 |
FormClientTest mainForm = new FormClientTest(); |
StephaneLenclud@106 | 54 |
mainForm.Params = (StartParams)aParams; |
StephaneLenclud@106 | 55 |
Application.Run(mainForm); |
StephaneLenclud@106 | 56 |
} |
StephaneLenclud@106 | 57 |
|
sl@18 | 58 |
} |
StephaneLenclud@106 | 59 |
|
StephaneLenclud@106 | 60 |
public class StartParams |
StephaneLenclud@106 | 61 |
{ |
StephaneLenclud@106 | 62 |
public StartParams(Point aLocation, string aTopText="", string aBottomText="") |
StephaneLenclud@106 | 63 |
{ |
StephaneLenclud@106 | 64 |
TopText = aTopText; |
StephaneLenclud@106 | 65 |
BottomText = aBottomText; |
StephaneLenclud@106 | 66 |
Location = aLocation; |
StephaneLenclud@106 | 67 |
} |
StephaneLenclud@106 | 68 |
|
StephaneLenclud@106 | 69 |
public string TopText { get; set; } |
StephaneLenclud@106 | 70 |
public string BottomText { get; set; } |
StephaneLenclud@106 | 71 |
public Point Location { get; set; } |
StephaneLenclud@106 | 72 |
} |
sl@18 | 73 |
} |