small fixes

This commit is contained in:
Kvarkas
2026-02-10 22:03:02 +00:00
parent 5efcc653eb
commit d4bca6b03d
11 changed files with 45 additions and 26 deletions

View File

@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
<TargetFramework>net10.0-windows10.0.26100.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Library</OutputType>
<UseWindowsForms>True</UseWindowsForms>
<Platforms>x64;arm64</Platforms>
<Configurations>Debug;Release;Debug Portable;Release Portable;Deploy to github</Configurations>
<SupportedOSPlatformVersion>10.0.26100.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion>10.0.22621.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Portable|x64'">
<Optimize>True</Optimize>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
<TargetFramework>net10.0-windows10.0.26100.0</TargetFramework>
<Deterministic>false</Deterministic>
<RootNamespace>BrightIdeasSoftware</RootNamespace>
<AssemblyName>ObjectListView</AssemblyName>
@@ -35,8 +35,4 @@
<Folder Include="Resources\" />
<Folder Include="Rendering\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</Project>

View File

@@ -1906,7 +1906,7 @@ namespace BrightIdeasSoftware
[Category("ObjectListView"),
Description("The image list from which group header will take their images"),
DefaultValue(null)]
public ImageList GroupImageList
public new ImageList GroupImageList
{
get { return this.groupImageList; }
set

View File

@@ -101,7 +101,7 @@ namespace BrightIdeasSoftware
/// <para>
/// Although it isn't documented, .NET virtual lists cannot have checkboxes. This class codes around this limitation,
/// but you must use the functions provided by ObjectListView: CheckedObjects, CheckObject(), UncheckObject() and their friends.
/// If you use the normal check box properties (CheckedItems or CheckedIndicies), they will throw an exception, since the
/// If you use the normal check box properties (CheckedItems or CheckedIndicie), they will throw an exception, since the
/// list is in virtual mode, and .NET "knows" it can't handle checkboxes in virtual mode.
/// </para>
/// <para>Due to the limits of the underlying Windows control, virtual lists do not trigger ItemCheck/ItemChecked events.
@@ -155,7 +155,7 @@ namespace BrightIdeasSoftware
/// <para>
/// This property returns a simple collection. Changes made to the returned
/// collection do NOT affect the list. This is different to the behaviour of
/// CheckedIndicies collection.
/// CheckedIndicie collection.
/// </para>
/// <para>
/// When getting CheckedObjects, the performance of this method is O(n) where n is the number of checked objects.
@@ -405,8 +405,6 @@ namespace BrightIdeasSoftware
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_virtualListSize")]
private static extern ref int GetVirtualListSizeField(ListView listView);
static private FieldInfo virtualListSizeFieldInfo;
#endregion
#region OLV accessing

View File

@@ -24,7 +24,6 @@ namespace mRemoteNG.App
public static class ProgramRoot
{
private static Mutex? _mutex;
private static FrmSplashScreenNew _frmSplashScreen = null;
private static string customResourcePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Languages");
private static System.Threading.Thread? _wpfSplashThread;

View File

@@ -92,7 +92,7 @@ namespace mRemoteNG.Connection
#region IComponent
[Browsable(false)]
public ISite Site
public ISite? Site
{
get => new PropertyGridCommandSite(this);
set => throw (new NotImplementedException());

View File

@@ -27,7 +27,7 @@ namespace mRemoteNG.UI.Controls
private MrngLabel label2;
private MrngLabel label3;
private ToolTip toolTip1;
private System.ComponentModel.IContainer components;
private System.ComponentModel.Container components;
/* Sets and Gets the tooltiptext on toolTip1 */
public string ToolTipText
@@ -46,7 +46,7 @@ namespace mRemoteNG.UI.Controls
}
/* Set or Get the string that represents the value in the box */
public override string? Text
public override string Text
{
get => (Octet1.Text ?? string.Empty) + @"." + (Octet2.Text ?? string.Empty) + @"." + (Octet3.Text ?? string.Empty) + @"." + (Octet4.Text ?? string.Empty);
set
@@ -119,9 +119,7 @@ namespace mRemoteNG.UI.Controls
{
if (disposing)
{
// ReSharper disable once UseNullPropagation
if (components != null)
components.Dispose();
components?.Dispose();
}
base.Dispose(disposing);

View File

@@ -9,6 +9,8 @@ using mRemoteNG.Properties;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using mRemoteNG.UI.Window;
using mRemoteNG.App;
using mRemoteNG.Messages;
namespace mRemoteNG.UI.Forms
{
@@ -42,7 +44,7 @@ namespace mRemoteNG.UI.Forms
[Conditional("PORTABLE")]
private void AddPortableString() => lblTitle.Text += $@" {Language.PortableEdition}";
private void ApplyTheme()
private new void ApplyTheme()
{
if (!ThemeManager.getInstance().ThemingActive) return;
if (!ThemeManager.getInstance().ActiveAndExtended) return;
@@ -60,23 +62,41 @@ namespace mRemoteNG.UI.Forms
private void llLicense_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
OpenUrl("https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v" + Assembly.GetExecutingAssembly().GetName().Version.ToString().Substring(0, Assembly.GetExecutingAssembly().GetName().Version.ToString().Length - 2) + "-" + Properties.OptionsUpdatesPage.Default.CurrentUpdateChannelType + "/COPYING.txt");
var version = Assembly.GetExecutingAssembly().GetName().Version;
var updateChannel = Properties.OptionsUpdatesPage.Default.CurrentUpdateChannelType;
if (version != null && updateChannel != null)
{
var versionString = version.ToString();
OpenUrl("https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v" + versionString[..^2] + "-" + updateChannel + "/COPYING.txt");
}
Close();
}
private void llChangelog_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
OpenUrl("https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v" + Assembly.GetExecutingAssembly().GetName().Version.ToString().Substring(0, Assembly.GetExecutingAssembly().GetName().Version.ToString().Length - 2) + "-" + Properties.OptionsUpdatesPage.Default.CurrentUpdateChannelType + "/CHANGELOG.md");
var version = Assembly.GetExecutingAssembly().GetName().Version;
var updateChannel = Properties.OptionsUpdatesPage.Default.CurrentUpdateChannelType;
if (version != null && updateChannel != null)
{
var versionString = version.ToString();
OpenUrl("https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v" + versionString[..^2] + "-" + updateChannel + "/CHANGELOG.md");
}
Close();
}
private void llCredits_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
OpenUrl("https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v" + Assembly.GetExecutingAssembly().GetName().Version.ToString().Substring(0, Assembly.GetExecutingAssembly().GetName().Version.ToString().Length - 2) + "-" + Properties.OptionsUpdatesPage.Default.CurrentUpdateChannelType + "/CREDITS.md");
var version = Assembly.GetExecutingAssembly().GetName().Version;
var updateChannel = Properties.OptionsUpdatesPage.Default.CurrentUpdateChannelType;
if (version != null && updateChannel != null)
{
var versionString = version.ToString();
OpenUrl("https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v" + versionString[..^2] + "-" + updateChannel + "/CREDITS.md");
}
Close();
}
private void OpenUrl(string url)
private static void OpenUrl(string url)
{
// Validate URL format to prevent injection
if (string.IsNullOrWhiteSpace(url))

View File

@@ -398,6 +398,11 @@ namespace mRemoteNG.UI.Forms
private async void FrmMain_Shown(object sender, EventArgs e)
{
// Bring the main window to the front after splash screen closes
Activate();
BringToFront();
NativeMethods.SetForegroundWindow(Handle);
PromptForUpdatesPreference();
await CheckForUpdates();
}

View File

@@ -109,13 +109,16 @@ namespace mRemoteNG.UI.TaskDialog
//--------------------------------------------------------------------------------
string GetLargeText()
{
if (string.IsNullOrEmpty(Text))
return string.Empty;
string[] lines = Text.Split('\n');
return lines[0];
}
string GetSmallText()
{
if (Text.IndexOf('\n') < 0)
if (string.IsNullOrEmpty(Text) || Text.IndexOf('\n') < 0)
return "";
string s = Text;

View File

@@ -22,7 +22,7 @@
<PackageIcon>Header_dark.png</PackageIcon>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<UseWPF>True</UseWPF>
<SupportedOSPlatformVersion>10.0.26100.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion>10.0.22621.0</SupportedOSPlatformVersion>
<SignAssembly>False</SignAssembly>
<Title>Multi-Remote Next Generation Connection Manager</Title>
<RepositoryUrl>https://github.com/mRemoteNG/mRemoteNG.git</RepositoryUrl>