Refresh solution and add WindowsFormsAero as NuGet package

This commit is contained in:
Lorenz Cuno Klopfenstein 2017-11-29 23:16:52 +01:00
parent 9ab38b5963
commit 57d8fed017
17 changed files with 202 additions and 174 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@
Installer/OnTopReplica-Setup.exe Installer/OnTopReplica-Setup.exe
*.user *.user
*.suo *.suo
packages/

View file

@ -1,20 +1,55 @@
 
Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual C# Express 2010 # Visual Studio 15
VisualStudioVersion = 15.0.27004.2008
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnTopReplica", "OnTopReplica\OnTopReplica.csproj", "{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnTopReplica", "OnTopReplica\OnTopReplica.csproj", "{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Debug|Any CPU.Build.0 = Debug|Any CPU {E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Debug|x64.ActiveCfg = Debug|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Debug|x64.Build.0 = Debug|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Debug|x86.ActiveCfg = Debug|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Debug|x86.Build.0 = Debug|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Release|Any CPU.ActiveCfg = Release|Any CPU {E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Release|Any CPU.Build.0 = Release|Any CPU {E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Release|Any CPU.Build.0 = Release|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Release|x64.ActiveCfg = Release|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Release|x64.Build.0 = Release|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Release|x86.ActiveCfg = Release|Any CPU
{E626BD6E-BF38-4EB7-A128-5CA6F40EF557}.Release|x86.Build.0 = Release|Any CPU
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Debug|x64.ActiveCfg = Debug|x64
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Debug|x64.Build.0 = Debug|x64
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Debug|x64.Deploy.0 = Debug|x64
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Debug|x86.ActiveCfg = Debug|x86
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Debug|x86.Build.0 = Debug|x86
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Debug|x86.Deploy.0 = Debug|x86
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Release|Any CPU.Build.0 = Release|Any CPU
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Release|Any CPU.Deploy.0 = Release|Any CPU
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Release|x64.ActiveCfg = Release|x64
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Release|x64.Build.0 = Release|x64
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Release|x64.Deploy.0 = Release|x64
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Release|x86.ActiveCfg = Release|x86
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Release|x86.Build.0 = Release|x86
{01391A7F-A9A1-4C90-89EB-29E0C98BF9BE}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3F135F78-F70E-4127-BA77-6C262C7CCCEF}
EndGlobalSection
EndGlobal EndGlobal

View file

@ -4,14 +4,13 @@ using System.Drawing;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows.Forms; using System.Windows.Forms;
using OnTopReplica.Native; using OnTopReplica.Native;
using WindowsFormsAero.Dwm.Helpers;
namespace OnTopReplica { namespace OnTopReplica {
/// <summary> /// <summary>
/// Form that automatically keeps a certain aspect ratio and resizes without flickering. /// Form that automatically keeps a certain aspect ratio and resizes without flickering.
/// </summary> /// </summary>
public class AspectRatioForm : GlassForm { public class AspectRatioForm : WindowsFormsAero.AeroForm {
bool _keepAspectRatio = true; bool _keepAspectRatio = true;

View file

@ -97,9 +97,8 @@ namespace OnTopReplica {
private void CommonCompleteSwitch(bool enabled) { private void CommonCompleteSwitch(bool enabled) {
//UI stuff switching //UI stuff switching
_mainForm.GlassEnabled = !enabled; _mainForm.GlassMargins = (!enabled) ? new Padding(-1) : Padding.Empty;
_mainForm.TopMost = !enabled; _mainForm.TopMost = !enabled;
_mainForm.HandleMouseMove = !enabled;
IsFullscreen = enabled; IsFullscreen = enabled;

View file

@ -64,8 +64,7 @@ namespace OnTopReplica {
//Window init //Window init
KeepAspectRatio = false; KeepAspectRatio = false;
GlassEnabled = true; GlassMargins = new Padding(-1);
GlassMargins = new Margins(-1);
//Managers //Managers
_msgPumpManager.Initialize(this); _msgPumpManager.Initialize(this);

View file

@ -18,9 +18,9 @@ namespace OnTopReplica {
set { set {
if (value && Settings.Default.FirstTimeClickForwarding) { if (value && Settings.Default.FirstTimeClickForwarding) {
TaskDialog dlg = new TaskDialog(Strings.InfoClickForwarding, Strings.InfoClickForwardingTitle, Strings.InfoClickForwardingContent) { TaskDialog dlg = new TaskDialog(Strings.InfoClickForwarding, Strings.InfoClickForwardingTitle, Strings.InfoClickForwardingContent) {
CommonButtons = TaskDialogButton.Yes | TaskDialogButton.No CommonButtons = CommonButton.Yes | CommonButton.No
}; };
if (dlg.Show(this).CommonButton == Result.No) if (dlg.Show(this).CommonButton == CommonButtonResult.No)
return; return;
Settings.Default.FirstTimeClickForwarding = false; Settings.Default.FirstTimeClickForwarding = false;

View file

@ -54,7 +54,7 @@ namespace OnTopReplica {
/// <param name="errorMessage">Expanded error codes/messages.</param> /// <param name="errorMessage">Expanded error codes/messages.</param>
private void ShowErrorDialog(string mainInstruction, string explanation, string errorMessage) { private void ShowErrorDialog(string mainInstruction, string explanation, string errorMessage) {
TaskDialog dlg = new TaskDialog(mainInstruction, Strings.ErrorGenericTitle, explanation) { TaskDialog dlg = new TaskDialog(mainInstruction, Strings.ErrorGenericTitle, explanation) {
CommonIcon = TaskDialogIcon.Stop, CommonIcon = CommonIcon.Stop,
IsExpanded = false IsExpanded = false
}; };
@ -85,12 +85,12 @@ namespace OnTopReplica {
var dlg = new TaskDialog(Strings.AskReset, Strings.AskResetTitle, Strings.AskResetContent); var dlg = new TaskDialog(Strings.AskReset, Strings.AskResetTitle, Strings.AskResetContent);
dlg.UseCommandLinks = true; dlg.UseCommandLinks = true;
dlg.CustomButtons = new CustomButton[] { dlg.CustomButtons = new CustomButton[] {
new CustomButton(Result.OK, Strings.AskResetButtonOk), new CustomButton(CommonButtonResult.OK, Strings.AskResetButtonOk),
new CustomButton(Result.Cancel, Strings.ButtonCancel) new CustomButton(CommonButtonResult.Cancel, Strings.ButtonCancel)
}; };
dlg.CommonIcon = TaskDialogIcon.Information; dlg.CommonIcon = CommonIcon.Information;
if (dlg.Show(this).CommonButton == Result.OK) { if (dlg.Show(this).CommonButton == CommonButtonResult.OK) {
ResetMainForm(); ResetMainForm();
} }
} }

View file

@ -98,8 +98,8 @@
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="WindowsFormsAero"> <Reference Include="WindowsFormsAero, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\Lib\WindowsFormsAero.dll</HintPath> <HintPath>..\packages\Windows-Forms-Aero.3.0.1\lib\net461\WindowsFormsAero.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -408,6 +408,7 @@
<LastGenOutput>Strings.pt.Designer.cs</LastGenOutput> <LastGenOutput>Strings.pt.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="OnTopReplica.exe.manifest" /> <None Include="OnTopReplica.exe.manifest" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -535,72 +536,72 @@
<ItemGroup> <ItemGroup>
<PublishFile Include="Assets\icon.ico"> <PublishFile Include="Assets\icon.ico">
<Visible>False</Visible> <Visible>False</Visible>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<Group> <Group>
</Group> </Group>
<TargetPath> <TargetPath>
</TargetPath> </TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>File</FileType> <FileType>File</FileType>
</PublishFile> </PublishFile>
<PublishFile Include="Assets\screenshot-icon.ico"> <PublishFile Include="Assets\screenshot-icon.ico">
<Visible>False</Visible> <Visible>False</Visible>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<Group> <Group>
</Group> </Group>
<TargetPath> <TargetPath>
</TargetPath> </TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>File</FileType> <FileType>File</FileType>
</PublishFile> </PublishFile>
<PublishFile Include="Assets\window_multiple16.ico"> <PublishFile Include="Assets\window_multiple16.ico">
<Visible>False</Visible> <Visible>False</Visible>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<Group> <Group>
</Group> </Group>
<TargetPath> <TargetPath>
</TargetPath> </TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>File</FileType> <FileType>File</FileType>
</PublishFile> </PublishFile>
<PublishFile Include="Assets\xiao_arrow.png"> <PublishFile Include="Assets\xiao_arrow.png">
<Visible>False</Visible> <Visible>False</Visible>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<Group> <Group>
</Group> </Group>
<TargetPath> <TargetPath>
</TargetPath> </TargetPath>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>File</FileType> <FileType>File</FileType>
</PublishFile> </PublishFile>
<PublishFile Include="cs\OnTopReplica.resources"> <PublishFile Include="cs\OnTopReplica.resources">
<Visible>False</Visible> <Visible>False</Visible>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<Group> <Group>
</Group> </Group>
<TargetPath> <TargetPath>
</TargetPath> </TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Satellite</FileType> <FileType>Satellite</FileType>
</PublishFile> </PublishFile>
<PublishFile Include="da\OnTopReplica.resources"> <PublishFile Include="da\OnTopReplica.resources">
<Visible>False</Visible> <Visible>False</Visible>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<Group> <Group>
</Group> </Group>
<TargetPath> <TargetPath>
</TargetPath> </TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Satellite</FileType> <FileType>Satellite</FileType>
</PublishFile> </PublishFile>
<PublishFile Include="it\OnTopReplica.resources"> <PublishFile Include="it\OnTopReplica.resources">
<Visible>False</Visible> <Visible>False</Visible>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<Group> <Group>
</Group> </Group>
<TargetPath> <TargetPath>
</TargetPath> </TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Satellite</FileType> <FileType>Satellite</FileType>
</PublishFile> </PublishFile>
</ItemGroup> </ItemGroup>

View file

@ -15,7 +15,7 @@ namespace OnTopReplica.Platforms {
} }
public override void PostHandleFormInit(MainForm form) { public override void PostHandleFormInit(MainForm form) {
DwmManager.SetWindowFlip3dPolicy(form, Flip3DPolicy.ExcludeAbove); DwmManager.SetWindowFlip3dPolicy(form, WindowsFormsAero.Flip3DPolicy.ExcludeAbove);
DwmManager.SetExcludeFromPeek(form, true); DwmManager.SetExcludeFromPeek(form, true);
DwmManager.SetDisallowPeek(form, true); DwmManager.SetDisallowPeek(form, true);
} }

View file

@ -23,7 +23,7 @@ namespace OnTopReplica.Platforms {
//NOTE: this also makes HotKey registration critically fail on Windows 7 //NOTE: this also makes HotKey registration critically fail on Windows 7
form.ShowInTaskbar = false; form.ShowInTaskbar = false;
DwmManager.SetWindowFlip3dPolicy(form, Flip3DPolicy.ExcludeAbove); DwmManager.SetWindowFlip3dPolicy(form, WindowsFormsAero.Flip3DPolicy.ExcludeAbove);
_icon = new NotificationIcon(form); _icon = new NotificationIcon(form);
} }

View file

@ -65,11 +65,11 @@ namespace OnTopReplica {
} }
/// <summary> /// <summary>
/// Gets the panel's desired glass margins or null if no glass surface is required. /// Gets the panel's desired glass margins.
/// </summary> /// </summary>
public virtual Margins? GlassMargins { public virtual Padding GlassMargins {
get { get {
return null; return Padding.Empty;
} }
} }

View file

@ -4,13 +4,12 @@ using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using WindowsFormsAero.Dwm.Helpers;
namespace OnTopReplica { namespace OnTopReplica {
/// <summary> /// <summary>
/// Acts as a form that can contain a SidePanel instance. /// Acts as a form that can contain a SidePanel instance.
/// </summary> /// </summary>
partial class SidePanelContainer : GlassForm { partial class SidePanelContainer : WindowsFormsAero.AeroForm {
EventHandler RequestClosingHandler; EventHandler RequestClosingHandler;
@ -56,15 +55,7 @@ namespace OnTopReplica {
var minSize = panel.MinimumSize.Expand(this.Padding); var minSize = panel.MinimumSize.Expand(this.Padding);
this.ClientSize = minSize; this.ClientSize = minSize;
this.EnsureMinimumClientSize(minSize); this.EnsureMinimumClientSize(minSize);
this.GlassMargins = panel.GlassMargins;
//Enable glass if needed
var margins = panel.GlassMargins;
if (margins.HasValue) {
this.GlassMargins = margins.Value;
this.GlassEnabled = true;
}
else
this.GlassEnabled = false;
this.ResumeLayout(); this.ResumeLayout();
} }

View file

@ -23,7 +23,7 @@
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.labelVersion = new WindowsFormsAero.ThemeText.ThemedLabel(); this.labelVersion = new WindowsFormsAero.ThemeLabel();
this.panelContents = new OnTopReplica.SidePanels.AboutPanelContents(); this.panelContents = new OnTopReplica.SidePanels.AboutPanelContents();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -66,7 +66,7 @@
#endregion #endregion
private WindowsFormsAero.ThemeText.ThemedLabel labelVersion; private WindowsFormsAero.ThemeLabel labelVersion;
private AboutPanelContents panelContents; private AboutPanelContents panelContents;
} }

View file

@ -23,9 +23,9 @@ namespace OnTopReplica.SidePanels {
} }
} }
public override Margins? GlassMargins { public override Padding GlassMargins {
get { get {
return new Margins(0, 0, 0, labelVersion.Height); return new Padding(0, 0, 0, labelVersion.Height);
} }
} }

View file

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using WindowsFormsAero.Dwm; using WindowsFormsAero.Dwm;
using WindowsFormsAero.ThemeText;
using System.Drawing; using System.Drawing;
using System.Windows.Forms.VisualStyles; using System.Windows.Forms.VisualStyles;
using OnTopReplica.Native; using OnTopReplica.Native;
@ -16,7 +15,7 @@ namespace OnTopReplica {
Thumbnail _thumbnail = null; Thumbnail _thumbnail = null;
//Labels //Labels
ThemedLabel _labelGlass; WindowsFormsAero.ThemeLabel _labelGlass;
public ThumbnailPanel() { public ThumbnailPanel() {
InitFormComponents(); InitFormComponents();
@ -26,7 +25,7 @@ namespace OnTopReplica {
BackColor = Color.Black; BackColor = Color.Black;
//Themed Label //Themed Label
_labelGlass = new ThemedLabel { _labelGlass = new WindowsFormsAero.ThemeLabel {
Dock = DockStyle.Fill, Dock = DockStyle.Fill,
ForeColor = SystemColors.ControlText, ForeColor = SystemColors.ControlText,
Location = Point.Empty, Location = Point.Empty,
@ -138,11 +137,11 @@ namespace OnTopReplica {
get { get {
if (_thumbnail != null && !_thumbnail.IsInvalid) { if (_thumbnail != null && !_thumbnail.IsInvalid) {
if (_regionEnabled) { if (_regionEnabled) {
return _currentRegion.ComputeRegionSize(_thumbnail.SourceSize); return _currentRegion.ComputeRegionSize(_thumbnail.GetSourceSize());
} }
else { else {
//Thumbnail is not cropped, return full thumbnail source size //Thumbnail is not cropped, return full thumbnail source size
return _thumbnail.SourceSize; return _thumbnail.GetSourceSize();
} }
} }
else { else {
@ -164,7 +163,7 @@ namespace OnTopReplica {
public Size ThumbnailOriginalSize { public Size ThumbnailOriginalSize {
get { get {
if (_thumbnail != null && !_thumbnail.IsInvalid) { if (_thumbnail != null && !_thumbnail.IsInvalid) {
return _thumbnail.SourceSize; return _thumbnail.GetSourceSize();
} }
else { else {
#if DEBUG #if DEBUG
@ -272,7 +271,7 @@ namespace OnTopReplica {
System.Diagnostics.Debug.WriteLine("Fitting {0} inside {1} as {2}. Padding {3},{4}.", sourceSize, Size, _thumbnailSize, _padWidth, _padHeight); System.Diagnostics.Debug.WriteLine("Fitting {0} inside {1} as {2}. Padding {3},{4}.", sourceSize, Size, _thumbnailSize, _padWidth, _padHeight);
var target = new Rectangle(_padWidth, _padHeight, _thumbnailSize.Width, _thumbnailSize.Height); var target = new Rectangle(_padWidth, _padHeight, _thumbnailSize.Width, _thumbnailSize.Height);
Rectangle source = (_regionEnabled) ? _currentRegion.ComputeRegionRectangle(_thumbnail.SourceSize) : new Rectangle(Point.Empty, _thumbnail.SourceSize); Rectangle source = (_regionEnabled) ? _currentRegion.ComputeRegionRectangle(_thumbnail.GetSourceSize()) : new Rectangle(Point.Empty, _thumbnail.GetSourceSize());
_thumbnail.Update(target, source, ThumbnailOpacity, true, true); _thumbnail.Update(target, source, ThumbnailOpacity, true, true);
} }

View file

@ -146,14 +146,14 @@ namespace OnTopReplica.Update {
Instruction = string.Format(Strings.UpdateAvailableInstruction, LastInformation.LatestVersion), Instruction = string.Format(Strings.UpdateAvailableInstruction, LastInformation.LatestVersion),
Content = Strings.UpdateAvailableContent, Content = Strings.UpdateAvailableContent,
CustomButtons = new CustomButton[] { CustomButtons = new CustomButton[] {
new CustomButton(Result.OK, string.Format(Strings.UpdateAvailableCommandOk, LastInformation.LatestVersion)), new CustomButton(CommonButtonResult.OK, string.Format(Strings.UpdateAvailableCommandOk, LastInformation.LatestVersion)),
new CustomButton(Result.Cancel, Strings.UpdateAvailableCommandCancel) new CustomButton(CommonButtonResult.Cancel, Strings.UpdateAvailableCommandCancel)
}, },
UseCommandLinks = true, UseCommandLinks = true,
CommonIcon = TaskDialogIcon.Information, CommonIcon = CommonIcon.Information,
ExpandedInformation = string.Format(Strings.UpdateAvailableExpanded, LastInformation.CurrentVersion, LastInformation.LatestVersion), ExpandedInformation = string.Format(Strings.UpdateAvailableExpanded, LastInformation.CurrentVersion, LastInformation.LatestVersion),
}; };
if (updateDialog.Show(AttachedForm).CommonButton == Result.OK) { if (updateDialog.Show(AttachedForm).CommonButton == CommonButtonResult.OK) {
Shell.Execute(LastInformation.DownloadPage); Shell.Execute(LastInformation.DownloadPage);
} }
} }
@ -175,9 +175,9 @@ namespace OnTopReplica.Update {
Instruction = Strings.UpdateInfoInstruction, Instruction = Strings.UpdateInfoInstruction,
Content = Strings.UpdateInfoContent, Content = Strings.UpdateInfoContent,
EnableHyperlinks = true, EnableHyperlinks = true,
CommonButtons = TaskDialogButton.Close, CommonButtons = CommonButton.Close,
AllowDialogCancellation = true, AllowDialogCancellation = true,
CommonIcon = TaskDialogIcon.Information, CommonIcon = CommonIcon.Information,
Footer = string.Format(Strings.UpdateInfoFooter, LastInformation.LatestVersionRelease.ToLongDateString()) Footer = string.Format(Strings.UpdateInfoFooter, LastInformation.LatestVersionRelease.ToLongDateString())
}; };
dlg.HyperlinkClick += delegate(object sender, HyperlinkEventArgs args) { dlg.HyperlinkClick += delegate(object sender, HyperlinkEventArgs args) {

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Windows-Forms-Aero" version="3.0.1" targetFramework="net47" />
</packages>