Skip to content

Commit

Permalink
修复thisistianqi提出的两个问题,实现Youxikong的建议添加加自动纠错的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
qzlysxj committed May 14, 2019
1 parent ca1be29 commit 3fe286e
Show file tree
Hide file tree
Showing 8 changed files with 455 additions and 307 deletions.
31 changes: 21 additions & 10 deletions RimeControl/Entitys/Schema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public class Schema : INotifyPropertyChanged
/// <summary>
/// 使用中
/// </summary>
public bool isUsing { get; set; }
public bool IsUsing { get; set; }

private bool _isSelect;

/// <summary>
/// 勾选
/// </summary>
public bool isSelect
public bool IsSelect
{
get { return _isSelect; }
set {
Expand All @@ -34,35 +34,46 @@ public bool isSelect
/// <summary>
/// 预设方案
/// </summary>
public bool isSys { get; set; }
public bool IsSys { get; set; }
/// <summary>
/// schema id
/// </summary>
public string schema_id { get; set; }
public string SchemaId { get; set; }
/// <summary>
/// schema 名称
/// </summary>
public string name { get; set; }
public string Name { get; set; }
/// <summary>
/// schema 版本信息
/// </summary>
public string version { get; set; }
public string Version { get; set; }
/// <summary>
/// schema 作者信息
/// </summary>
public string author { get; set; }
public string Author { get; set; }
/// <summary>
/// schema描述
/// </summary>
public string description { get; set; }
public string Description { get; set; }
/// <summary>
/// 依赖的 dependencies
/// 依赖的Schema Id数组
/// </summary>
public string dependencies { get; set; }
public string Dependencies { get; set; }
/// <summary>
/// 是否在Roaming\Rime目录
/// </summary>
public bool inRoaming { get; set; }
public bool InRoaming { get; set; }

/// <summary>
/// 自动纠错功能
/// 感谢 github Youxikong
/// </summary>
public bool EnableCorrection { get; set; }
/// <summary>
/// 记录读取时是否已经启用 自动纠错功能
/// </summary>

public bool OldEnableCorrection { get; set; }
}
}
19 changes: 13 additions & 6 deletions RimeControl/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,26 @@
<DataGrid.Columns>
<!--自定义CheckBox列 加 UpdateSourceTrigger=PropertyChanged 结束DataGridSchema的编辑状态,解决“选【启用】后一定要在非当前行点一下,这样最后勾选后的才能起效。”的问题 -->
<!--<DataGridCheckBoxColumn Binding="{Binding isSelect,UpdateSourceTrigger=PropertyChanged}" Width="60" Header="启用否" x:Name="ColCkbSelect" />-->
<DataGridTemplateColumn Width="60" Header="启用否">
<DataGridTemplateColumn Width="50" Header="启用">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox HorizontalAlignment="Center" Click="ColCkbSelect_Click" IsChecked="{Binding isSelect,UpdateSourceTrigger=PropertyChanged}"/>
<CheckBox HorizontalAlignment="Center" Click="ColCkbSelect_Click" IsChecked="{Binding IsSelect,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridCheckBoxColumn Binding="{Binding isUsing}" Header="使用中" Width="48" IsReadOnly="True" />-->
<!--<DataGridCheckBoxColumn Binding="{Binding isSys}" Header="预设" Width="56" IsReadOnly="True" />-->
<DataGridTextColumn Binding="{Binding name}" Header="方案名称" IsReadOnly="True" Width="170"/>
<DataGridTextColumn Binding="{Binding schema_id}" Header="法方案ID" IsReadOnly="True" Width="196"/>
<DataGridTextColumn Binding="{Binding version}" Header="版本" IsReadOnly="True" Width="100"/>
<DataGridTextColumn Binding="{Binding dependencies}" Header="依赖" IsReadOnly="True" Width="140" />
<DataGridTextColumn Binding="{Binding Name}" Header="方案名称" IsReadOnly="True" Width="160" />
<DataGridTextColumn Binding="{Binding SchemaId}" Header="法方案ID" IsReadOnly="True" Width="186"/>
<DataGridTextColumn Binding="{Binding Version}" Header="版本" IsReadOnly="True" Width="90"/>
<DataGridTextColumn Binding="{Binding Dependencies}" Header="依赖" IsReadOnly="True" Width="135" />
<DataGridTemplateColumn Width="50" Header="纠错">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox HorizontalAlignment="Center" IsChecked="{Binding EnableCorrection,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>

Expand Down
Loading

0 comments on commit 3fe286e

Please sign in to comment.