JD2022-TU1/main/extern/ProfileEventViewer4/Program.cs

57 lines
No EOL
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Microsoft.Win32;
namespace ProfileEventViewer
{
static class Program
{
static void RegisterPel2Extension()
{
RegistryKey key = null;
string value;
// Create pel data
key = Registry.ClassesRoot.OpenSubKey(".pel2", true);
if (key == null)
key = Registry.ClassesRoot.CreateSubKey(".pel2");
key.SetValue(null, "pel2");
key = Registry.ClassesRoot.OpenSubKey("pel2\\shell\\open\\command", true);
if (key == null)
key = Registry.ClassesRoot.CreateSubKey("pel2\\shell\\open\\command");
value = "\"" + Application.ExecutablePath + "\" \"%1\"";
key.SetValue(null, value);
key = Registry.ClassesRoot.OpenSubKey("pel2\\DefaultIcon", true);
if (key == null)
key = Registry.ClassesRoot.CreateSubKey("pel2\\DefaultIcon");
value = "\"" + Application.ExecutablePath + ",1\"";
key.SetValue(null, value);
}
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] _args)
{
RegisterPel2Extension();
// When this license change, look in //assassin/ac/dev/source/tools/libraries/Ubisoft.Controls/Licensing.cs.
TD.SandDock.SandDockManager.ActivateProduct("355|kd4p9upeFMW+aY2FIKr2puVfIN0=");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (_args.GetLength(0) > 0)
{
Application.Run(new ProfileEventViewerForm(_args[0]));
}
else
{
Application.Run(new ProfileEventViewerForm());
}
}
}
}