Add Color property to Language.Designer.cs and add inheritance tests

Co-authored-by: Kvarkas <3611964+Kvarkas@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-10-07 19:49:21 +00:00
parent 9e61e8eafa
commit bbe1fa8416
2 changed files with 42 additions and 0 deletions

View File

@@ -609,6 +609,15 @@ namespace mRemoteNG.Resources.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Color.
/// </summary>
internal static string Color {
get {
return ResourceManager.GetString("Color", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cannot start Port Scan, incorrect IP format!.
/// </summary>
@@ -3774,6 +3783,15 @@ namespace mRemoteNG.Resources.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Sets the color for the connection or folder in the connections tree. Connections inherit this color from their parent folder..
/// </summary>
internal static string PropertyDescriptionColor {
get {
return ResourceManager.GetString("PropertyDescriptionColor", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select the color quality to be used..
/// </summary>

View File

@@ -68,5 +68,29 @@ namespace mRemoteNGTests.IntegrationTests
folder3.AddChild(connection);
Assert.That(connection.Icon, Is.EqualTo(folder1.Icon));
}
[Test]
public void ConnectionInheritsColorFromFolder()
{
var folder = new ContainerInfo { Color = "Red" };
var connection = new ConnectionInfo { Inheritance = { Color = true } };
_rootNode.AddChild(folder);
folder.AddChild(connection);
Assert.That(connection.Color, Is.EqualTo(folder.Color));
}
[Test]
public void CanInheritColorThroughMultipleFolderLevels()
{
var folder1 = new ContainerInfo { Color = "Blue" };
var folder2 = new ContainerInfo { Inheritance = { Color = true } };
var folder3 = new ContainerInfo { Inheritance = { Color = true } };
var connection = new ConnectionInfo { Inheritance = { Color = true } };
_rootNode.AddChild(folder1);
folder1.AddChild(folder2);
folder2.AddChild(folder3);
folder3.AddChild(connection);
Assert.That(connection.Color, Is.EqualTo(folder1.Color));
}
}
}