pauliology
pauliology
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
@Angius you around
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
@taner. i thought thats what i was trying to do
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
I have the converter
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
i'll give it a go
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
private static void UpdateMenuButtonTag(string ipAddress, string tag)
{
// Find the RadioButton with the corresponding IP address and update its Tag property
var radioButton = Application.Current.MainWindow.FindName(ipAddress) as RadioButton;
if (radioButton != null)
{
radioButton.Tag = tag;
}
}
private static void UpdateMenuButtonTag(string ipAddress, string tag)
{
// Find the RadioButton with the corresponding IP address and update its Tag property
var radioButton = Application.Current.MainWindow.FindName(ipAddress) as RadioButton;
if (radioButton != null)
{
radioButton.Tag = tag;
}
}
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
im thinking my update menu function may be the problem
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
so im kinda lost
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
not getting any errors either
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
its not changing colours
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
but the problem was
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
yeah which i can use your way of doing
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
private async Task PingAllIps()
{
foreach (var ipAddress in ipAddresses)
{
bool isPingSuccessful = await PingIpAddress(ipAddress);

// Update the corresponding RadioButton's Tag property
UpdateMenuButtonTag(ipAddress, isPingSuccessful ? "Color2" : "Color5");
}
}
private async Task PingAllIps()
{
foreach (var ipAddress in ipAddresses)
{
bool isPingSuccessful = await PingIpAddress(ipAddress);

// Update the corresponding RadioButton's Tag property
UpdateMenuButtonTag(ipAddress, isPingSuccessful ? "Color2" : "Color5");
}
}
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
and this was my foreach
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
that was my little list
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
private readonly List<string> ipAddresses = new() { "192.168.1.1", "8.8.8.8", "8.8.4.4", "10.221.79.32"};

private async Task<bool> PingIpAddress(string ipAddress)
{
using (Ping ping = new Ping())
{
try
{
PingReply reply = await ping.SendPingAsync(ipAddress);
return reply.Status == IPStatus.Success;
}
catch
{
return false; // Return false if an exception occurs
}
}
}
private readonly List<string> ipAddresses = new() { "192.168.1.1", "8.8.8.8", "8.8.4.4", "10.221.79.32"};

private async Task<bool> PingIpAddress(string ipAddress)
{
using (Ping ping = new Ping())
{
try
{
PingReply reply = await ping.SendPingAsync(ipAddress);
return reply.Status == IPStatus.Success;
}
catch
{
return false; // Return false if an exception occurs
}
}
}
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
so i had something like that
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
yup
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
yeah
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
or can i just tweak mine a little
80 replies
CC#
Created by pauliology on 4/19/2025 in #help
Online/offline colour menu colour change
to match yours
80 replies