提交 007c9a27 编写于 作者: cdy816's avatar cdy816

日常更新

上级 99234927
......@@ -2,7 +2,7 @@
"profiles": {
"DBInStudioServer": {
"commandName": "Executable",
"executablePath": "C:\\Users\\cdy81\\source\\repos\\mars\\Output\\DBInStudioServer.exe"
"executablePath": "C:\\Users\\chongdaoyang\\source\\repos\\mars\\Output\\DBInStudioServer.exe"
}
}
}
\ No newline at end of file
......@@ -682,7 +682,7 @@ namespace DBInStudio.Desktop.Properties {
}
/// <summary>
/// 查找类似 Database is changed,do you want to save? 的本地化字符串。
/// 查找类似 Data is changed,do you want to save? 的本地化字符串。
/// </summary>
internal static string saveprompt {
get {
......
......@@ -327,7 +327,7 @@
<value>save failed!</value>
</data>
<data name="saveprompt" xml:space="preserve">
<value>Database is changed,do you want to save?</value>
<value>Data is changed,do you want to save?</value>
</data>
<data name="SaveSucessful" xml:space="preserve">
<value>save sucessfull!</value>
......
......@@ -197,7 +197,7 @@
<value>导入</value>
</data>
<data name="ImportErroMsg" xml:space="preserve">
<value>Some erro has happened,do you see erro.txt for detail?</value>
<value>导入过程发生错误,是否要查看错误日志: erro.txt?</value>
</data>
<data name="ImportMode" xml:space="preserve">
<value>导入模式</value>
......
......@@ -2,7 +2,7 @@
"profiles": {
"DBInStudio.Desktop": {
"commandName": "Executable",
"executablePath": "C:\\Users\\cdy81\\source\\repos\\mars\\Output\\DBInStudio.exe"
"executablePath": "C:\\Users\\chongdaoyang\\source\\repos\\mars\\Output\\DBInStudio.exe"
}
}
}
\ No newline at end of file
......@@ -137,7 +137,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Margin="0,0" CaretBrush="White" Background="#1FFFFFFF" Foreground="{DynamicResource Window.Forground}" Padding="4,0" BorderThickness="0" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
<TextBox Margin="0,0" Loaded="TextBox_Loaded" CaretBrush="White" Background="#1FFFFFFF" Foreground="{DynamicResource Window.Forground}" Padding="3,0" BorderThickness="0" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -151,7 +151,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Margin="0" Background="#1FFFFFFF" BorderThickness="0" SelectionChanged="Type_SelectionChanged" ItemsSource="{Binding TagTypeList}" SelectedIndex="{Binding Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<ComboBox VerticalContentAlignment="Center" Padding="5,0" Margin="0" Background="#1FFFFFFF" BorderThickness="0" SelectionChanged="Type_SelectionChanged" ItemsSource="{Binding TagTypeList}" SelectedIndex="{Binding Type,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -164,7 +164,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Margin="0" Background="#1FFFFFFF" BorderThickness="0" SelectionChanged="Type_SelectionChanged" ItemsSource="{Binding ReadWriteModeList}" SelectedIndex="{Binding ReadWriteMode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<ComboBox VerticalContentAlignment="Center" Padding="5,0" Margin="0" Background="#1FFFFFFF" BorderThickness="0" SelectionChanged="Type_SelectionChanged" ItemsSource="{Binding ReadWriteModeList}" SelectedIndex="{Binding ReadWriteMode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -207,7 +207,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox CaretBrush="White" Background="#1FFFFFFF" Margin="-1" Foreground="{DynamicResource Window.Forground}" Text="{Binding MaxValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus,Converter={StaticResource dvc}}" IsEnabled="{Binding IsNumberTag}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
<TextBox Padding="3,0" Loaded="TextBox_Loaded" CaretBrush="White" Background="#1FFFFFFF" Margin="-1" Foreground="{DynamicResource Window.Forground}" Text="{Binding MaxValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus,Converter={StaticResource dvc}}" IsEnabled="{Binding IsNumberTag}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -220,7 +220,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox CaretBrush="White" Background="#1FFFFFFF" Margin="-1" Foreground="{DynamicResource Window.Forground}" IsEnabled="{Binding IsNumberTag}" Text="{Binding MinValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus,Converter={StaticResource dvc}}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
<TextBox Padding="3,0" Loaded="TextBox_Loaded" CaretBrush="White" Background="#1FFFFFFF" Margin="-1" Foreground="{DynamicResource Window.Forground}" IsEnabled="{Binding IsNumberTag}" Text="{Binding MinValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus,Converter={StaticResource dvc}}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -233,7 +233,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox CaretBrush="White" Background="#1FFFFFFF" Margin="-1" Foreground="{DynamicResource Window.Forground}" Text="{Binding Precision,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding IsFloatingTag}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
<TextBox Padding="3,0" Loaded="TextBox_Loaded" CaretBrush="White" Background="#1FFFFFFF" Margin="-1" Foreground="{DynamicResource Window.Forground}" Text="{Binding Precision,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding IsFloatingTag}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -256,7 +256,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Background="#1FFFFFFF" SelectionChanged="Type_SelectionChanged" Margin="0" VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding DriverList}" IsEditable="True" Text="{Binding DriverName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<ComboBox Padding="5,0" Loaded="ComboBox_Loaded" Background="#1FFFFFFF" SelectionChanged="Type_SelectionChanged" Margin="0" VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding DriverList}" IsEditable="True" Text="{Binding DriverName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -268,7 +268,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Background="#1FFFFFFF" SelectionChanged="Type_SelectionChanged" Margin="0" VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding RegistorList}" IsEditable="True" Text="{Binding RegistorName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<ComboBox Padding="5,0" Loaded="ComboBox_Loaded" Background="#1FFFFFFF" SelectionChanged="Type_SelectionChanged" Margin="0" VerticalContentAlignment="Center" BorderThickness="0" ItemsSource="{Binding RegistorList}" IsEditable="True" Text="{Binding RegistorName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......@@ -283,7 +283,7 @@
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox CaretBrush="White" Background="#1FFFFFFF" Foreground="{DynamicResource Window.Forground}" Margin="0,0" Padding="4,0" BorderThickness="0" Text="{Binding Desc,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
<TextBox Loaded="TextBox_Loaded" CaretBrush="White" Background="#1FFFFFFF" Foreground="{DynamicResource Window.Forground}" Margin="0,0" Padding="3,0" BorderThickness="0" Text="{Binding Desc,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" VerticalAlignment="Stretch" VerticalContentAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
......
......@@ -35,12 +35,39 @@ namespace DBInStudio.Desktop.View
mModel.grid = this.dg;
}
/// <summary>
///
/// </summary>
/// <param name="target"></param>
/// <param name="ll"></param>
private void GetVisualParent(DependencyObject target, List<string> ll)
{
var parent = LogicalTreeHelper.GetParent(target);
if (parent != null)
{
ll.Add(parent.ToString());
GetVisualParent(parent, ll);
}
}
private void DataGrid_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
if((e.ExtentHeight - e.VerticalOffset)<100 && e.ExtentHeight>0 && e.VerticalOffset>0)
List<string> ll = new List<string>();
GetVisualParent(e.OriginalSource as DependencyObject, ll);
if (ll.Contains("System.Windows.Controls.Primitives.Popup")) return;
var dscoll = (e.ExtentHeight - e.ViewportHeight);
if (dscoll > 0 && (dscoll - e.VerticalOffset) / dscoll < 0.25)
{
mModel.ContinueLoadData();
if (mModel.CanContinueLoadData())
mModel.ContinueLoadData();
}
//if ((e.ExtentHeight - e.VerticalOffset)<100 && e.ExtentHeight>0 && e.VerticalOffset>0)
//{
// mModel.ContinueLoadData();
//}
}
private void kwinput_KeyDown(object sender, KeyEventArgs e)
......@@ -58,8 +85,12 @@ namespace DBInStudio.Desktop.View
/// <param name="e"></param>
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
{
if (((sender as DataGrid).SelectionUnit == DataGridSelectionUnit.CellOrRowHeader) || ((sender as DataGrid).SelectionUnit == DataGridSelectionUnit.Cell))
{
(sender as DataGrid).EndInit();
(sender as DataGrid).BeginEdit();
}
mModel.SelectedCells = (sender as DataGrid).SelectedCells;
}
private void Type_SelectionChanged(object sender, SelectionChangedEventArgs e)
......@@ -69,6 +100,22 @@ namespace DBInStudio.Desktop.View
dg.CommitEdit();
}
}
private void TextBox_Loaded(object sender, RoutedEventArgs e)
{
if ((sender as TextBox).IsVisible)
{
(sender as TextBox).Focus();
}
}
private void ComboBox_Loaded(object sender, RoutedEventArgs e)
{
if ((sender as ComboBox).IsVisible)
{
(sender as ComboBox).Focus();
}
}
}
......
......@@ -983,6 +983,15 @@ namespace DBInStudio.Desktop.ViewModel
private bool mIsBusy = false;
/// <summary>
///
/// </summary>
/// <returns></returns>
public bool CanContinueLoadData()
{
return mTotalPageNumber < 0 || mCurrentPageIndex < mTotalPageNumber;
}
/// <summary>
///
/// </summary>
......
......@@ -2,7 +2,7 @@
"profiles": {
"DBInRun": {
"commandName": "Executable",
"executablePath": "C:\\Users\\cdy81\\source\\repos\\mars\\Output\\DBInRun.exe"
"executablePath": "C:\\Users\\chongdaoyang\\source\\repos\\mars\\Output\\DBInRun.exe"
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册