88 lines
4.1 KiB
C#
88 lines
4.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Animation;
|
|
using C4IT_CustomerPanel.libs;
|
|
using C4IT_CustomerPanel.UserControls;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Net;
|
|
using System.Threading;
|
|
|
|
using C4IT.Security;
|
|
using System.ComponentModel;
|
|
using System.Windows.Data;
|
|
|
|
using C4IT.Logging;
|
|
using System.Reflection;
|
|
using static C4IT.Logging.cLogManager;
|
|
using System.Diagnostics;
|
|
using C4IT.Matrix42.WebClient;
|
|
|
|
namespace C4IT_CustomerPanel
|
|
{
|
|
|
|
public partial class App
|
|
{
|
|
static public Mutex AppMutex = null;
|
|
|
|
private const string PW1 = "XLaqQKKE1VVvGYzotnOWa2kpA7FwmJ+jmzZDvvXnPDRL8WPIVq1jTw8LB2ngwDaVyVzAG7q5KAl8jllGPle+MSThAfKTT27XqPSKtkRUQYvoB5AMdUQnpjKYyM+Vb8pK6fRDBNnCUnjdY2tWXXAUXarG+h9oDI+zo6v4X+5k6PFZ1Dc0/UYjoJTU1UBQciaoxfyb552qAjqNEtFvbWdkY3rhrIILx/E6+HmMHOWWXu4yuvr2otv0Icygc4PyJ8V2DBesBjGQVbtDG5ix2LXp6m4sN2omBcx9oMROtNae9jQo7KMHC2tTt1O9yZV0hWrsoHUFeZdCez7yoU10Ir8PEL0Cu2nLVymWFGQ27ot1uhiKSOZP8I5s1wZp0IDFbQ/vhfLllf4ElEaCbM61CCa3oUMg5jjxvrIbIc4kYRAQoF0rrn0CcqrB2mt18RMe0OP09tZ6Y1LsqdO9OV5oZAVoIKz3h26P3ov6I4flajFE18Vhe7KW/snZNlQnJVBcwaF0rLBsl0lmkb29EHXhzHEZEi//UnxA++DatAcyAgZJxyBgTJcac/DVxz4xA1AV4SBZTWoHgSjzawCn5VuhJmPsHB0hlYEVD+V7gSg6AofnoPKhgDGlYLAOae83anreSWVXMngzRSGOh9q5XzuBuGH5isiicb8nYNSfdVbfi2WIiHl0ins98DdJHmCgjgc4nXdZv7k6Ya10ZDJnTdgnJXVDrr4gfyE7p7O/uE6bz3gnJH5YZI/RQHMy4Q7WM29g//lkVLE7YBcbgZSL94DHNjkMAMn6DEBMOe4vZaYVnbjNTzq4oMfZTWV0yh1JAeQMa+YrIlWWmdUHlkONU9HEBzyp5Tq/adjarGoImwm7u6HZEcS8W2qwRiHCWLSJFTPbM4XCmdxnEfNGTyc7Tbbtnaxf6A17XE1YTQ4kwIpqZdDc8yzLpSFFX4I7hVcRWc2MT9QO/Ee+V4B0zAfgiFBAb8KNgCD9cP3KOW+XwLyDlIDZElC0qOKPpjqLqLRecNaot6toMVn/DisSDXFm/Fxn/D1Ff04bzhwxR4hRNVq0k1DtekvmVxJD5ygI/Y5J2YmP5rq+oFtFQD3uagTCwHPc11Thkxr5KPfIIShe3WMJrszXW8rNbtK6pZVaDrUVfp92l+2ayweFDBoF3HKbcorvHLUGD8x/YyihPLXLMPWB3vhVUKp0Q79R9RV/hB+X2Df18UAdRTYKpRUlYI8Q1r8+du7Y0EYen2BIWivVi/SElcb0xjd2ZHbAas2m8oJes4Sawgt8OUuzcBFYfccI1toVWjEnRadbkMa5f7BfQnOYSlswagoFT10I0RKKNAJZf0cPf0bF5Y/KwbqDWwxVco4GuyYdyK4jUxj1dqxUiRY8G4m7NJA6bDVmbY/2E6sqrLqRXAERtm0dT8xdw1fTAomODuVnPeLbf4evWacVVrc+yT3vTZYOuoILY2Pt+20rRi2V0RVRVZlpYyLjifiM+XKd7Fv9V2842aOnRiFju24624kU86E+vJBDyBmAV2YMMLVpUZhDv9F/yWnEU0bCG62ghJcz5woPGjAlIjV2Z8ESr+J3Gr8A7uWcCQ2I5mN422gPFliJ";
|
|
private const string PPH = "40pXkPBCeQZavJlnzX8c";
|
|
|
|
public static NetworkCredential DefaultCredentials = null;
|
|
|
|
private void Appplication_Startup(object sender, StartupEventArgs e)
|
|
{
|
|
Current.Exit += Application_Exit;
|
|
|
|
try
|
|
{
|
|
AppMutex = new Mutex(false, "CustomerPanel_72B0644F-861F-4325-B722-3C7B3F51FC2A");
|
|
if (!AppMutex.WaitOne(0))
|
|
{
|
|
Console.WriteLine("Application already started, exiting...");
|
|
Current.Shutdown();
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
Console.WriteLine("Cannot create application mutex, exiting...");
|
|
Application.Current.Shutdown();
|
|
}
|
|
#if DebugWithAttach
|
|
if (!Debugger.IsAttached)
|
|
{
|
|
Debugger.Launch();
|
|
}
|
|
#endif
|
|
cM42WebClientV2.IgnoreHttpsCertificateErrors();
|
|
cLogManagerFile.CreateInstance(false, SubFolder: "Logs");
|
|
DefaultLogger.LogEntry(LogLevels.Info, "=================================================");
|
|
DefaultLogger.LogEntry(LogLevels.Info, "Customer Panel started");
|
|
DefaultLogger.LogAssemblyInfo();
|
|
LogMethodBegin(MethodBase.GetCurrentMethod());
|
|
}
|
|
|
|
public void Application_Exit(object sender, ExitEventArgs e)
|
|
{
|
|
if (AppMutex != null)
|
|
{
|
|
try
|
|
{
|
|
AppMutex.ReleaseMutex();
|
|
}
|
|
catch { };
|
|
try
|
|
{
|
|
AppMutex.Dispose();
|
|
}
|
|
catch { }
|
|
AppMutex = null;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|