mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-14 13:22:07 +08:00
28 lines
951 B
C#
28 lines
951 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Windows.Data;
|
|
using Sheas_Cealer.Consts;
|
|
|
|
namespace Sheas_Cealer.Convs
|
|
{
|
|
internal class MainStartCealButtonIsEnabledConv : IMultiValueConverter
|
|
{
|
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
string? browserPath = values[0] as string;
|
|
string? upstreamUrl = values[1] as string;
|
|
string? extraArgs = values[2] as string;
|
|
|
|
if (File.Exists(browserPath) && Path.GetFileName(browserPath).ToLower().EndsWith(".exe") && MainConst.UrlRegex().IsMatch(upstreamUrl!) && MainConst.ArgsRegex().IsMatch(extraArgs!))
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
} |