removal of TaskDialog usage...
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using static mpvnet.Core;
|
||||
using static Native;
|
||||
using static TaskDialog.Msg;
|
||||
using static mpvnet.Native;
|
||||
using static mpvnet.Global;
|
||||
|
||||
namespace mpvnet
|
||||
{
|
||||
@@ -35,51 +34,45 @@ namespace mpvnet
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetColors();
|
||||
|
||||
try
|
||||
{
|
||||
object recent = RegistryHelp.GetValue(App.RegPath, "Recent");
|
||||
|
||||
if (recent is string[] r)
|
||||
RecentFiles = new List<string>(r);
|
||||
else
|
||||
RecentFiles = new List<string>();
|
||||
object recent = RegistryHelp.GetValue("recent");
|
||||
RecentFiles = recent is string[] r ? new List<string>(r) : new List<string>();
|
||||
|
||||
Instance = this;
|
||||
Hwnd = Handle;
|
||||
ConsoleHelp.Padding = 60;
|
||||
core.Init();
|
||||
Core.Init();
|
||||
|
||||
core.Shutdown += Shutdown;
|
||||
core.VideoSizeChanged += VideoSizeChanged;
|
||||
core.ScaleWindow += ScaleWindow;
|
||||
core.WindowScale += WindowScale;
|
||||
core.FileLoaded += FileLoaded;
|
||||
core.Idle += Idle;
|
||||
core.Seek += () => UpdateProgressBar();
|
||||
Core.Shutdown += Shutdown;
|
||||
Core.VideoSizeChanged += VideoSizeChanged;
|
||||
Core.ScaleWindow += ScaleWindow;
|
||||
Core.WindowScale += WindowScale;
|
||||
Core.FileLoaded += FileLoaded;
|
||||
Core.Idle += Idle;
|
||||
Core.Seek += () => UpdateProgressBar();
|
||||
|
||||
core.observe_property("window-maximized", PropChangeWindowMaximized);
|
||||
core.observe_property("window-minimized", PropChangeWindowMinimized);
|
||||
core.observe_property_bool("pause", PropChangePause);
|
||||
core.observe_property_bool("fullscreen", PropChangeFullscreen);
|
||||
core.observe_property_bool("ontop", PropChangeOnTop);
|
||||
core.observe_property_bool("border", PropChangeBorder);
|
||||
Core.observe_property("window-maximized", PropChangeWindowMaximized);
|
||||
Core.observe_property("window-minimized", PropChangeWindowMinimized);
|
||||
Core.observe_property_bool("pause", PropChangePause);
|
||||
Core.observe_property_bool("fullscreen", PropChangeFullscreen);
|
||||
Core.observe_property_bool("ontop", PropChangeOnTop);
|
||||
Core.observe_property_bool("border", PropChangeBorder);
|
||||
|
||||
core.observe_property_string("sid", PropChangeSid);
|
||||
core.observe_property_string("aid", PropChangeAid);
|
||||
core.observe_property_string("vid", PropChangeVid);
|
||||
Core.observe_property_string("sid", PropChangeSid);
|
||||
Core.observe_property_string("aid", PropChangeAid);
|
||||
Core.observe_property_string("vid", PropChangeVid);
|
||||
|
||||
core.observe_property_string("title", PropChangeTitle);
|
||||
Core.observe_property_string("title", PropChangeTitle);
|
||||
|
||||
core.observe_property_int("edition", PropChangeEdition);
|
||||
Core.observe_property_int("edition", PropChangeEdition);
|
||||
|
||||
if (core.GPUAPI != "vulkan")
|
||||
core.ProcessCommandLine(false);
|
||||
if (Core.GPUAPI != "vulkan")
|
||||
Core.ProcessCommandLine(false);
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += (sender, e) => App.ShowException(e.ExceptionObject);
|
||||
Application.ThreadException += (sender, e) => App.ShowException(e.Exception);
|
||||
|
||||
Msg.SupportURL = "https://github.com/stax76/mpv.net#support";
|
||||
|
||||
TaskbarButtonCreatedMessage = RegisterWindowMessage("TaskbarButtonCreated");
|
||||
|
||||
@@ -87,9 +80,9 @@ namespace mpvnet
|
||||
ContextMenu.Opened += ContextMenu_Opened;
|
||||
ContextMenu.Opening += ContextMenu_Opening;
|
||||
|
||||
if (core.Screen > -1)
|
||||
if (Core.Screen > -1)
|
||||
{
|
||||
int targetIndex = core.Screen;
|
||||
int targetIndex = Core.Screen;
|
||||
Screen[] screens = Screen.AllScreens;
|
||||
|
||||
if (targetIndex < 0)
|
||||
@@ -104,19 +97,19 @@ namespace mpvnet
|
||||
Top = target.Y + (target.Height - Height) / 2;
|
||||
}
|
||||
|
||||
if (!core.Border)
|
||||
if (!Core.Border)
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
|
||||
int posX = RegistryHelp.GetInt("PosX");
|
||||
int posY = RegistryHelp.GetInt("PosY");
|
||||
int posX = RegistryHelp.GetInt("position-x");
|
||||
int posY = RegistryHelp.GetInt("position-y");
|
||||
|
||||
if ((posX != 0 || posY != 0) && App.RememberPosition)
|
||||
{
|
||||
Left = posX - Width / 2;
|
||||
Top = posY - Height / 2;
|
||||
|
||||
int horizontal = RegistryHelp.GetInt("HorizontalLocation");
|
||||
int vertical = RegistryHelp.GetInt("VerticalLocation");
|
||||
int horizontal = RegistryHelp.GetInt("location-horizontal");
|
||||
int vertical = RegistryHelp.GetInt("location-vertical");
|
||||
|
||||
if (horizontal == -1) Left = posX;
|
||||
if (horizontal == 1) Left = posX - Width;
|
||||
@@ -124,13 +117,13 @@ namespace mpvnet
|
||||
if (vertical == 1) Top = posY - Height;
|
||||
}
|
||||
|
||||
if (core.WindowMaximized)
|
||||
if (Core.WindowMaximized)
|
||||
{
|
||||
SetFormPosAndSize(true);
|
||||
WindowState = FormWindowState.Maximized;
|
||||
}
|
||||
|
||||
if (core.WindowMinimized)
|
||||
if (Core.WindowMinimized)
|
||||
{
|
||||
SetFormPosAndSize(true);
|
||||
WindowState = FormWindowState.Minimized;
|
||||
@@ -145,7 +138,7 @@ namespace mpvnet
|
||||
void ScaleWindow(float scale) {
|
||||
BeginInvoke(new Action(() => {
|
||||
int w = (int)(ClientSize.Width * scale);
|
||||
int h = (int)Math.Ceiling(w * core.VideoSize.Height / (double)core.VideoSize.Width);
|
||||
int h = (int)Math.Ceiling(w * Core.VideoSize.Height / (double)Core.VideoSize.Width);
|
||||
SetSize(w, h, Screen.FromControl(this), false);
|
||||
}));
|
||||
}
|
||||
@@ -154,10 +147,10 @@ namespace mpvnet
|
||||
{
|
||||
BeginInvoke(new Action(() => {
|
||||
SetSize(
|
||||
(int)(core.VideoSize.Width * scale),
|
||||
(int)Math.Ceiling(core.VideoSize.Height * scale),
|
||||
(int)(Core.VideoSize.Width * scale),
|
||||
(int)Math.Ceiling(Core.VideoSize.Height * scale),
|
||||
Screen.FromControl(this), false);
|
||||
core.command($"show-text \"window-scale {scale.ToString(CultureInfo.InvariantCulture)}\"");
|
||||
Core.command($"show-text \"window-scale {scale.ToString(CultureInfo.InvariantCulture)}\"");
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -192,7 +185,7 @@ namespace mpvnet
|
||||
|
||||
void ContextMenu_Opening(object sender, CancelEventArgs e)
|
||||
{
|
||||
lock (core.MediaTracks)
|
||||
lock (Core.MediaTracks)
|
||||
{
|
||||
MenuItem trackMenuItem = FindMenuItem("Track");
|
||||
|
||||
@@ -200,16 +193,16 @@ namespace mpvnet
|
||||
{
|
||||
trackMenuItem.DropDownItems.Clear();
|
||||
|
||||
MediaTrack[] audTracks = core.MediaTracks.Where(track => track.Type == "a").ToArray();
|
||||
MediaTrack[] subTracks = core.MediaTracks.Where(track => track.Type == "s").ToArray();
|
||||
MediaTrack[] vidTracks = core.MediaTracks.Where(track => track.Type == "v").ToArray();
|
||||
MediaTrack[] ediTracks = core.MediaTracks.Where(track => track.Type == "e").ToArray();
|
||||
MediaTrack[] audTracks = Core.MediaTracks.Where(track => track.Type == "a").ToArray();
|
||||
MediaTrack[] subTracks = Core.MediaTracks.Where(track => track.Type == "s").ToArray();
|
||||
MediaTrack[] vidTracks = Core.MediaTracks.Where(track => track.Type == "v").ToArray();
|
||||
MediaTrack[] ediTracks = Core.MediaTracks.Where(track => track.Type == "e").ToArray();
|
||||
|
||||
foreach (MediaTrack track in vidTracks)
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => core.commandv("set", "vid", track.ID.ToString());
|
||||
mi.Checked = core.Vid == track.ID.ToString();
|
||||
mi.Action = () => Core.commandv("set", "vid", track.ID.ToString());
|
||||
mi.Checked = Core.Vid == track.ID.ToString();
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
|
||||
@@ -219,8 +212,8 @@ namespace mpvnet
|
||||
foreach (MediaTrack track in audTracks)
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => core.commandv("set", "aid", track.ID.ToString());
|
||||
mi.Checked = core.Aid == track.ID.ToString();
|
||||
mi.Action = () => Core.commandv("set", "aid", track.ID.ToString());
|
||||
mi.Checked = Core.Aid == track.ID.ToString();
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
|
||||
@@ -230,16 +223,16 @@ namespace mpvnet
|
||||
foreach (MediaTrack track in subTracks)
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => core.commandv("set", "sid", track.ID.ToString());
|
||||
mi.Checked = core.Sid == track.ID.ToString();
|
||||
mi.Action = () => Core.commandv("set", "sid", track.ID.ToString());
|
||||
mi.Checked = Core.Sid == track.ID.ToString();
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
|
||||
if (subTracks.Length > 0)
|
||||
{
|
||||
MenuItem mi = new MenuItem("S: No subtitles");
|
||||
mi.Action = () => core.commandv("set", "sid", "no");
|
||||
mi.Checked = core.Sid == "no";
|
||||
mi.Action = () => Core.commandv("set", "sid", "no");
|
||||
mi.Checked = Core.Sid == "no";
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
|
||||
@@ -249,14 +242,14 @@ namespace mpvnet
|
||||
foreach (MediaTrack track in ediTracks)
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => core.commandv("set", "edition", track.ID.ToString());
|
||||
mi.Checked = core.Edition == track.ID;
|
||||
mi.Action = () => Core.commandv("set", "edition", track.ID.ToString());
|
||||
mi.Checked = Core.Edition == track.ID;
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lock (core.Chapters)
|
||||
lock (Core.Chapters)
|
||||
{
|
||||
MenuItem chaptersMenuItem = FindMenuItem("Chapters");
|
||||
|
||||
@@ -264,11 +257,11 @@ namespace mpvnet
|
||||
{
|
||||
chaptersMenuItem.DropDownItems.Clear();
|
||||
|
||||
foreach (var pair in core.Chapters)
|
||||
foreach (var pair in Core.Chapters)
|
||||
{
|
||||
MenuItem mi = new MenuItem(pair.Key);
|
||||
mi.ShortcutKeyDisplayString = TimeSpan.FromSeconds(pair.Value).ToString().Substring(0, 8) + " ";
|
||||
mi.Action = () => core.commandv("seek", pair.Value.ToString(CultureInfo.InvariantCulture), "absolute");
|
||||
mi.Action = () => Core.commandv("seek", pair.Value.ToString(CultureInfo.InvariantCulture), "absolute");
|
||||
chaptersMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
}
|
||||
@@ -281,7 +274,7 @@ namespace mpvnet
|
||||
recent.DropDownItems.Clear();
|
||||
|
||||
foreach (string path in RecentFiles)
|
||||
MenuItem.Add(recent.DropDownItems, path, () => core.LoadFiles(new[] { path }, true, Control.ModifierKeys.HasFlag(Keys.Control)));
|
||||
MenuItem.Add(recent.DropDownItems, path, () => Core.LoadFiles(new[] { path }, true, Control.ModifierKeys.HasFlag(Keys.Control)));
|
||||
|
||||
recent.DropDownItems.Add(new ToolStripSeparator());
|
||||
MenuItem mi = new MenuItem("Clear List");
|
||||
@@ -295,12 +288,12 @@ namespace mpvnet
|
||||
{
|
||||
titles.DropDownItems.Clear();
|
||||
|
||||
lock (core.BluRayTitles)
|
||||
lock (Core.BluRayTitles)
|
||||
{
|
||||
List<(int Index, TimeSpan Len)> items = new List<(int Index, TimeSpan Len)>();
|
||||
|
||||
for (int i = 0; i < core.BluRayTitles.Count; i++)
|
||||
items.Add((i, core.BluRayTitles[i]));
|
||||
for (int i = 0; i < Core.BluRayTitles.Count; i++)
|
||||
items.Add((i, Core.BluRayTitles[i]));
|
||||
|
||||
var titleItems = items.OrderByDescending(item => item.Len)
|
||||
.Take(20).OrderBy(item => item.Index);
|
||||
@@ -308,7 +301,7 @@ namespace mpvnet
|
||||
foreach (var item in titleItems)
|
||||
if (item.Len != TimeSpan.Zero)
|
||||
MenuItem.Add(titles.DropDownItems, $"{item.Len} ({item.Index})",
|
||||
() => core.SetBluRayTitle(item.Index));
|
||||
() => Core.SetBluRayTitle(item.Index));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,7 +334,7 @@ namespace mpvnet
|
||||
if (WindowState != FormWindowState.Normal)
|
||||
return;
|
||||
|
||||
if (core.Fullscreen)
|
||||
if (Core.Fullscreen)
|
||||
{
|
||||
CycleFullscreen(true);
|
||||
return;
|
||||
@@ -349,14 +342,14 @@ namespace mpvnet
|
||||
}
|
||||
|
||||
Screen screen = Screen.FromControl(this);
|
||||
int autoFitHeight = Convert.ToInt32(screen.WorkingArea.Height * core.Autofit);
|
||||
int autoFitHeight = Convert.ToInt32(screen.WorkingArea.Height * Core.Autofit);
|
||||
|
||||
if (core.VideoSize.Height == 0 || core.VideoSize.Width == 0 ||
|
||||
core.VideoSize.Width / (float)core.VideoSize.Height < App.MinimumAspectRatio)
|
||||
if (Core.VideoSize.Height == 0 || Core.VideoSize.Width == 0 ||
|
||||
Core.VideoSize.Width / (float)Core.VideoSize.Height < App.MinimumAspectRatio)
|
||||
|
||||
core.VideoSize = new Size((int)(autoFitHeight * (16 / 9f)), autoFitHeight);
|
||||
Core.VideoSize = new Size((int)(autoFitHeight * (16 / 9f)), autoFitHeight);
|
||||
|
||||
Size videoSize = core.VideoSize;
|
||||
Size videoSize = Core.VideoSize;
|
||||
|
||||
int height = videoSize.Height;
|
||||
int width = videoSize.Width;
|
||||
@@ -364,7 +357,7 @@ namespace mpvnet
|
||||
if (App.StartSize == "previous")
|
||||
App.StartSize = "height-session";
|
||||
|
||||
if (core.WasInitialSizeSet)
|
||||
if (Core.WasInitialSizeSet)
|
||||
{
|
||||
if (App.StartSize == "always")
|
||||
{
|
||||
@@ -384,8 +377,8 @@ namespace mpvnet
|
||||
}
|
||||
else
|
||||
{
|
||||
int savedHeight = RegistryHelp.GetInt("Height");
|
||||
int savedWidth = RegistryHelp.GetInt("Width");
|
||||
int savedHeight = RegistryHelp.GetInt("window-height");
|
||||
int savedWidth = RegistryHelp.GetInt("window-width");
|
||||
|
||||
if (App.StartSize == "height-always" && savedHeight != 0)
|
||||
{
|
||||
@@ -413,7 +406,7 @@ namespace mpvnet
|
||||
width = savedWidth;
|
||||
}
|
||||
|
||||
core.WasInitialSizeSet = true;
|
||||
Core.WasInitialSizeSet = true;
|
||||
}
|
||||
|
||||
SetSize(width, height, screen, checkAutofit);
|
||||
@@ -429,15 +422,15 @@ namespace mpvnet
|
||||
|
||||
if (checkAutofit)
|
||||
{
|
||||
if (height < maxHeight * core.AutofitSmaller)
|
||||
if (height < maxHeight * Core.AutofitSmaller)
|
||||
{
|
||||
height = Convert.ToInt32(maxHeight * core.AutofitSmaller);
|
||||
height = Convert.ToInt32(maxHeight * Core.AutofitSmaller);
|
||||
width = Convert.ToInt32(height * startWidth / (double)startHeight);
|
||||
}
|
||||
|
||||
if (height > maxHeight * core.AutofitLarger)
|
||||
if (height > maxHeight * Core.AutofitLarger)
|
||||
{
|
||||
height = Convert.ToInt32(maxHeight * core.AutofitLarger);
|
||||
height = Convert.ToInt32(maxHeight * Core.AutofitLarger);
|
||||
width = Convert.ToInt32(height * startWidth / (double)startHeight);
|
||||
}
|
||||
}
|
||||
@@ -493,7 +486,8 @@ namespace mpvnet
|
||||
if (top + rect.Height > maxBottom)
|
||||
top = maxBottom - rect.Height;
|
||||
|
||||
SetWindowPos(Handle, IntPtr.Zero, left, top, rect.Width, rect.Height, 4);
|
||||
uint SWP_NOACTIVATE = 0x0010;
|
||||
SetWindowPos(Handle, IntPtr.Zero, left, top, rect.Width, rect.Height, SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
public int GetHorizontalLocation(Screen screen)
|
||||
@@ -533,7 +527,7 @@ namespace mpvnet
|
||||
public void CycleFullscreen(bool enabled)
|
||||
{
|
||||
LastCycleFullscreen = Environment.TickCount;
|
||||
core.Fullscreen = enabled;
|
||||
Core.Fullscreen = enabled;
|
||||
|
||||
if (enabled)
|
||||
{
|
||||
@@ -560,7 +554,7 @@ namespace mpvnet
|
||||
else
|
||||
WindowState = FormWindowState.Normal;
|
||||
|
||||
if (core.Border)
|
||||
if (Core.Border)
|
||||
FormBorderStyle = FormBorderStyle.Sizable;
|
||||
else
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
@@ -573,7 +567,7 @@ namespace mpvnet
|
||||
|
||||
public void BuildMenu()
|
||||
{
|
||||
string content = File.ReadAllText(core.InputConfPath);
|
||||
string content = File.ReadAllText(Core.InputConfPath);
|
||||
var items = CommandItem.GetItems(content);
|
||||
|
||||
if (!content.Contains("#menu:"))
|
||||
@@ -595,7 +589,7 @@ namespace mpvnet
|
||||
|
||||
MenuItem menuItem = ContextMenu.Add(item.Path.Replace("&", "&&"), () => {
|
||||
try {
|
||||
core.command(item.Command);
|
||||
Core.command(item.Command);
|
||||
} catch (Exception ex) {
|
||||
Msg.ShowException(ex);
|
||||
}
|
||||
@@ -608,12 +602,12 @@ namespace mpvnet
|
||||
|
||||
void FileLoaded()
|
||||
{
|
||||
string path = core.get_property_string("path");
|
||||
string path = Core.get_property_string("path");
|
||||
|
||||
BeginInvoke(new Action(() => {
|
||||
Text = core.expand(Title);
|
||||
Text = Core.expand(Title);
|
||||
|
||||
int interval = (int)(core.Duration.TotalMilliseconds / 100);
|
||||
int interval = (int)(Core.Duration.TotalMilliseconds / 100);
|
||||
|
||||
if (interval < 100)
|
||||
interval = 100;
|
||||
@@ -634,7 +628,7 @@ namespace mpvnet
|
||||
RecentFiles.RemoveAt(App.RecentCount);
|
||||
}
|
||||
|
||||
void SetTitle() => BeginInvoke(new Action(() => Text = core.expand(Title)));
|
||||
void SetTitle() => BeginInvoke(new Action(() => Text = Core.expand(Title)));
|
||||
|
||||
void SaveWindowProperties()
|
||||
{
|
||||
@@ -642,8 +636,8 @@ namespace mpvnet
|
||||
{
|
||||
SavePosition();
|
||||
|
||||
RegistryHelp.SetValue(App.RegPath, "Width", ClientSize.Width);
|
||||
RegistryHelp.SetValue(App.RegPath, "Height", ClientSize.Height);
|
||||
RegistryHelp.SetInt("window-width", ClientSize.Width);
|
||||
RegistryHelp.SetInt("window-height", ClientSize.Height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -662,11 +656,11 @@ namespace mpvnet
|
||||
if (y == -1) posY = Top;
|
||||
if (y == 1) posY = Top + Height;
|
||||
|
||||
RegistryHelp.SetInt("PosX", posX);
|
||||
RegistryHelp.SetInt("PosY", posY);
|
||||
RegistryHelp.SetInt("position-x", posX);
|
||||
RegistryHelp.SetInt("position-y", posY);
|
||||
|
||||
RegistryHelp.SetInt("HorizontalLocation", x);
|
||||
RegistryHelp.SetInt("VerticalLocation", y);
|
||||
RegistryHelp.SetInt("location-horizontal", x);
|
||||
RegistryHelp.SetInt("location-vertical", y);
|
||||
}
|
||||
|
||||
protected override CreateParams CreateParams {
|
||||
@@ -714,8 +708,8 @@ namespace mpvnet
|
||||
bool skip = m.Msg == 0x100 && LastAppCommand != 0 &&
|
||||
(Environment.TickCount - LastAppCommand) < 1000;
|
||||
|
||||
if (core.WindowHandle != IntPtr.Zero && !skip)
|
||||
m.Result = SendMessage(core.WindowHandle, m.Msg, m.WParam, m.LParam);
|
||||
if (Core.WindowHandle != IntPtr.Zero && !skip)
|
||||
m.Result = SendMessage(Core.WindowHandle, m.Msg, m.WParam, m.LParam);
|
||||
}
|
||||
break;
|
||||
case 0x319: // WM_APPCOMMAND
|
||||
@@ -724,7 +718,7 @@ namespace mpvnet
|
||||
|
||||
if (value != null)
|
||||
{
|
||||
core.command("keypress " + value);
|
||||
Core.command("keypress " + value);
|
||||
m.Result = new IntPtr(1);
|
||||
LastAppCommand = Environment.TickCount;
|
||||
return;
|
||||
@@ -738,7 +732,7 @@ namespace mpvnet
|
||||
if (Environment.TickCount - LastCycleFullscreen > 500)
|
||||
{
|
||||
Point pos = PointToClient(Cursor.Position);
|
||||
core.command($"mouse {pos.X} {pos.Y}");
|
||||
Core.command($"mouse {pos.X} {pos.Y}");
|
||||
}
|
||||
|
||||
if (CursorHelp.IsPosDifferent(LastCursorPosition))
|
||||
@@ -746,12 +740,12 @@ namespace mpvnet
|
||||
break;
|
||||
case 0x2a3: // WM_MOUSELEAVE
|
||||
//osc won't auto hide after mouse left window in borderless mode
|
||||
core.command($"mouse {ClientSize.Width / 2} {ClientSize.Height / 3}");
|
||||
Core.command($"mouse {ClientSize.Width / 2} {ClientSize.Height / 3}");
|
||||
break;
|
||||
case 0x203: // WM_LBUTTONDBLCLK
|
||||
{
|
||||
Point pos = PointToClient(Cursor.Position);
|
||||
core.command($"mouse {pos.X} {pos.Y} 0 double");
|
||||
Core.command($"mouse {pos.X} {pos.Y} 0 double");
|
||||
}
|
||||
break;
|
||||
case 0x02E0: // WM_DPICHANGED
|
||||
@@ -770,7 +764,7 @@ namespace mpvnet
|
||||
SubtractWindowBorders(Handle, ref r, GetDPI(Handle));
|
||||
|
||||
int c_w = r.Right - r.Left, c_h = r.Bottom - r.Top;
|
||||
Size videoSize = core.VideoSize;
|
||||
Size videoSize = Core.VideoSize;
|
||||
|
||||
if (videoSize == Size.Empty)
|
||||
videoSize = new Size(16, 9);
|
||||
@@ -800,14 +794,14 @@ namespace mpvnet
|
||||
switch (mode)
|
||||
{
|
||||
case "single":
|
||||
core.LoadFiles(args, true, ModifierKeys.HasFlag(Keys.Control));
|
||||
Core.LoadFiles(args, true, ModifierKeys.HasFlag(Keys.Control));
|
||||
break;
|
||||
case "queue":
|
||||
foreach (string file in args)
|
||||
core.commandv("loadfile", file, "append");
|
||||
Core.commandv("loadfile", file, "append");
|
||||
break;
|
||||
case "command":
|
||||
core.command(args[0]);
|
||||
Core.command(args[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -816,7 +810,7 @@ namespace mpvnet
|
||||
return;
|
||||
}
|
||||
|
||||
if (m.Msg == TaskbarButtonCreatedMessage && core.TaskbarProgress)
|
||||
if (m.Msg == TaskbarButtonCreatedMessage && Core.TaskbarProgress)
|
||||
{
|
||||
Taskbar = new Taskbar(Handle);
|
||||
ProgressTimer.Start();
|
||||
@@ -845,21 +839,21 @@ namespace mpvnet
|
||||
|
||||
void UpdateProgressBar()
|
||||
{
|
||||
if (core.TaskbarProgress && Taskbar != null)
|
||||
Taskbar.SetValue(core.get_property_number("time-pos"), core.Duration.TotalSeconds);
|
||||
if (Core.TaskbarProgress && Taskbar != null)
|
||||
Taskbar.SetValue(Core.get_property_number("time-pos"), Core.Duration.TotalSeconds);
|
||||
}
|
||||
|
||||
void PropChangeOnTop(bool value) => BeginInvoke(new Action(() => TopMost = value));
|
||||
|
||||
void PropChangeAid(string value) => core.Aid = value;
|
||||
void PropChangeAid(string value) => Core.Aid = value;
|
||||
|
||||
void PropChangeSid(string value) => core.Sid = value;
|
||||
void PropChangeSid(string value) => Core.Sid = value;
|
||||
|
||||
void PropChangeVid(string value) => core.Vid = value;
|
||||
void PropChangeVid(string value) => Core.Vid = value;
|
||||
|
||||
void PropChangeTitle(string value) { Title = value; SetTitle(); }
|
||||
|
||||
void PropChangeEdition(int value) => core.Edition = value;
|
||||
void PropChangeEdition(int value) => Core.Edition = value;
|
||||
|
||||
void PropChangeWindowMaximized()
|
||||
{
|
||||
@@ -868,11 +862,11 @@ namespace mpvnet
|
||||
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
core.WindowMaximized = core.get_property_bool("window-maximized");
|
||||
Core.WindowMaximized = Core.get_property_bool("window-maximized");
|
||||
|
||||
if (core.WindowMaximized && WindowState != FormWindowState.Maximized)
|
||||
if (Core.WindowMaximized && WindowState != FormWindowState.Maximized)
|
||||
WindowState = FormWindowState.Maximized;
|
||||
else if (!core.WindowMaximized && WindowState == FormWindowState.Maximized)
|
||||
else if (!Core.WindowMaximized && WindowState == FormWindowState.Maximized)
|
||||
WindowState = FormWindowState.Normal;
|
||||
}));
|
||||
}
|
||||
@@ -884,25 +878,25 @@ namespace mpvnet
|
||||
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
core.WindowMinimized = core.get_property_bool("window-minimized");
|
||||
Core.WindowMinimized = Core.get_property_bool("window-minimized");
|
||||
|
||||
if (core.WindowMinimized && WindowState != FormWindowState.Minimized)
|
||||
if (Core.WindowMinimized && WindowState != FormWindowState.Minimized)
|
||||
WindowState = FormWindowState.Minimized;
|
||||
else if (!core.WindowMinimized && WindowState == FormWindowState.Minimized)
|
||||
else if (!Core.WindowMinimized && WindowState == FormWindowState.Minimized)
|
||||
WindowState = FormWindowState.Normal;
|
||||
}));
|
||||
}
|
||||
|
||||
void PropChangeBorder(bool enabled) {
|
||||
core.Border = enabled;
|
||||
Core.Border = enabled;
|
||||
|
||||
BeginInvoke(new Action(() => {
|
||||
if (!IsFullscreen)
|
||||
{
|
||||
if (core.Border && FormBorderStyle == FormBorderStyle.None)
|
||||
if (Core.Border && FormBorderStyle == FormBorderStyle.None)
|
||||
FormBorderStyle = FormBorderStyle.Sizable;
|
||||
|
||||
if (!core.Border && FormBorderStyle == FormBorderStyle.Sizable)
|
||||
if (!Core.Border && FormBorderStyle == FormBorderStyle.Sizable)
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
}
|
||||
}));
|
||||
@@ -910,7 +904,7 @@ namespace mpvnet
|
||||
|
||||
void PropChangePause(bool enabled)
|
||||
{
|
||||
if (Taskbar != null && core.TaskbarProgress)
|
||||
if (Taskbar != null && Core.TaskbarProgress)
|
||||
{
|
||||
if (enabled)
|
||||
Taskbar.SetState(TaskbarStates.Paused);
|
||||
@@ -923,44 +917,13 @@ namespace mpvnet
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
if (core.GPUAPI != "vulkan")
|
||||
core.VideoSizeAutoResetEvent.WaitOne(App.StartThreshold);
|
||||
if (Core.GPUAPI != "vulkan")
|
||||
Core.VideoSizeAutoResetEvent.WaitOne(App.StartThreshold);
|
||||
|
||||
LastCycleFullscreen = Environment.TickCount;
|
||||
SetFormPosAndSize();
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
|
||||
if (WindowState == FormWindowState.Maximized)
|
||||
core.set_property_bool("window-maximized", true);
|
||||
|
||||
if (core.GPUAPI == "vulkan")
|
||||
core.ProcessCommandLine(false);
|
||||
|
||||
ToolStripRendererEx.ForegroundColor = Theme.Current.GetWinFormsColor("menu-foreground");
|
||||
ToolStripRendererEx.BackgroundColor = Theme.Current.GetWinFormsColor("menu-background");
|
||||
ToolStripRendererEx.SelectionColor = Theme.Current.GetWinFormsColor("menu-highlight");
|
||||
ToolStripRendererEx.BorderColor = Theme.Current.GetWinFormsColor("menu-border");
|
||||
ToolStripRendererEx.CheckedColor = Theme.Current.GetWinFormsColor("menu-checked");
|
||||
|
||||
BuildMenu();
|
||||
ContextMenuStrip = ContextMenu;
|
||||
WPF.Init();
|
||||
System.Windows.Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
|
||||
Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y);
|
||||
UpdateCheck.DailyCheck();
|
||||
core.LoadScripts();
|
||||
GlobalHotkey.RegisterGlobalHotkeys(Handle);
|
||||
App.RunTask(() => App.Extension = new Extension());
|
||||
CSharpScriptHost.ExecuteScriptsInFolder(core.ConfigFolder + "scripts-cs");
|
||||
ShownTickCount = Environment.TickCount;
|
||||
App.ShowSetup();
|
||||
MsgError("aaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbb");
|
||||
}
|
||||
|
||||
protected override void OnActivated(EventArgs e)
|
||||
{
|
||||
base.OnActivated(e);
|
||||
@@ -968,12 +931,49 @@ namespace mpvnet
|
||||
SendMessage(Handle, m.Msg, m.WParam, m.LParam);
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
|
||||
if (WindowState == FormWindowState.Maximized)
|
||||
Core.set_property_bool("window-maximized", true);
|
||||
|
||||
if (Core.GPUAPI == "vulkan")
|
||||
Core.ProcessCommandLine(false);
|
||||
|
||||
BuildMenu();
|
||||
ContextMenuStrip = ContextMenu;
|
||||
WPF.Init();
|
||||
System.Windows.Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
|
||||
Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y);
|
||||
UpdateCheck.DailyCheck();
|
||||
Core.LoadScripts();
|
||||
GlobalHotkey.RegisterGlobalHotkeys(Handle);
|
||||
App.RunTask(() => App.Extension = new Extension());
|
||||
CSharpScriptHost.ExecuteScriptsInFolder(Core.ConfigFolder + "scripts-cs");
|
||||
ShownTickCount = Environment.TickCount;
|
||||
App.ShowSetup();
|
||||
|
||||
//if (Debugger.IsAttached)
|
||||
//{
|
||||
//}
|
||||
}
|
||||
|
||||
static void SetColors()
|
||||
{
|
||||
ToolStripRendererEx.ForegroundColor = Theme.Current.GetWinFormsColor("menu-foreground");
|
||||
ToolStripRendererEx.BackgroundColor = Theme.Current.GetWinFormsColor("menu-background");
|
||||
ToolStripRendererEx.SelectionColor = Theme.Current.GetWinFormsColor("menu-highlight");
|
||||
ToolStripRendererEx.BorderColor = Theme.Current.GetWinFormsColor("menu-border");
|
||||
ToolStripRendererEx.CheckedColor = Theme.Current.GetWinFormsColor("menu-checked");
|
||||
}
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
base.OnResize(e);
|
||||
|
||||
if (core.IsLogoVisible)
|
||||
core.ShowLogo();
|
||||
if (Core.IsLogoVisible)
|
||||
Core.ShowLogo();
|
||||
|
||||
if (FormBorderStyle != FormBorderStyle.None)
|
||||
{
|
||||
@@ -987,16 +987,16 @@ namespace mpvnet
|
||||
{
|
||||
if (WindowState == FormWindowState.Minimized)
|
||||
{
|
||||
core.set_property_bool("window-minimized", true);
|
||||
Core.set_property_bool("window-minimized", true);
|
||||
}
|
||||
else if (WindowState == FormWindowState.Normal)
|
||||
{
|
||||
core.set_property_bool("window-maximized", false);
|
||||
core.set_property_bool("window-minimized", false);
|
||||
Core.set_property_bool("window-maximized", false);
|
||||
Core.set_property_bool("window-minimized", false);
|
||||
}
|
||||
else if (WindowState == FormWindowState.Maximized)
|
||||
{
|
||||
core.set_property_bool("window-maximized", true);
|
||||
Core.set_property_bool("window-maximized", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1005,12 +1005,12 @@ namespace mpvnet
|
||||
{
|
||||
base.OnFormClosing(e);
|
||||
SaveWindowProperties();
|
||||
RegistryHelp.SetValue(App.RegPath, "Recent", RecentFiles.ToArray());
|
||||
RegistryHelp.SetValue("recent", RecentFiles.ToArray());
|
||||
|
||||
if (core.IsQuitNeeded)
|
||||
core.commandv("quit");
|
||||
if (Core.IsQuitNeeded)
|
||||
Core.commandv("quit");
|
||||
|
||||
if (!core.ShutdownAutoResetEvent.WaitOne(10000))
|
||||
if (!Core.ShutdownAutoResetEvent.WaitOne(10000))
|
||||
Msg.ShowError("Shutdown thread failed to complete within 10 seconds.");
|
||||
}
|
||||
|
||||
@@ -1027,7 +1027,7 @@ namespace mpvnet
|
||||
}
|
||||
|
||||
if (Width - e.Location.X < 10 && e.Location.Y < 10)
|
||||
core.commandv("quit");
|
||||
Core.commandv("quit");
|
||||
}
|
||||
|
||||
protected override void OnDragEnter(DragEventArgs e)
|
||||
@@ -1043,10 +1043,10 @@ namespace mpvnet
|
||||
base.OnDragDrop(e);
|
||||
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
core.LoadFiles(e.Data.GetData(DataFormats.FileDrop) as String[], true, Control.ModifierKeys.HasFlag(Keys.Control));
|
||||
Core.LoadFiles(e.Data.GetData(DataFormats.FileDrop) as String[], true, Control.ModifierKeys.HasFlag(Keys.Control));
|
||||
|
||||
if (e.Data.GetDataPresent(DataFormats.Text))
|
||||
core.LoadFiles(new[] { e.Data.GetData(DataFormats.Text).ToString() }, true, Control.ModifierKeys.HasFlag(Keys.Control));
|
||||
Core.LoadFiles(new[] { e.Data.GetData(DataFormats.Text).ToString() }, true, Control.ModifierKeys.HasFlag(Keys.Control));
|
||||
}
|
||||
|
||||
protected override void OnLostFocus(EventArgs e)
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
Imports System.Drawing
|
||||
Imports System.Drawing.Drawing2D
|
||||
Imports System.Windows.Forms
|
||||
Imports System.Windows.Forms.VisualStyles
|
||||
|
||||
Public Class CheckBoxRendererEx
|
||||
Public Shared Sub DrawCheckBox(g As Graphics, glyphLocation As Point, state As CheckBoxState)
|
||||
DrawCheckBox(g, New Rectangle(glyphLocation, GetGlyphSize(g, state)), state)
|
||||
End Sub
|
||||
|
||||
Public Shared Sub DrawCheckBox(g As Graphics, rect As Rectangle, state As CheckBoxState)
|
||||
'Dim smoothingModeBackup = g.SmoothingMode
|
||||
'g.SmoothingMode = SmoothingMode.AntiAlias
|
||||
|
||||
'If ThemeManager.CurrentTheme.UsesSystemColors OrElse DesignHelp.IsDesignMode Then
|
||||
' CheckBoxRenderer.DrawCheckBox(g, rect.Location, state)
|
||||
' Return
|
||||
'End If
|
||||
|
||||
'Dim theme = ThemeManager.CurrentTheme.General.Controls.CheckBox
|
||||
'Dim checked = state = CheckBoxState.CheckedDisabled OrElse state = CheckBoxState.CheckedHot OrElse state = CheckBoxState.CheckedNormal OrElse state = CheckBoxState.CheckedPressed
|
||||
'Dim backColor = If(checked, theme.BoxCheckedColor, theme.BoxColor)
|
||||
'Dim borderColor = If(checked, theme.BorderCheckedColor, theme.BorderColor)
|
||||
'Dim borderStrength = 2
|
||||
'Dim checkmarkColor = theme.CheckmarkColor
|
||||
'Dim checkmarkStrength = rect.Width \ 5
|
||||
|
||||
'Select Case state
|
||||
' Case CheckBoxState.CheckedNormal
|
||||
' Using brush As New SolidBrush(backColor)
|
||||
' Using pen As New Pen(borderColor, borderStrength)
|
||||
' g.FillRectangle(brush, rect)
|
||||
' g.DrawRectangle(pen, rect)
|
||||
' End Using
|
||||
' End Using
|
||||
|
||||
' Dim startX1 = rect.Left + rect.Width / 4.5F
|
||||
' Dim startY1 = rect.Top + rect.Height / 2.75F
|
||||
' Dim endX1 = rect.Left + rect.Width / 3.0F
|
||||
' Dim endY1 = rect.Top + rect.Height / 1.2F
|
||||
|
||||
' Dim startX2 = rect.Left + rect.Width / 3.6F
|
||||
' Dim startY2 = rect.Top + rect.Height / 1.3F
|
||||
' Dim endX2 = rect.Left + rect.Width / 1.2F
|
||||
' Dim endY2 = rect.Top + rect.Height / 5.0F
|
||||
|
||||
' Using pen As New Pen(checkmarkColor, checkmarkStrength)
|
||||
' g.DrawLine(pen, startX1, startY1, endX1, endY1)
|
||||
' g.DrawLine(pen, startX2, startY2, endX2, endY2)
|
||||
' End Using
|
||||
|
||||
' Case CheckBoxState.UncheckedNormal
|
||||
' Using brush As New SolidBrush(backColor)
|
||||
' Using pen As New Pen(borderColor, borderStrength)
|
||||
' g.FillRectangle(brush, rect)
|
||||
' g.DrawRectangle(pen, rect)
|
||||
' End Using
|
||||
' End Using
|
||||
'End Select
|
||||
|
||||
'g.SmoothingMode = smoothingModeBackup
|
||||
End Sub
|
||||
|
||||
Shared Function GetGlyphSize(g As Graphics, state As CheckBoxState) As Size
|
||||
Dim defaultSize = CheckBoxRenderer.GetGlyphSize(g, state)
|
||||
Dim uiSize = New Size(CInt(defaultSize.Width), CInt(defaultSize.Height))
|
||||
Return uiSize
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,164 +0,0 @@
|
||||
Imports System.Drawing
|
||||
|
||||
<Serializable>
|
||||
Public Structure ColorHSL
|
||||
Private ReadOnly _h As Integer
|
||||
Private ReadOnly _s As Single
|
||||
Private ReadOnly _l As Single
|
||||
Private ReadOnly _a As Single
|
||||
|
||||
|
||||
Public ReadOnly Property H As Integer
|
||||
Get
|
||||
Return _h
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property S As Single
|
||||
Get
|
||||
Return _s
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property L As Single
|
||||
Get
|
||||
Return _l
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property A As Single
|
||||
Get
|
||||
Return _a
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(h As Integer, s As Single, l As Single, Optional a As Single = 1.0F)
|
||||
Dim newHue = h Mod 360
|
||||
_h = Mathf.Clamp(If(newHue < 0, newHue + 360, newHue), 0, 359)
|
||||
_s = Mathf.Clamp01(s)
|
||||
_l = Mathf.Clamp01(l)
|
||||
_a = Mathf.Clamp01(a)
|
||||
End Sub
|
||||
|
||||
Public Shared Widening Operator CType(colorHSL As ColorHSL) As Color
|
||||
Dim hue As Integer = Mathf.Clamp(colorHSL.H Mod 360, 0, 359)
|
||||
Dim saturation As Single = Mathf.Clamp01(colorHSL.S)
|
||||
Dim lightness As Single = Mathf.Clamp01(colorHSL.L)
|
||||
Dim alpha As Single = Mathf.Clamp01(colorHSL.A)
|
||||
Dim c As Single = (1.0F - Math.Abs(2.0F * lightness - 1.0F)) * saturation
|
||||
Dim x As Single = c * (1.0F - Math.Abs((hue / 60.0F) Mod 2.0F - 1.0F))
|
||||
Dim m As Single = lightness - c / 2.0F
|
||||
Dim r As Single = c
|
||||
Dim g As Single = 0
|
||||
Dim b As Single = x
|
||||
|
||||
If hue < 300 Then
|
||||
r = x
|
||||
g = 0
|
||||
b = c
|
||||
End If
|
||||
|
||||
If hue < 240 Then
|
||||
r = 0
|
||||
g = x
|
||||
b = c
|
||||
End If
|
||||
|
||||
If hue < 180 Then
|
||||
r = 0
|
||||
g = c
|
||||
b = x
|
||||
End If
|
||||
|
||||
If hue < 120 Then
|
||||
r = x
|
||||
g = c
|
||||
b = 0
|
||||
End If
|
||||
|
||||
If hue < 60 Then
|
||||
r = c
|
||||
g = x
|
||||
b = 0
|
||||
End If
|
||||
|
||||
Return Color.FromArgb(CType(alpha * 255.0F, Byte), CType(Mathf.Clamp01(r + m) * 255.0F, Byte), CType(Mathf.Clamp01(g + m) * 255.0F, Byte), CType(Mathf.Clamp01(b + m) * 255.0F, Byte))
|
||||
End Operator
|
||||
|
||||
Public Shared Widening Operator CType(color As Color) As ColorHSL
|
||||
Dim r As Single = color.R / 255.0F
|
||||
Dim g As Single = color.G / 255.0F
|
||||
Dim b As Single = color.B / 255.0F
|
||||
Dim max As Single = Mathf.Max(r, g, b)
|
||||
Dim min As Single = Mathf.Min(r, g, b)
|
||||
Dim delta As Single = max - min
|
||||
Dim alpha As Single = color.A / 255.0F
|
||||
Dim lightness As Single = (min + max) / 2
|
||||
Dim saturation As Single = 0F
|
||||
saturation = If(delta <> 0F, (delta / (1 - Math.Abs(2 * lightness - 1))), saturation)
|
||||
Dim hue As Single = 0F
|
||||
If delta <> 0F Then
|
||||
hue = If(max = r, 60.0F * (((g - b) / delta) Mod 6.0F), hue)
|
||||
hue = If(max = g, 60.0F * (((b - r) / delta) + 2.0F), hue)
|
||||
hue = If(max = b, 60.0F * (((r - g) / delta) + 4.0F), hue)
|
||||
End If
|
||||
Return New ColorHSL(Mathf.RoundToInt(hue), saturation, lightness, alpha)
|
||||
End Operator
|
||||
|
||||
Public Shared Operator =(colorA As ColorHSL, colorB As ColorHSL) As Boolean
|
||||
Return colorA.Equals(colorB)
|
||||
End Operator
|
||||
|
||||
Public Shared Operator <>(colorA As ColorHSL, colorB As ColorHSL) As Boolean
|
||||
Return Not colorA.Equals(colorB)
|
||||
End Operator
|
||||
|
||||
Public Function AddHue(offset As Integer) As ColorHSL
|
||||
Return New ColorHSL(H + offset, S, L, A)
|
||||
End Function
|
||||
|
||||
Public Function AddSaturation(offset As Single) As ColorHSL
|
||||
Return New ColorHSL(H, S + offset, L, A)
|
||||
End Function
|
||||
|
||||
Public Function AddLuminance(offset As Single) As ColorHSL
|
||||
Return New ColorHSL(H, S, L + offset, A)
|
||||
End Function
|
||||
|
||||
Public Function AddAlpha(offset As Single) As ColorHSL
|
||||
Return New ColorHSL(H, S, L, A + offset)
|
||||
End Function
|
||||
|
||||
Public Overrides Function Equals(obj As Object) As Boolean
|
||||
Dim objColor = CType(obj, ColorHSL)
|
||||
Return H = objColor.H AndAlso S = objColor.S AndAlso L = objColor.L AndAlso A = objColor.A
|
||||
End Function
|
||||
|
||||
Public Function SetHue(value As Integer) As ColorHSL
|
||||
Return New ColorHSL(value, S, L, A)
|
||||
End Function
|
||||
|
||||
Public Function SetSaturation(value As Single) As ColorHSL
|
||||
Return New ColorHSL(H, value, L, A)
|
||||
End Function
|
||||
|
||||
Public Function SetLuminance(value As Single) As ColorHSL
|
||||
Return New ColorHSL(H, S, value, A)
|
||||
End Function
|
||||
|
||||
Public Function SetAlpha(value As Single) As ColorHSL
|
||||
Return New ColorHSL(H, S, L, value)
|
||||
End Function
|
||||
|
||||
Public Function ToColor() As Color
|
||||
Return CType(Me, Color)
|
||||
End Function
|
||||
|
||||
Public Function ToHTML() As String
|
||||
Return ColorTranslator.ToHtml(Me)
|
||||
End Function
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return String.Format($"HSLA({H:0}, {S:0.00}, {L:0.00}, {A:0.00})")
|
||||
End Function
|
||||
End Structure
|
||||
@@ -1,116 +0,0 @@
|
||||
Public Class Mathf
|
||||
Public Shared Function Clamp(value As Integer, min As Integer, max As Integer) As Integer
|
||||
If value < min Then
|
||||
value = min
|
||||
ElseIf value > max Then
|
||||
value = max
|
||||
End If
|
||||
Return value
|
||||
End Function
|
||||
|
||||
Public Shared Function Clamp(value As Single, min As Single, max As Single) As Single
|
||||
If value < min Then
|
||||
value = min
|
||||
ElseIf value > max Then
|
||||
value = max
|
||||
End If
|
||||
Return value
|
||||
End Function
|
||||
|
||||
Public Shared Function Clamp01(value As Single) As Single
|
||||
If value < 0F Then
|
||||
value = 0F
|
||||
ElseIf value > 1.0F Then
|
||||
value = 1.0F
|
||||
End If
|
||||
Return value
|
||||
End Function
|
||||
|
||||
Public Shared Function Min(a As Single, b As Single) As Single
|
||||
Return If((a >= b), b, a)
|
||||
End Function
|
||||
|
||||
Public Shared Function Min(ParamArray values As Single()) As Single
|
||||
Dim num As Integer = values.Length
|
||||
Dim result As Single
|
||||
If num = 0 Then
|
||||
result = 0F
|
||||
Else
|
||||
Dim num2 As Single = values(0)
|
||||
For i As Integer = 1 To num - 1
|
||||
If values(i) < num2 Then
|
||||
num2 = values(i)
|
||||
End If
|
||||
Next
|
||||
result = num2
|
||||
End If
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Shared Function Min(a As Integer, b As Integer) As Integer
|
||||
Return If((a >= b), b, a)
|
||||
End Function
|
||||
|
||||
Public Shared Function Min(ParamArray values As Integer()) As Integer
|
||||
Dim num As Integer = values.Length
|
||||
Dim result As Integer
|
||||
If num = 0 Then
|
||||
result = 0
|
||||
Else
|
||||
Dim num2 As Integer = values(0)
|
||||
For i As Integer = 1 To num - 1
|
||||
If values(i) < num2 Then
|
||||
num2 = values(i)
|
||||
End If
|
||||
Next
|
||||
result = num2
|
||||
End If
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Shared Function Max(a As Single, b As Single) As Single
|
||||
Return If((a <= b), b, a)
|
||||
End Function
|
||||
|
||||
Public Shared Function Max(ParamArray values As Single()) As Single
|
||||
Dim num As Integer = values.Length
|
||||
Dim result As Single
|
||||
If num = 0 Then
|
||||
result = 0F
|
||||
Else
|
||||
Dim num2 As Single = values(0)
|
||||
For i As Integer = 1 To num - 1
|
||||
If values(i) > num2 Then
|
||||
num2 = values(i)
|
||||
End If
|
||||
Next
|
||||
result = num2
|
||||
End If
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Shared Function Max(a As Integer, b As Integer) As Integer
|
||||
Return If((a <= b), b, a)
|
||||
End Function
|
||||
|
||||
Public Shared Function Max(ParamArray values As Integer()) As Integer
|
||||
Dim num As Integer = values.Length
|
||||
Dim result As Integer
|
||||
If num = 0 Then
|
||||
result = 0
|
||||
Else
|
||||
Dim num2 As Integer = values(0)
|
||||
For i As Integer = 1 To num - 1
|
||||
If values(i) > num2 Then
|
||||
num2 = values(i)
|
||||
End If
|
||||
Next
|
||||
result = num2
|
||||
End If
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Shared Function RoundToInt(value As Single) As Integer
|
||||
Return CInt(Math.Round(value))
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,69 +0,0 @@
|
||||
|
||||
Imports System.IO
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Text
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Public Class StringHelp
|
||||
Shared Function Base(instance As String) As String
|
||||
If instance = "" Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
Dim ret = instance
|
||||
|
||||
If ret.Contains(Path.DirectorySeparatorChar) Then
|
||||
ret = RightLast(ret, Path.DirectorySeparatorChar)
|
||||
End If
|
||||
|
||||
If ret.Contains(".") Then
|
||||
ret = LeftLast(ret, ".")
|
||||
End If
|
||||
|
||||
Return ret
|
||||
End Function
|
||||
|
||||
Shared Function RightLast(value As String, start As String) As String
|
||||
If value = "" OrElse start = "" Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
If Not value.Contains(start) Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
Return value.Substring(value.LastIndexOf(start) + start.Length)
|
||||
End Function
|
||||
|
||||
Shared Function LeftLast(value As String, start As String) As String
|
||||
If Not value.Contains(start) Then
|
||||
Return ""
|
||||
End If
|
||||
|
||||
Return value.Substring(0, value.LastIndexOf(start))
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Public Class Native
|
||||
<DllImport("user32.dll")>
|
||||
Shared Function GetForegroundWindow() As IntPtr
|
||||
End Function
|
||||
|
||||
<DllImport("user32.dll", CharSet:=CharSet.Unicode)>
|
||||
Shared Function GetWindowModuleFileName(
|
||||
hwnd As IntPtr,
|
||||
lpszFileName As StringBuilder,
|
||||
cchFileNameMax As UInteger) As UInteger
|
||||
End Function
|
||||
|
||||
<DllImport("user32.dll")>
|
||||
Shared Function SetWindowPos(
|
||||
hWnd As IntPtr,
|
||||
hWndInsertAfter As IntPtr,
|
||||
X As Integer,
|
||||
Y As Integer,
|
||||
cx As Integer,
|
||||
cy As Integer,
|
||||
uFlags As UInteger) As Boolean
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,82 +0,0 @@
|
||||
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Public Class Msg
|
||||
Shared Sub MsgInfo(title As Object, Optional content As Object = Nothing)
|
||||
Dim title1 = title?.ToString
|
||||
Dim content1 = content?.ToString
|
||||
Msg(title1, content1, TaskIcon.Info, TaskButton.OK)
|
||||
End Sub
|
||||
|
||||
Shared Sub MsgError(title As String, Optional content As String = Nothing)
|
||||
MsgError(title, content, IntPtr.Zero)
|
||||
End Sub
|
||||
|
||||
Shared Sub MsgError(title As String, content As String, handle As IntPtr)
|
||||
If title = "" Then
|
||||
title = content
|
||||
End If
|
||||
|
||||
If title = "" Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Using td As New TaskDialog(Of String)
|
||||
td.Title = title
|
||||
td.Content = content
|
||||
td.Owner = handle
|
||||
td.Icon = TaskIcon.Error
|
||||
td.ShowCopyButton = True
|
||||
td.AddButton("OK")
|
||||
td.Show()
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
Private Shared ShownMessages As String
|
||||
|
||||
Shared Sub MsgWarn(text As String, Optional content As String = Nothing, Optional onlyOnce As Boolean = False)
|
||||
If onlyOnce AndAlso ShownMessages?.Contains(text + content) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Msg(text, content, TaskIcon.Warning, TaskButton.OK)
|
||||
|
||||
If onlyOnce Then
|
||||
ShownMessages += text + content
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Shared Function MsgOK(title As String) As Boolean
|
||||
Return Msg(title, Nothing, TaskIcon.Question, TaskButton.OkCancel) = DialogResult.OK
|
||||
End Function
|
||||
|
||||
Shared Function MsgQuestion(
|
||||
title As String,
|
||||
Optional buttons As TaskButton = TaskButton.OkCancel) As DialogResult
|
||||
|
||||
Return Msg(title, Nothing, TaskIcon.Question, buttons)
|
||||
End Function
|
||||
|
||||
Shared Function MsgQuestion(
|
||||
title As String,
|
||||
content As String,
|
||||
Optional buttons As TaskButton = TaskButton.OkCancel) As DialogResult
|
||||
|
||||
Return Msg(title, content, TaskIcon.Question, buttons)
|
||||
End Function
|
||||
|
||||
Shared Function Msg(
|
||||
title As String,
|
||||
content As String,
|
||||
icon As TaskIcon,
|
||||
buttons As TaskButton) As DialogResult
|
||||
|
||||
Using td As New TaskDialog(Of DialogResult)
|
||||
td.Icon = icon
|
||||
td.Title = title
|
||||
td.Content = content
|
||||
td.Buttons = buttons
|
||||
Return td.Show()
|
||||
End Using
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,13 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>2</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
@@ -1,35 +0,0 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' General Information about an assembly is controlled through the following
|
||||
' set of attributes. Change these attribute values to modify the information
|
||||
' associated with an assembly.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("TaskDialog")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("TaskDialog")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2021")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("f93669b6-6d35-4b9b-8336-ba229135de4d")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
' Major Version
|
||||
' Minor Version
|
||||
' Build Number
|
||||
' Revision
|
||||
'
|
||||
' You can specify all the values or you can default the Build and Revision Numbers
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
@@ -1,63 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("TaskDialog.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.TaskDialog.My.MySettings
|
||||
Get
|
||||
Return Global.TaskDialog.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -1,144 +0,0 @@
|
||||
|
||||
Imports System.Drawing
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
<Flags()>
|
||||
Enum StockIconOptions As UInteger
|
||||
Small = &H1
|
||||
ShellSize = &H4
|
||||
Handle = &H100
|
||||
SystemIndex = &H4000
|
||||
LinkOverlay = &H8000
|
||||
Selected = &H10000
|
||||
End Enum
|
||||
|
||||
Enum StockIconIdentifier As UInteger
|
||||
DocumentNotAssociated = 0
|
||||
DocumentAssociated = 1
|
||||
Application = 2
|
||||
Folder = 3
|
||||
FolderOpen = 4
|
||||
Drive525 = 5
|
||||
Drive35 = 6
|
||||
DriveRemove = 7
|
||||
DriveFixed = 8
|
||||
DriveNetwork = 9
|
||||
DriveNetworkDisabled = 10
|
||||
DriveCD = 11
|
||||
DriveRAM = 12
|
||||
World = 13
|
||||
Server = 15
|
||||
Printer = 16
|
||||
MyNetwork = 17
|
||||
Find = 22
|
||||
Help = 23
|
||||
Share = 28
|
||||
Link = 29
|
||||
SlowFile = 30
|
||||
Recycler = 31
|
||||
RecyclerFull = 32
|
||||
MediaCDAudio = 40
|
||||
Lock = 47
|
||||
AutoList = 49
|
||||
PrinterNet = 50
|
||||
ServerShare = 51
|
||||
PrinterFax = 52
|
||||
PrinterFaxNet = 53
|
||||
PrinterFile = 54
|
||||
Stack = 55
|
||||
MediaSVCD = 56
|
||||
StuffedFolder = 57
|
||||
DriveUnknown = 58
|
||||
DriveDVD = 59
|
||||
MediaDVD = 60
|
||||
MediaDVDRAM = 61
|
||||
MediaDVDRW = 62
|
||||
MediaDVDR = 63
|
||||
MediaDVDROM = 64
|
||||
MediaCDAudioPlus = 65
|
||||
MediaCDRW = 66
|
||||
MediaCDR = 67
|
||||
MediaCDBurn = 68
|
||||
MediaBlankCD = 69
|
||||
MediaCDROM = 70
|
||||
AudioFiles = 71
|
||||
ImageFiles = 72
|
||||
VideoFiles = 73
|
||||
MixedFiles = 74
|
||||
FolderBack = 75
|
||||
FolderFront = 76
|
||||
Shield = 77
|
||||
Warning = 78
|
||||
Info = 79
|
||||
[Error] = 80
|
||||
Key = 81
|
||||
Software = 82
|
||||
Rename = 83
|
||||
Delete = 84
|
||||
MediaAudioDVD = 85
|
||||
MediaMovieDVD = 86
|
||||
MediaEnhancedCD = 87
|
||||
MediaEnhancedDVD = 88
|
||||
MediaHDDVD = 89
|
||||
MediaBluRay = 90
|
||||
MediaVCD = 91
|
||||
MediaDVDPlusR = 92
|
||||
MediaDVDPlusRW = 93
|
||||
DesktopPC = 94
|
||||
MobilePC = 95
|
||||
Users = 96
|
||||
MediaSmartMedia = 97
|
||||
MediaCompactFlash = 98
|
||||
DeviceCellPhone = 99
|
||||
DeviceCamera = 100
|
||||
DeviceVideoCamera = 101
|
||||
DeviceAudioPlayer = 102
|
||||
NetworkConnect = 103
|
||||
Internet = 104
|
||||
ZipFile = 105
|
||||
Settings = 106
|
||||
End Enum
|
||||
|
||||
Class StockIcon
|
||||
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
|
||||
Structure StockIconInfo
|
||||
Friend StuctureSize As UInt32
|
||||
Friend Handle As IntPtr
|
||||
Friend ImageIndex As Int32
|
||||
Friend Identifier As Int32
|
||||
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)>
|
||||
Friend Path As String
|
||||
End Structure
|
||||
|
||||
<DllImport("shell32.dll")>
|
||||
Shared Function SHGetStockIconInfo(
|
||||
identifier As StockIconIdentifier,
|
||||
flags As StockIconOptions,
|
||||
ByRef info As StockIconInfo) As Integer
|
||||
End Function
|
||||
|
||||
<DllImport("user32.dll")>
|
||||
Shared Function DestroyIcon(handle As IntPtr) As Boolean
|
||||
End Function
|
||||
|
||||
Shared Function GetSmallImage(identifier As StockIconIdentifier) As Bitmap
|
||||
Dim ptr = GetIcon(identifier, StockIconOptions.Handle Or StockIconOptions.Small)
|
||||
Dim bmp = Icon.FromHandle(ptr).ToBitmap
|
||||
DestroyIcon(ptr)
|
||||
Return bmp
|
||||
End Function
|
||||
|
||||
Shared Function GetImage(identifier As StockIconIdentifier) As Image
|
||||
Dim ptr = GetIcon(identifier, StockIconOptions.Handle Or StockIconOptions.ShellSize)
|
||||
Dim bmp = Icon.FromHandle(ptr).ToBitmap
|
||||
DestroyIcon(ptr)
|
||||
Return bmp
|
||||
End Function
|
||||
|
||||
Shared Function GetIcon(identifier As StockIconIdentifier, flags As StockIconOptions) As IntPtr
|
||||
Dim info As New StockIconInfo()
|
||||
info.StuctureSize = CType(Marshal.SizeOf(GetType(StockIconInfo)), UInt32)
|
||||
Marshal.ThrowExceptionForHR(SHGetStockIconInfo(identifier, flags, info))
|
||||
Return info.Handle
|
||||
End Function
|
||||
End Class
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,25 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31229.75
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TaskDialog", "TaskDialog.vbproj", "{CFBE6E6C-B711-42BB-B5ED-487D4767FE2B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CFBE6E6C-B711-42BB-B5ED-487D4767FE2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CFBE6E6C-B711-42BB-B5ED-487D4767FE2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CFBE6E6C-B711-42BB-B5ED-487D4767FE2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CFBE6E6C-B711-42BB-B5ED-487D4767FE2B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A25E6589-5D38-46A2-B480-5B0FFCAC64D7}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,486 +0,0 @@
|
||||
|
||||
Imports System.Drawing
|
||||
Imports System.Text
|
||||
Imports System.Threading
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Imports TaskDialog.Msg
|
||||
|
||||
Public Class TaskDialog(Of T)
|
||||
Inherits TaskDialogBaseForm
|
||||
|
||||
Property CommandDefinitions As New List(Of CommandDefinition)
|
||||
Property ButtonDefinitions As New List(Of ButtonDefinition)
|
||||
Property SelectedValue As T
|
||||
Property SelectedText As String
|
||||
Property Title As String
|
||||
Property Timeout As Integer
|
||||
Property Content As String
|
||||
Property ContentLabel As LabelEx
|
||||
Property ExpandedContent As String
|
||||
Property ExpandedContentLabel As LabelEx
|
||||
|
||||
Overloads Property Icon As TaskIcon
|
||||
Overloads Property Owner As IntPtr
|
||||
|
||||
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
End Sub
|
||||
|
||||
Public Sub New(defaultValue As T)
|
||||
MyClass.New()
|
||||
SelectedValue = defaultValue
|
||||
End Sub
|
||||
|
||||
Public Sub New(defaultText As String, defaultValue As T)
|
||||
MyClass.New(defaultValue)
|
||||
SelectedText = defaultText
|
||||
End Sub
|
||||
|
||||
Sub Init()
|
||||
ShowInTaskbar = False
|
||||
Width = FontHeight * 22
|
||||
|
||||
If Content = "" AndAlso Title?.Length > 80 Then
|
||||
Content = Title
|
||||
Title = ""
|
||||
End If
|
||||
|
||||
If MenuButton.Items.Count > 0 Then
|
||||
MenuButton.Visible = True
|
||||
|
||||
For Each i In MenuButton.Items
|
||||
Dim textWidth = TextRenderer.MeasureText(i.ToString, Font).Width + FontHeight * 3
|
||||
|
||||
If MenuButton.Width < textWidth Then
|
||||
Width += textWidth - MenuButton.Width
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If Content?.Length > 1000 OrElse ExpandedContent?.Length > 1000 Then
|
||||
Width = FontHeight * 35
|
||||
End If
|
||||
|
||||
ShowIcon = False
|
||||
StartPosition = FormStartPosition.CenterScreen
|
||||
|
||||
If Icon <> TaskIcon.None Then
|
||||
pbIcon.Visible = True
|
||||
End If
|
||||
|
||||
Select Case Icon
|
||||
Case TaskIcon.Warning
|
||||
pbIcon.Image = StockIcon.GetImage(StockIconIdentifier.Warning)
|
||||
Case TaskIcon.Error
|
||||
pbIcon.Image = StockIcon.GetImage(StockIconIdentifier.Error)
|
||||
Case TaskIcon.Info
|
||||
pbIcon.Image = StockIcon.GetImage(StockIconIdentifier.Info)
|
||||
Case TaskIcon.Shield
|
||||
pbIcon.Image = StockIcon.GetImage(StockIconIdentifier.Shield)
|
||||
Case TaskIcon.Question
|
||||
pbIcon.Image = StockIcon.GetImage(StockIconIdentifier.Help)
|
||||
End Select
|
||||
|
||||
TitleLabel.Font = New Font("Segoe UI", 11)
|
||||
TitleLabel.Text = Title
|
||||
|
||||
If Content <> "" Then
|
||||
ContentLabel = New LabelEx
|
||||
ContentLabel.Margin = New Padding(0)
|
||||
ContentLabel.BorderStyle = BorderStyle.None
|
||||
ContentLabel.Text = Content
|
||||
paMain.Controls.Add(ContentLabel)
|
||||
End If
|
||||
|
||||
If ExpandedContent <> "" Then
|
||||
ExpandedContentLabel = New LabelEx
|
||||
ExpandedContentLabel.Margin = New Padding(0)
|
||||
ExpandedContentLabel.BorderStyle = BorderStyle.None
|
||||
ExpandedContentLabel.Text = ExpandedContent
|
||||
ExpandedContentLabel.Name = "ExpandedInformation"
|
||||
blDetails.Visible = True
|
||||
paMain.Controls.Add(ExpandedContentLabel)
|
||||
End If
|
||||
|
||||
Dim firstCommandButton As CommandButton = Nothing
|
||||
|
||||
For Each cmd In CommandDefinitions
|
||||
Dim cb As New CommandButton
|
||||
cb.Title = cmd.Text
|
||||
cb.Description = cmd.Description
|
||||
cb.Tag = cmd
|
||||
|
||||
If TypeOf cmd.Value Is FontFamily Then
|
||||
cb.Font = New Font(cmd.Text, Font.Size)
|
||||
End If
|
||||
|
||||
AddHandler cb.Click, AddressOf CommandClick
|
||||
paMain.Controls.Add(cb)
|
||||
|
||||
If firstCommandButton Is Nothing Then
|
||||
firstCommandButton = cb
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each i In ButtonDefinitions
|
||||
If Not flpButtons.Visible Then
|
||||
flpButtons.Visible = True
|
||||
flpButtons.AutoSize = True
|
||||
End If
|
||||
|
||||
Dim b As New ButtonEx
|
||||
b.Text = i.Text
|
||||
b.Tag = i.Value
|
||||
|
||||
If AcceptButton Is Nothing AndAlso i.Text = "OK" Then
|
||||
AcceptButton = b
|
||||
End If
|
||||
|
||||
flpButtons.Controls.Add(b)
|
||||
i.Button = b
|
||||
AddHandler b.Click, AddressOf ButtonClick
|
||||
Next
|
||||
|
||||
If Timeout > 0 Then
|
||||
Task.Run(Sub()
|
||||
Thread.Sleep(Timeout * 1000)
|
||||
|
||||
If Not IsDisposingOrDisposed Then
|
||||
Invoke(Sub() Close())
|
||||
End If
|
||||
End Sub)
|
||||
End If
|
||||
|
||||
If TypeOf SelectedValue Is DialogResult Then
|
||||
If SelectedValue.Equals(DialogResult.None) Then
|
||||
If ButtonDefinitions.Where(Function(i) i.Value.Equals(DialogResult.No)).Any Then
|
||||
SelectedValue = CType(CObj(DialogResult.No), T)
|
||||
End If
|
||||
|
||||
If ButtonDefinitions.Where(Function(i) i.Value.Equals(DialogResult.Cancel)).Any Then
|
||||
SelectedValue = CType(CObj(DialogResult.Cancel), T)
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim ok = ButtonDefinitions.Where(Function(i) i.Value.Equals(DialogResult.OK)).FirstOrDefault
|
||||
|
||||
If Not ok Is Nothing Then
|
||||
ActiveControl = ok.Button
|
||||
End If
|
||||
|
||||
If ActiveControl Is Nothing Then
|
||||
Dim yes = ButtonDefinitions.Where(Function(i) i.Value.Equals(DialogResult.Yes)).FirstOrDefault
|
||||
|
||||
If Not yes Is Nothing Then
|
||||
ActiveControl = yes.Button
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If ActiveControl Is Nothing Then
|
||||
If firstCommandButton Is Nothing Then
|
||||
ActiveControl = TitleLabel
|
||||
Else
|
||||
ActiveControl = firstCommandButton
|
||||
End If
|
||||
End If
|
||||
|
||||
If Owner = IntPtr.Zero Then
|
||||
Owner = GetHandle()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub AddCommand(value As T)
|
||||
AddCommand(value.ToString, Nothing, value)
|
||||
End Sub
|
||||
|
||||
Sub AddCommand(text As String, Optional value As T = Nothing)
|
||||
AddCommand(text, Nothing, value)
|
||||
End Sub
|
||||
|
||||
Sub AddCommand(text As String, description As String, value As T)
|
||||
If value Is Nothing Then
|
||||
value = CType(CObj(text), T)
|
||||
End If
|
||||
|
||||
CommandDefinitions.Add(New CommandDefinition With {.Text = text, .Description = description, .Value = value})
|
||||
End Sub
|
||||
|
||||
Sub AddCommands(values As IEnumerable(Of T))
|
||||
For Each i In values
|
||||
AddCommand(i)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub AddButton(text As String)
|
||||
AddButton(text, CType(CObj(text), T))
|
||||
End Sub
|
||||
|
||||
Sub AddButton(text As String, value As T)
|
||||
ButtonDefinitions.Add(New ButtonDefinition With {.Text = text, .Value = value})
|
||||
End Sub
|
||||
|
||||
Sub AddButton(value As T)
|
||||
ButtonDefinitions.Add(New ButtonDefinition With {.Text = value.ToString, .Value = value})
|
||||
End Sub
|
||||
|
||||
Sub AddButtons(values As IEnumerable(Of T))
|
||||
For Each i In values
|
||||
AddButton(i)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
WriteOnly Property Buttons As TaskButton
|
||||
Set(value As TaskButton)
|
||||
For Each i In {TaskButton.OK, TaskButton.Yes, TaskButton.No,
|
||||
TaskButton.Cancel, TaskButton.Retry, TaskButton.Close}
|
||||
|
||||
If value.HasFlag(i) Then
|
||||
AddButton(i.ToString, CType(CObj(GetDialogResultFromButton(i)), T))
|
||||
End If
|
||||
Next
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub CommandClick(sender As Object, e As EventArgs)
|
||||
Dim tag = DirectCast(sender, CommandButton).Tag
|
||||
Dim cmd = DirectCast(tag, CommandDefinition)
|
||||
SelectedText = If(cmd.Text = "", cmd.Description, cmd.Text)
|
||||
SelectedValue = cmd.Value
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Sub ButtonClick(sender As Object, e As EventArgs)
|
||||
Dim button = DirectCast(sender, ButtonEx)
|
||||
SelectedText = button.Text
|
||||
SelectedValue = DirectCast(button.Tag, T)
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Overrides Sub AdjustSize()
|
||||
Dim h = tlpTop.Height + tlpTop.Margin.Vertical
|
||||
|
||||
If paMain.Controls.Count > 0 Then
|
||||
Dim last = paMain.Controls(paMain.Controls.Count - 1)
|
||||
h += last.Top + last.Height + last.Margin.Vertical
|
||||
End If
|
||||
|
||||
h += spBottom.Height
|
||||
|
||||
If spBottom.Controls.OfType(Of Control).Where(Function(i) i.Visible).Count > 0 Then
|
||||
h += spBottom.Margin.Vertical
|
||||
End If
|
||||
|
||||
Dim fh = FontHeight
|
||||
h += CInt(fh * 0.7)
|
||||
|
||||
Dim nonClientHeight = Height - ClientSize.Height
|
||||
Dim workingArea = Screen.FromControl(Me).WorkingArea
|
||||
Dim maxHeight = workingArea.Height
|
||||
Dim w = ClientSize.Width
|
||||
Dim secondLongestLine = GetSecondLongestLineLength()
|
||||
Dim predictedWidth = CInt(secondLongestLine * fh * 0.45)
|
||||
|
||||
If predictedWidth > Width Then
|
||||
w = predictedWidth
|
||||
End If
|
||||
|
||||
If w > fh * 40 Then
|
||||
w = fh * 40
|
||||
End If
|
||||
|
||||
Dim ncx = Width - ClientSize.Width
|
||||
Dim ncy = Height - ClientSize.Height
|
||||
|
||||
w += ncx
|
||||
h += ncy
|
||||
|
||||
If h > maxHeight Then
|
||||
h = maxHeight
|
||||
End If
|
||||
|
||||
Dim l = (workingArea.Width - w) \ 2
|
||||
Dim t = (workingArea.Height - h) \ 2
|
||||
|
||||
Native.SetWindowPos(Handle, IntPtr.Zero, l, t, w, h, 64)
|
||||
End Sub
|
||||
|
||||
Function GetSecondLongestLineLength() As Integer
|
||||
Dim list As New List(Of Integer)({51, 52})
|
||||
|
||||
If Content <> "" Then
|
||||
For Each line In Content.Split(vbLf)
|
||||
list.Add(line.Length)
|
||||
Next
|
||||
End If
|
||||
|
||||
If ExpandedContent <> "" AndAlso ExpandedContentLabel?.Height > 0 Then
|
||||
For Each line In ExpandedContent.Split(vbLf)
|
||||
list.Add(line.Length)
|
||||
Next
|
||||
End If
|
||||
|
||||
For Each def In CommandDefinitions
|
||||
If def.Description <> "" Then
|
||||
For Each line In def.Description.Split(vbLf)
|
||||
list.Add(line.Length)
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each def In CommandDefinitions
|
||||
If def.Text <> "" Then
|
||||
For Each line In def.Text.Split(vbLf)
|
||||
list.Add(CInt(line.Length / 11 * 9))
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
list.Sort()
|
||||
list.Reverse()
|
||||
Return list(1)
|
||||
End Function
|
||||
|
||||
WriteOnly Property ShowCopyButton As Boolean
|
||||
Set(value As Boolean)
|
||||
If value Then
|
||||
blCopyMessage.Text = "Copy Message"
|
||||
blCopyMessage.Visible = True
|
||||
blCopyMessage.ClickAction = Sub()
|
||||
Clipboard.SetText(GetText)
|
||||
MsgInfo("Message was copied to clipboard.")
|
||||
End Sub
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Function GetHandle() As IntPtr
|
||||
Dim sb As New StringBuilder(500)
|
||||
Dim handle = Native.GetForegroundWindow
|
||||
Native.GetWindowModuleFileName(handle, sb, CUInt(sb.Capacity))
|
||||
|
||||
If StringHelp.Base(sb.ToString.Replace(".vshost", "")) = StringHelp.Base(Application.ExecutablePath) Then
|
||||
Return handle
|
||||
End If
|
||||
End Function
|
||||
|
||||
Function GetText() As String
|
||||
Dim ret = TitleLabel.Text
|
||||
|
||||
If Content <> "" Then
|
||||
ret += BR2 + Content
|
||||
End If
|
||||
|
||||
If ExpandedContent <> "" Then
|
||||
ret += BR2 + ExpandedContent
|
||||
End If
|
||||
|
||||
Return ret
|
||||
End Function
|
||||
|
||||
Shared Function GetDialogResultFromButton(button As TaskButton) As DialogResult
|
||||
Select Case button
|
||||
Case TaskButton.OK
|
||||
Return DialogResult.OK
|
||||
Case TaskButton.Cancel, TaskButton.Close
|
||||
Return DialogResult.Cancel
|
||||
Case TaskButton.Yes
|
||||
Return DialogResult.Yes
|
||||
Case TaskButton.No
|
||||
Return DialogResult.No
|
||||
Case TaskButton.None
|
||||
Return DialogResult.None
|
||||
Case TaskButton.Retry
|
||||
Return DialogResult.Retry
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Protected Overrides Sub OnLoad(args As EventArgs)
|
||||
MyBase.OnLoad(args)
|
||||
Font = New Font("Segoe UI", 9)
|
||||
Dim fh = FontHeight
|
||||
|
||||
For Each i As ButtonEx In flpButtons.Controls
|
||||
i.Height = CInt(fh * 1.5)
|
||||
i.Width = fh * 5
|
||||
|
||||
Using g = i.CreateGraphics
|
||||
Dim minWidth = CInt(g.MeasureString(i.Text, i.Font).Width + fh)
|
||||
|
||||
If i.Width < minWidth Then
|
||||
i.Width = minWidth
|
||||
End If
|
||||
End Using
|
||||
|
||||
i.Margin = New Padding(CInt(fh * 0.4), 0, 0, 0)
|
||||
Next
|
||||
|
||||
MenuButton.Margin = New Padding(CInt(fh * 0.7), MenuButton.Margin.Top, CInt(fh * 0.7), MenuButton.Margin.Bottom)
|
||||
InputTextEdit.Margin = MenuButton.Margin
|
||||
flpButtons.Margin = New Padding(0, 0, CInt(fh * 0.7), 0)
|
||||
|
||||
If InputTextEdit.Visible Then
|
||||
ActiveControl = InputTextEdit
|
||||
InputTextEdit.TextBox.SelectAll()
|
||||
End If
|
||||
|
||||
AdjustSize()
|
||||
AdjustSize()
|
||||
|
||||
If Owner <> IntPtr.Zero Then
|
||||
Dim GWLP_HWNDPARENT = -8
|
||||
SetWindowLongPtr(Handle, GWLP_HWNDPARENT, Owner)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Overloads Function Show() As T
|
||||
Init()
|
||||
|
||||
If Application.MessageLoop Then
|
||||
Using Me
|
||||
ShowDialog()
|
||||
End Using
|
||||
Else
|
||||
Application.Run(Me)
|
||||
End If
|
||||
|
||||
Return SelectedValue
|
||||
End Function
|
||||
|
||||
Public Class CommandDefinition
|
||||
Property Text As String
|
||||
Property Description As String
|
||||
Property Value As T
|
||||
End Class
|
||||
|
||||
Public Class ButtonDefinition
|
||||
Property Text As String
|
||||
Property Value As T
|
||||
Property Button As ButtonEx
|
||||
End Class
|
||||
End Class
|
||||
|
||||
Public Enum TaskIcon
|
||||
None
|
||||
Info
|
||||
Warning
|
||||
Question
|
||||
[Error]
|
||||
Shield
|
||||
End Enum
|
||||
|
||||
Public Enum TaskButton
|
||||
None = 0
|
||||
OK = 1
|
||||
Yes = 2
|
||||
No = 4
|
||||
Cancel = 8
|
||||
Retry = 16
|
||||
Close = 32
|
||||
OkCancel = OK Or Cancel
|
||||
YesNo = Yes Or No
|
||||
YesNoCancel = YesNo Or Cancel
|
||||
RetryCancel = Retry Or Cancel
|
||||
End Enum
|
||||
@@ -1,131 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{CFBE6E6C-B711-42BB-B5ED-487D4767FE2B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<RootNamespace>TaskDialog</RootNamespace>
|
||||
<AssemblyName>TaskDialog</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>TaskDialog.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42105,42106,42107,42353,42354,42355</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>TaskDialog.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42105,42106,42107,42353,42354,42355</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CheckBoxRendererEx.vb" />
|
||||
<Compile Include="ColorHSL.vb" />
|
||||
<Compile Include="Mathf.vb" />
|
||||
<Compile Include="Misc.vb" />
|
||||
<Compile Include="Msg.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="StockIcon.vb" />
|
||||
<Compile Include="Symbol.vb" />
|
||||
<Compile Include="TaskDialog.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TaskDialogBaseForm.Designer.vb">
|
||||
<DependentUpon>TaskDialogBaseForm.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TaskDialogBaseForm.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="TaskDialogBaseForm.resx">
|
||||
<DependentUpon>TaskDialogBaseForm.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
247
src/WinForms/TaskDialog/TaskDialogBaseForm.Designer.vb
generated
247
src/WinForms/TaskDialog/TaskDialogBaseForm.Designer.vb
generated
@@ -1,247 +0,0 @@
|
||||
|
||||
Imports System.Windows.Forms
|
||||
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class TaskDialogBaseForm
|
||||
Inherits Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.tlpMain = New System.Windows.Forms.TableLayoutPanel()
|
||||
Me.tlpTop = New System.Windows.Forms.TableLayoutPanel()
|
||||
Me.TitleLabel = New TaskDialog.TaskDialogBaseForm.LabelEx()
|
||||
Me.pbIcon = New System.Windows.Forms.PictureBox()
|
||||
Me.paMain = New TaskDialog.TaskDialogBaseForm.TaskDialogPanel()
|
||||
Me.spBottom = New TaskDialog.TaskDialogBaseForm.StackPanel()
|
||||
Me.InputTextEdit = New TaskDialog.TaskDialogBaseForm.TextEdit()
|
||||
Me.MenuButton = New TaskDialog.TaskDialogBaseForm.MenuButtonEx()
|
||||
Me.CheckBox = New TaskDialog.TaskDialogBaseForm.CheckBoxEx()
|
||||
Me.flpButtons = New System.Windows.Forms.FlowLayoutPanel()
|
||||
Me.blDetails = New TaskDialog.TaskDialogBaseForm.ButtonLabel()
|
||||
Me.blCopyMessage = New TaskDialog.TaskDialogBaseForm.ButtonLabel()
|
||||
Me.tlpMain.SuspendLayout()
|
||||
Me.tlpTop.SuspendLayout()
|
||||
CType(Me.pbIcon, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.spBottom.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'tlpMain
|
||||
'
|
||||
Me.tlpMain.ColumnCount = 1
|
||||
Me.tlpMain.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||
Me.tlpMain.Controls.Add(Me.tlpTop, 0, 0)
|
||||
Me.tlpMain.Controls.Add(Me.paMain, 0, 1)
|
||||
Me.tlpMain.Controls.Add(Me.spBottom, 0, 2)
|
||||
Me.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.tlpMain.Location = New System.Drawing.Point(0, 0)
|
||||
Me.tlpMain.Name = "tlpMain"
|
||||
Me.tlpMain.RowCount = 3
|
||||
Me.tlpMain.RowStyles.Add(New System.Windows.Forms.RowStyle())
|
||||
Me.tlpMain.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||
Me.tlpMain.RowStyles.Add(New System.Windows.Forms.RowStyle())
|
||||
Me.tlpMain.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20.0!))
|
||||
Me.tlpMain.Size = New System.Drawing.Size(705, 683)
|
||||
Me.tlpMain.TabIndex = 0
|
||||
'
|
||||
'tlpTop
|
||||
'
|
||||
Me.tlpTop.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.tlpTop.AutoSize = True
|
||||
Me.tlpTop.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
|
||||
Me.tlpTop.ColumnCount = 2
|
||||
Me.tlpTop.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle())
|
||||
Me.tlpTop.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
|
||||
Me.tlpTop.Controls.Add(Me.TitleLabel, 1, 0)
|
||||
Me.tlpTop.Controls.Add(Me.pbIcon, 0, 0)
|
||||
Me.tlpTop.Location = New System.Drawing.Point(0, 15)
|
||||
Me.tlpTop.Margin = New System.Windows.Forms.Padding(0, 15, 0, 20)
|
||||
Me.tlpTop.Name = "tlpTop"
|
||||
Me.tlpTop.RowCount = 1
|
||||
Me.tlpTop.RowStyles.Add(New System.Windows.Forms.RowStyle())
|
||||
Me.tlpTop.Size = New System.Drawing.Size(705, 150)
|
||||
Me.tlpTop.TabIndex = 1
|
||||
'
|
||||
'TitleLabel
|
||||
'
|
||||
Me.TitleLabel.Anchor = System.Windows.Forms.AnchorStyles.Left
|
||||
Me.TitleLabel.AutoSize = True
|
||||
Me.TitleLabel.Location = New System.Drawing.Point(160, 56)
|
||||
Me.TitleLabel.Margin = New System.Windows.Forms.Padding(20)
|
||||
Me.TitleLabel.Size = New System.Drawing.Size(155, 37)
|
||||
Me.TitleLabel.Text = "TitleLabel"
|
||||
Me.TitleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
'
|
||||
'pbIcon
|
||||
'
|
||||
Me.pbIcon.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.pbIcon.Location = New System.Drawing.Point(40, 30)
|
||||
Me.pbIcon.Margin = New System.Windows.Forms.Padding(40, 30, 0, 20)
|
||||
Me.pbIcon.Name = "pbIcon"
|
||||
Me.pbIcon.Size = New System.Drawing.Size(100, 100)
|
||||
Me.pbIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
|
||||
Me.pbIcon.TabIndex = 2
|
||||
Me.pbIcon.TabStop = False
|
||||
Me.pbIcon.Visible = False
|
||||
'
|
||||
'paMain
|
||||
'
|
||||
Me.paMain.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.paMain.AutoScroll = True
|
||||
Me.paMain.Form = Nothing
|
||||
Me.paMain.LineBreaks = 0
|
||||
Me.paMain.Location = New System.Drawing.Point(0, 185)
|
||||
Me.paMain.Margin = New System.Windows.Forms.Padding(0)
|
||||
Me.paMain.Name = "paMain"
|
||||
Me.paMain.Size = New System.Drawing.Size(705, 63)
|
||||
Me.paMain.TabIndex = 2
|
||||
'
|
||||
'spBottom
|
||||
'
|
||||
Me.spBottom.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.spBottom.AutoSize = True
|
||||
Me.spBottom.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
|
||||
Me.spBottom.Controls.Add(Me.InputTextEdit)
|
||||
Me.spBottom.Controls.Add(Me.MenuButton)
|
||||
Me.spBottom.Controls.Add(Me.CheckBox)
|
||||
Me.spBottom.Controls.Add(Me.flpButtons)
|
||||
Me.spBottom.Controls.Add(Me.blDetails)
|
||||
Me.spBottom.Controls.Add(Me.blCopyMessage)
|
||||
Me.spBottom.FlowDirection = System.Windows.Forms.FlowDirection.TopDown
|
||||
Me.spBottom.Location = New System.Drawing.Point(0, 248)
|
||||
Me.spBottom.Margin = New System.Windows.Forms.Padding(0, 0, 0, 30)
|
||||
Me.spBottom.Name = "spBottom"
|
||||
Me.spBottom.Size = New System.Drawing.Size(705, 405)
|
||||
Me.spBottom.TabIndex = 3
|
||||
Me.spBottom.WrapContents = False
|
||||
'
|
||||
'InputTextEdit
|
||||
'
|
||||
Me.InputTextEdit.Anchor = CType((System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.InputTextEdit.Location = New System.Drawing.Point(30, 0)
|
||||
Me.InputTextEdit.Margin = New System.Windows.Forms.Padding(30, 0, 30, 30)
|
||||
Me.InputTextEdit.Name = "InputTextEdit"
|
||||
Me.InputTextEdit.Size = New System.Drawing.Size(645, 60)
|
||||
Me.InputTextEdit.Text = "InputTextEdit"
|
||||
Me.InputTextEdit.Visible = False
|
||||
'
|
||||
'MenuButton
|
||||
'
|
||||
Me.MenuButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Left Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.MenuButton.FlatAppearance.BorderSize = 2
|
||||
Me.MenuButton.Location = New System.Drawing.Point(30, 90)
|
||||
Me.MenuButton.Margin = New System.Windows.Forms.Padding(30, 0, 30, 30)
|
||||
Me.MenuButton.Padding = New System.Windows.Forms.Padding(4, 0, 0, 0)
|
||||
Me.MenuButton.ShowMenuSymbol = True
|
||||
Me.MenuButton.ShowPath = False
|
||||
Me.MenuButton.Size = New System.Drawing.Size(645, 70)
|
||||
Me.MenuButton.Text2 = "MenuButton"
|
||||
Me.MenuButton.Visible = False
|
||||
'
|
||||
'CheckBox
|
||||
'
|
||||
Me.CheckBox.AutoSize = True
|
||||
Me.CheckBox.FlatAppearance.BorderSize = 2
|
||||
Me.CheckBox.Location = New System.Drawing.Point(30, 190)
|
||||
Me.CheckBox.Margin = New System.Windows.Forms.Padding(30, 0, 0, 0)
|
||||
Me.CheckBox.Size = New System.Drawing.Size(366, 41)
|
||||
Me.CheckBox.Text = "VerificationCheckBox"
|
||||
Me.CheckBox.UseVisualStyleBackColor = False
|
||||
Me.CheckBox.Visible = False
|
||||
'
|
||||
'flpButtons
|
||||
'
|
||||
Me.flpButtons.Anchor = System.Windows.Forms.AnchorStyles.Right
|
||||
Me.flpButtons.Location = New System.Drawing.Point(505, 231)
|
||||
Me.flpButtons.Margin = New System.Windows.Forms.Padding(0)
|
||||
Me.flpButtons.Name = "flpButtons"
|
||||
Me.flpButtons.Size = New System.Drawing.Size(200, 100)
|
||||
Me.flpButtons.TabIndex = 2
|
||||
Me.flpButtons.Visible = False
|
||||
'
|
||||
'blDetails
|
||||
'
|
||||
Me.blDetails.AutoSize = True
|
||||
Me.blDetails.ClickAction = Nothing
|
||||
Me.blDetails.Location = New System.Drawing.Point(20, 331)
|
||||
Me.blDetails.Margin = New System.Windows.Forms.Padding(20, 0, 0, 0)
|
||||
Me.blDetails.Name = "blDetails"
|
||||
Me.blDetails.Size = New System.Drawing.Size(203, 37)
|
||||
Me.blDetails.TabIndex = 8
|
||||
Me.blDetails.Text = "Show Details"
|
||||
Me.blDetails.Visible = False
|
||||
'
|
||||
'blCopyMessage
|
||||
'
|
||||
Me.blCopyMessage.AutoSize = True
|
||||
Me.blCopyMessage.ClickAction = Nothing
|
||||
Me.blCopyMessage.Location = New System.Drawing.Point(20, 368)
|
||||
Me.blCopyMessage.Margin = New System.Windows.Forms.Padding(20, 0, 0, 0)
|
||||
Me.blCopyMessage.Name = "blCopyMessage"
|
||||
Me.blCopyMessage.Size = New System.Drawing.Size(228, 37)
|
||||
Me.blCopyMessage.TabIndex = 7
|
||||
Me.blCopyMessage.Text = "Copy Message"
|
||||
Me.blCopyMessage.Visible = False
|
||||
'
|
||||
'TaskDialogBaseForm
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(288.0!, 288.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi
|
||||
Me.ClientSize = New System.Drawing.Size(705, 683)
|
||||
Me.Controls.Add(Me.tlpMain)
|
||||
Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.Name = "TaskDialogBaseForm"
|
||||
Me.ShowIcon = False
|
||||
Me.Text = "StaxRip"
|
||||
Me.tlpMain.ResumeLayout(False)
|
||||
Me.tlpMain.PerformLayout()
|
||||
Me.tlpTop.ResumeLayout(False)
|
||||
Me.tlpTop.PerformLayout()
|
||||
CType(Me.pbIcon, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.spBottom.ResumeLayout(False)
|
||||
Me.spBottom.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents tlpMain As TableLayoutPanel
|
||||
Friend WithEvents CheckBox As CheckBoxEx
|
||||
Friend WithEvents flpButtons As FlowLayoutPanel
|
||||
Friend WithEvents InputTextEdit As TextEdit
|
||||
Friend WithEvents tlpTop As TableLayoutPanel
|
||||
Friend WithEvents TitleLabel As LabelEx
|
||||
Friend WithEvents MenuButton As MenuButtonEx
|
||||
Friend WithEvents paMain As TaskDialogPanel
|
||||
Friend WithEvents spBottom As StackPanel
|
||||
Friend WithEvents blCopyMessage As ButtonLabel
|
||||
Friend WithEvents blDetails As ButtonLabel
|
||||
Friend WithEvents pbIcon As PictureBox
|
||||
End Class
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user