StephaneLenclud@225: //
StephaneLenclud@225: // Copyright (C) 2014-2016 Stéphane Lenclud.
StephaneLenclud@225: //
StephaneLenclud@225: // This file is part of SharpDisplayManager.
StephaneLenclud@225: //
StephaneLenclud@225: // SharpDisplayManager is free software: you can redistribute it and/or modify
StephaneLenclud@225: // it under the terms of the GNU General Public License as published by
StephaneLenclud@225: // the Free Software Foundation, either version 3 of the License, or
StephaneLenclud@225: // (at your option) any later version.
StephaneLenclud@225: //
StephaneLenclud@225: // SharpDisplayManager is distributed in the hope that it will be useful,
StephaneLenclud@225: // but WITHOUT ANY WARRANTY; without even the implied warranty of
StephaneLenclud@225: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
StephaneLenclud@225: // GNU General Public License for more details.
StephaneLenclud@225: //
StephaneLenclud@225: // You should have received a copy of the GNU General Public License
StephaneLenclud@225: // along with SharpDisplayManager. If not, see .
StephaneLenclud@225: //
StephaneLenclud@225:
StephaneLenclud@225: using System;
StephaneLenclud@225: using System.Collections.Generic;
StephaneLenclud@225: using System.Linq;
StephaneLenclud@225: using System.Threading.Tasks;
StephaneLenclud@225: using System.Windows.Forms;
StephaneLenclud@225: using System.Drawing;
StephaneLenclud@225:
StephaneLenclud@225: namespace SharpDisplayClientMessage
StephaneLenclud@225: {
StephaneLenclud@225: static public class Program
StephaneLenclud@225: {
StephaneLenclud@225: ///
StephaneLenclud@225: /// The main entry point for the application.
StephaneLenclud@225: ///
StephaneLenclud@225: [STAThread]
StephaneLenclud@225: public static void Main()
StephaneLenclud@225: {
StephaneLenclud@225: //Set high priority to our process to avoid lags when rendering to our screen
StephaneLenclud@225: //System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal;
StephaneLenclud@225:
StephaneLenclud@225: Application.EnableVisualStyles();
StephaneLenclud@225: Application.SetCompatibleTextRenderingDefault(false);
StephaneLenclud@225: Application.Run(new FormClientMessage());
StephaneLenclud@225: }
StephaneLenclud@225:
StephaneLenclud@225: [STAThread]
StephaneLenclud@225: public static void MainWithParams(object aParams)
StephaneLenclud@225: {
StephaneLenclud@225: //Set high priority to our process to avoid lags when rendering to our screen
StephaneLenclud@225: //System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal;
StephaneLenclud@225:
StephaneLenclud@225: Application.EnableVisualStyles();
StephaneLenclud@225: Application.SetCompatibleTextRenderingDefault(false);
StephaneLenclud@225: FormClientMessage form = new FormClientMessage();
StephaneLenclud@225: form.Params = (StartParams)aParams;
StephaneLenclud@225: form.WindowState = FormWindowState.Minimized;
StephaneLenclud@225: form.ShowInTaskbar = false;
StephaneLenclud@225: Application.Run(form);
StephaneLenclud@225: }
StephaneLenclud@225:
StephaneLenclud@225: }
StephaneLenclud@225:
StephaneLenclud@225: public class StartParams
StephaneLenclud@225: {
StephaneLenclud@225: public StartParams(string aPrimaryText, string aSecondaryText ="", int aDurationInMs = 5000, uint aClientPriority = SharpLib.Display.Priorities.Foreground)
StephaneLenclud@225: {
StephaneLenclud@225: PrimaryText = aPrimaryText;
StephaneLenclud@225: SecondaryText = aSecondaryText;
StephaneLenclud@225: Priority = aClientPriority;
StephaneLenclud@225: DurationInMs = aDurationInMs;
StephaneLenclud@225: }
StephaneLenclud@225:
StephaneLenclud@225: public string PrimaryText { get; set; }
StephaneLenclud@225: public string SecondaryText { get; set; }
StephaneLenclud@225: public uint Priority { get; set; }
StephaneLenclud@225: public int DurationInMs { get; set; }
StephaneLenclud@225: }
StephaneLenclud@225: }