mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
feat: 定时任务可选配置,并提前两分钟重启切换
This commit is contained in:
@@ -175,5 +175,6 @@ namespace MaaWpfGui.Constants
|
||||
public const string GuideStepIndex = "Guide.StepIndex";
|
||||
|
||||
public const string ForceScheduledStart = "Timer.ForceScheduledStart";
|
||||
public const string CustomConfig = "Timer.CustomConfig";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,6 +273,16 @@ namespace MaaWpfGui.Helper
|
||||
return SetValue("TaskQueue.Order." + task, value);
|
||||
}
|
||||
|
||||
public static string GetTimerConfig(int i, string defaultValue)
|
||||
{
|
||||
return GetValue($"Timer.Timer{i + 1}.Config", defaultValue);
|
||||
}
|
||||
|
||||
public static bool SetTimerConfig(int i, string value)
|
||||
{
|
||||
return SetValue($"Timer.Timer{i + 1}.Config", value);
|
||||
}
|
||||
|
||||
public static void Release()
|
||||
{
|
||||
lock (_lock)
|
||||
|
||||
@@ -1651,12 +1651,20 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public TimerProperties(int timeId, bool isOn, int hour, int min)
|
||||
public TimerProperties(int timeId, bool isOn, int hour, int min, string timerConfig)
|
||||
{
|
||||
TimerId = timeId;
|
||||
_isOn = isOn;
|
||||
_hour = hour;
|
||||
_min = min;
|
||||
if (timerConfig == null || !ConfigurationHelper.GetConfigurationList().Contains(timerConfig))
|
||||
{
|
||||
_timerConfig = ConfigurationHelper.GetCurrentConfiguration();
|
||||
}
|
||||
else
|
||||
{
|
||||
_timerConfig = timerConfig;
|
||||
}
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged([CallerMemberName] string name = null)
|
||||
@@ -1714,6 +1722,22 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
}
|
||||
|
||||
private string _timerConfig;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the config of the timer.
|
||||
/// </summary>
|
||||
public string TimerConfig
|
||||
{
|
||||
get => _timerConfig;
|
||||
set
|
||||
{
|
||||
_timerConfig = value ?? ConfigurationHelper.GetCurrentConfiguration();
|
||||
OnPropertyChanged();
|
||||
ConfigurationHelper.SetTimerConfig(TimerId, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public TimerProperties()
|
||||
{
|
||||
PropertyChanged += (sender, args) => { };
|
||||
@@ -1730,7 +1754,8 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
i,
|
||||
ConfigurationHelper.GetTimer(i, bool.FalseString) == bool.TrueString,
|
||||
int.Parse(ConfigurationHelper.GetTimerHour(i, $"{i * 3}")),
|
||||
int.Parse(ConfigurationHelper.GetTimerMin(i, "0")));
|
||||
int.Parse(ConfigurationHelper.GetTimerMin(i, "0")),
|
||||
ConfigurationHelper.GetTimerConfig(i, ConfigurationHelper.GetCurrentConfiguration()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1752,6 +1777,21 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
}
|
||||
|
||||
private bool _customConfig = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.CustomConfig, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to use custom config.
|
||||
/// </summary>
|
||||
public bool CustomConfig
|
||||
{
|
||||
get => _customConfig;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _customConfig, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.CustomConfig, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/* 刷理智设置 */
|
||||
|
||||
private string _penguinId = ConfigurationHelper.GetValue(ConfigurationKeys.PenguinId, string.Empty);
|
||||
|
||||
@@ -210,8 +210,8 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
private async void Timer1_Elapsed(object sender, EventArgs e)
|
||||
{
|
||||
// 提前记录时间,避免等待超过定时时间
|
||||
int intHour = DateTime.Now.Hour;
|
||||
int intMinute = DateTime.Now.Minute;
|
||||
DateTime currentTime = DateTime.Now;
|
||||
currentTime = new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, currentTime.Hour, currentTime.Minute, 0);
|
||||
|
||||
if (NeedToUpdateDatePrompt())
|
||||
{
|
||||
@@ -251,17 +251,38 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
|
||||
var timeToStart = false;
|
||||
var timeToChangeConfig = false;
|
||||
var configIndex = 0;
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
if (Instances.SettingsViewModel.TimerModels.Timers[i].IsOn &&
|
||||
Instances.SettingsViewModel.TimerModels.Timers[i].Hour == intHour &&
|
||||
Instances.SettingsViewModel.TimerModels.Timers[i].Min == intMinute)
|
||||
if (Instances.SettingsViewModel.TimerModels.Timers[i].IsOn)
|
||||
{
|
||||
timeToStart = true;
|
||||
break;
|
||||
DateTime startTime = new DateTime(currentTime.Year, currentTime.Month, currentTime.Day,
|
||||
Instances.SettingsViewModel.TimerModels.Timers[i].Hour,
|
||||
Instances.SettingsViewModel.TimerModels.Timers[i].Min,
|
||||
0);
|
||||
DateTime restartDateTime = startTime.AddMinutes(-2);
|
||||
if (currentTime == restartDateTime)
|
||||
{
|
||||
timeToChangeConfig = true;
|
||||
configIndex = i;
|
||||
break;
|
||||
}
|
||||
else if (currentTime == startTime)
|
||||
{
|
||||
timeToStart = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (timeToChangeConfig)
|
||||
{
|
||||
// CurrentConfiguration设置后会重启
|
||||
Instances.SettingsViewModel.CurrentConfiguration = Instances.SettingsViewModel.TimerModels.Timers[2].TimerConfig;
|
||||
return;
|
||||
}
|
||||
|
||||
if (timeToStart)
|
||||
{
|
||||
if (Instances.SettingsViewModel.ForceScheduledStart)
|
||||
|
||||
@@ -13,22 +13,34 @@
|
||||
xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels"
|
||||
xmlns:vm="clr-namespace:MaaWpfGui"
|
||||
d:DataContext="{d:DesignInstance {x:Type ui:SettingsViewModel}}"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="400"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<CheckBox
|
||||
Grid.Row="0"
|
||||
Height="30"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="{DynamicResource ForceScheduledStart}"
|
||||
IsChecked="{Binding ForceScheduledStart}"
|
||||
ToolTip="{DynamicResource ForceScheduledStartTip}" />
|
||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
||||
<CheckBox
|
||||
Grid.Row="0"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="{DynamicResource ForceScheduledStart}"
|
||||
IsChecked="{Binding ForceScheduledStart}"
|
||||
ToolTip="{DynamicResource ForceScheduledStartTip}" />
|
||||
<CheckBox
|
||||
Grid.Row="0"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="zdy"
|
||||
IsChecked="{Binding CustomConfig}" />
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
@@ -37,296 +49,384 @@
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[0].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 1">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[0].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[0].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[0].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[0].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel Grid.Row="0" Grid.Column="0">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[0].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 1">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[0].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[0].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[0].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[0].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsEditable="True"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ConfigurationList}"
|
||||
SelectedValue="{Binding TimerModels.Timers[0].TimerConfig}"
|
||||
SelectedValuePath="Value"
|
||||
Visibility="{c:Binding CustomConfig}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[1].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 2">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[1].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[1].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[1].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[1].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="0">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[1].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 2">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[1].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[1].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[1].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[1].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsEditable="True"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ConfigurationList}"
|
||||
SelectedValue="{Binding TimerModels.Timers[1].TimerConfig}"
|
||||
SelectedValuePath="Value"
|
||||
Visibility="{c:Binding CustomConfig}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[2].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 3">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[2].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[2].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[2].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[2].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel Grid.Row="2" Grid.Column="0">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[2].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 3">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[2].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[2].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[2].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[2].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsEditable="True"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ConfigurationList}"
|
||||
SelectedValue="{Binding TimerModels.Timers[2].TimerConfig}"
|
||||
SelectedValuePath="Value"
|
||||
Visibility="{c:Binding CustomConfig}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[3].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 4">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[3].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[3].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[3].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[3].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel Grid.Row="3" Grid.Column="0">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[3].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 4">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[3].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[3].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[3].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[3].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsEditable="True"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ConfigurationList}"
|
||||
SelectedValue="{Binding TimerModels.Timers[3].TimerConfig}"
|
||||
SelectedValuePath="Value"
|
||||
Visibility="{c:Binding CustomConfig}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[4].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 5">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[4].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[4].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[4].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[4].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel Grid.Row="0" Grid.Column="1">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[4].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 5">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[4].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[4].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[4].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[4].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsEditable="True"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ConfigurationList}"
|
||||
SelectedValue="{Binding TimerModels.Timers[4].TimerConfig}"
|
||||
SelectedValuePath="Value"
|
||||
Visibility="{c:Binding CustomConfig}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[5].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 6">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[5].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[5].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[5].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[5].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="1">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[5].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 6">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[5].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[5].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[5].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[5].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsEditable="True"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ConfigurationList}"
|
||||
SelectedValue="{Binding TimerModels.Timers[5].TimerConfig}"
|
||||
SelectedValuePath="Value"
|
||||
Visibility="{c:Binding CustomConfig}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[6].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 7">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[6].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[6].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[6].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[6].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel Grid.Row="2" Grid.Column="1">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[6].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 7">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[6].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[6].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[6].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[6].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsEditable="True"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ConfigurationList}"
|
||||
SelectedValue="{Binding TimerModels.Timers[6].TimerConfig}"
|
||||
SelectedValuePath="Value"
|
||||
Visibility="{c:Binding CustomConfig}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[7].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 8">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[7].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[7].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[7].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[7].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<StackPanel Grid.Row="3" Grid.Column="1">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[7].IsOn}">
|
||||
<CheckBox.Content>
|
||||
<controls:TextBlock>
|
||||
<controls:TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} 8">
|
||||
<Binding Source="{StaticResource Timer}" />
|
||||
</MultiBinding>
|
||||
</controls:TextBlock.Text>
|
||||
</controls:TextBlock>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[7].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[7].Hour, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
<controls:TextBlock Text=":" />
|
||||
<TextBox
|
||||
Width="35"
|
||||
Margin="10"
|
||||
InputMethod.IsInputMethodEnabled="False"
|
||||
IsReadOnly="{c:Binding !TimerModels.Timers[7].IsOn}"
|
||||
Text="{Binding TimerModels.Timers[7].Min, StringFormat=D2}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ComboBox
|
||||
Width="150"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsEditable="True"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ConfigurationList}"
|
||||
SelectedValue="{Binding TimerModels.Timers[7].TimerConfig}"
|
||||
SelectedValuePath="Value"
|
||||
Visibility="{c:Binding CustomConfig}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user