Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cdy816
Mars
提交
873b3da0
Mars
项目概览
cdy816
/
Mars
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
873b3da0
编写于
9月 15, 2020
作者:
cdy816
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成开发环境配置数据服务端口等参数
上级
3bb0addf
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
516 addition
and
293 deletion
+516
-293
Common/Cdy.Tag.Driver/IProducterDriver.cs
Common/Cdy.Tag.Driver/IProducterDriver.cs
+7
-0
Develop/DBDevelopClientApi/DevelopServiceHelper.cs
Develop/DBDevelopClientApi/DevelopServiceHelper.cs
+1
-1
Develop/DBDevelopService/Driver/DriverManager.cs
Develop/DBDevelopService/Driver/DriverManager.cs
+1
-0
Develop/DBDevelopService/Services/DevelopServerService.cs
Develop/DBDevelopService/Services/DevelopServerService.cs
+1
-1
Develop/DbManager.Desktop/DBInStudio.Desktop.csproj
Develop/DbManager.Desktop/DBInStudio.Desktop.csproj
+2
-0
Develop/DbManager.Desktop/Image/setting.png
Develop/DbManager.Desktop/Image/setting.png
+0
-0
Develop/DbManager.Desktop/MainWindow.xaml
Develop/DbManager.Desktop/MainWindow.xaml
+16
-8
Develop/DbManager.Desktop/Properties/Resources.Designer.cs
Develop/DbManager.Desktop/Properties/Resources.Designer.cs
+9
-0
Develop/DbManager.Desktop/Properties/Resources.resx
Develop/DbManager.Desktop/Properties/Resources.resx
+3
-0
Develop/DbManager.Desktop/Properties/Resources.zh-CN.resx
Develop/DbManager.Desktop/Properties/Resources.zh-CN.resx
+3
-0
Develop/DbManager.Desktop/Properties/launchSettings.json
Develop/DbManager.Desktop/Properties/launchSettings.json
+1
-1
Develop/DbManager.Desktop/Themes/Generic.xaml
Develop/DbManager.Desktop/Themes/Generic.xaml
+5
-0
Develop/DbManager.Desktop/View/DatabaseSettingView.xaml
Develop/DbManager.Desktop/View/DatabaseSettingView.xaml
+77
-0
Develop/DbManager.Desktop/View/DatabaseSettingView.xaml.cs
Develop/DbManager.Desktop/View/DatabaseSettingView.xaml.cs
+26
-0
Develop/DbManager.Desktop/ViewModel/DatabaseSettingConfigViewModel.cs
...nager.Desktop/ViewModel/DatabaseSettingConfigViewModel.cs
+276
-0
Develop/DbManager.Desktop/ViewModel/DatabaseSettingViewModel.cs
...p/DbManager.Desktop/ViewModel/DatabaseSettingViewModel.cs
+0
-279
Develop/DbManager.Desktop/ViewModel/MainViewModel.cs
Develop/DbManager.Desktop/ViewModel/MainViewModel.cs
+9
-0
Driver/SimDriver/Driver.cs
Driver/SimDriver/Driver.cs
+5
-0
Driver/SpiderDriver/Driver.cs
Driver/SpiderDriver/Driver.cs
+69
-3
RunTime/DBRuntime.Proxy/Driver/NetTransformDriver.cs
RunTime/DBRuntime.Proxy/Driver/NetTransformDriver.cs
+5
-0
未找到文件。
Common/Cdy.Tag.Driver/IProducterDriver.cs
浏览文件 @
873b3da0
...
...
@@ -36,6 +36,13 @@ namespace Cdy.Tag.Driver
#
endregion
...
Properties
...
#
region
...
Methods
...
/// <summary>
///
/// </summary>
/// <returns></returns>
bool
Init
();
/// <summary>
///
/// </summary>
...
...
Develop/DBDevelopClientApi/DevelopServiceHelper.cs
浏览文件 @
873b3da0
...
...
@@ -1313,7 +1313,7 @@ namespace DBDevelopClientApi
Dictionary
<
string
,
string
>
re
=
new
Dictionary
<
string
,
string
>();
if
(
mCurrentClient
!=
null
&&
!
string
.
IsNullOrEmpty
(
mLoginId
))
{
var
res
=
mCurrentClient
.
GetDriverSetting
(
new
DBDevelopService
.
GetDriverSettingRequest
()
{
Database
=
database
,
LoginId
=
mLoginId
});
var
res
=
mCurrentClient
.
GetDriverSetting
(
new
DBDevelopService
.
GetDriverSettingRequest
()
{
Database
=
database
,
LoginId
=
mLoginId
,
Driver
=
driver
});
var
sval
=
res
.
SettingString
;
if
(!
string
.
IsNullOrEmpty
(
sval
))
{
...
...
Develop/DBDevelopService/Driver/DriverManager.cs
浏览文件 @
873b3da0
...
...
@@ -81,6 +81,7 @@ namespace Cdy.Tag
if
(!
mDrivers
.
ContainsKey
(
driver
.
Name
))
{
mDrivers
.
Add
(
driver
.
Name
,
driver
);
driver
.
Init
();
}
}
else
...
...
Develop/DBDevelopService/Services/DevelopServerService.cs
浏览文件 @
873b3da0
...
...
@@ -2037,7 +2037,7 @@ namespace DBDevelopService
dd
.
UpdateConfig
(
request
.
Database
,
dtmp
);
}
}
return
base
.
UpdateDrvierSetting
(
request
,
context
);
return
Task
.
FromResult
(
new
BoolResultReplay
()
{
Result
=
true
}
);
}
}
...
...
Develop/DbManager.Desktop/DBInStudio.Desktop.csproj
浏览文件 @
873b3da0
...
...
@@ -44,6 +44,7 @@
<None Remove="Image\save.png" />
<None Remove="Image\Security.png" />
<None Remove="Image\server-security.png" />
<None Remove="Image\setting.png" />
<None Remove="Image\show.png" />
<None Remove="Image\start.png" />
<None Remove="Image\start2.png" />
...
...
@@ -91,6 +92,7 @@
<Resource Include="Image\save.png" />
<Resource Include="Image\Security.png" />
<Resource Include="Image\server-security.png" />
<Resource Include="Image\setting.png" />
<Resource Include="Image\show.png" />
<Resource Include="Image\start.png" />
<Resource Include="Image\start2.png" />
...
...
Develop/DbManager.Desktop/Image/setting.png
0 → 100644
浏览文件 @
873b3da0
425 字节
Develop/DbManager.Desktop/MainWindow.xaml
浏览文件 @
873b3da0
...
...
@@ -319,8 +319,8 @@
<MenuItem Header="{local:ResMarker Paste}" Command="{Binding PasteCommand}" />
</ContextMenu>
<HierarchicalDataTemplate DataType="{x:Type local:TagGroupViewModel}" ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal" Height="24">
<HierarchicalDataTemplate DataType="{x:Type local:TagGroupViewModel}" ItemsSource="{Binding Children}"
>
<StackPanel Orientation="Horizontal" Height="24"
Background="Transparent"
>
<Image Focusable="False" Source="/Image/文件夹.png" Margin="0,0,4,0" Height="18" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<Grid ContextMenu="{StaticResource groupMenu}" Background="{Binding Background}" VerticalAlignment="Center" Focusable="False" Name="spanel" >
<TextBlock Foreground="{DynamicResource Window.Forground}" Text="{Binding Name}" VerticalAlignment="Center" />
...
...
@@ -337,7 +337,7 @@
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:ServerSecurityTreeViewModel}" ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal" Height="24">
<StackPanel Orientation="Horizontal" Height="24"
Background="Transparent"
>
<Image Focusable="False" Source="/Image/server-security.png" VerticalAlignment="Center" Margin="0,0,4,0" Height="16" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<TextBlock Foreground="{DynamicResource Window.Forground}" Text="{local:ResMarker ServerSecurity}" VerticalAlignment="Center" />
</StackPanel>
...
...
@@ -352,35 +352,43 @@
<DataTemplate DataType="{x:Type local:ServerUserManagerTreeViewModel}" >
<StackPanel Orientation="Horizontal" Height="24">
<StackPanel Orientation="Horizontal" Height="24"
Background="Transparent"
>
<Image Focusable="False" Source="/Image/user.png" VerticalAlignment="Center" Margin="0,0,4,0" Height="16" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<TextBlock Foreground="{DynamicResource Window.Forground}" Text="{local:ResMarker User}" VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
<DataTemplate DataType="{x:Type local:DatabaseSettingViewModel}" >
<StackPanel Orientation="Horizontal" Height="24" Background="Transparent">
<Image Focusable="False" Source="/Image/setting.png" VerticalAlignment="Center" Margin="0,0,4,0" Height="16" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<TextBlock Foreground="{DynamicResource Window.Forground}" Text="{local:ResMarker Setting}" VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:RootTagGroupViewModel}" ItemsSource="{Binding Children}">
<StackPanel ContextMenu="{StaticResource rootgroupMenu}" Orientation="Horizontal" Height="24">
<StackPanel ContextMenu="{StaticResource rootgroupMenu}" Orientation="Horizontal" Height="24"
Background="Transparent"
>
<Image Focusable="False" Source="/Image/文件夹.png" VerticalAlignment="Center" Margin="0,0,4,0" Height="18" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<TextBlock Foreground="{DynamicResource Window.Forground}" Text="{Binding Name}" VerticalAlignment="Center" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:SecurityTreeItemViewModel}" ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal" Height="24">
<StackPanel Orientation="Horizontal" Height="24"
Background="Transparent"
>
<Image Focusable="False" Source="/Image/Security.png" VerticalAlignment="Center" Margin="0,0,4,0" Height="18" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<TextBlock Foreground="{DynamicResource Window.Forground}" Text="{Binding Name}" VerticalAlignment="Center" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:UserGroupRootViewModel}" ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal" Height="24">
<StackPanel Orientation="Horizontal" Height="24"
Background="Transparent"
>
<Image Focusable="False" Source="/Image/user.png" VerticalAlignment="Center" Margin="0,0,4,0" Height="18" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<TextBlock Foreground="{DynamicResource Window.Forground}" Text="{local:ResMarker User}" VerticalAlignment="Center" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:PermissionTreeItemViewModel}" ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal" Height="24">
<StackPanel Orientation="Horizontal" Height="24"
Background="Transparent"
>
<Image Focusable="False" Source="/Image/permissions.png" VerticalAlignment="Center" Margin="0,0,4,0" Height="18" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<TextBlock Foreground="{DynamicResource Window.Forground}" Text="{local:ResMarker Permission}" VerticalAlignment="Center" />
</StackPanel>
...
...
Develop/DbManager.Desktop/Properties/Resources.Designer.cs
浏览文件 @
873b3da0
...
...
@@ -744,6 +744,15 @@ namespace DBInStudio.Desktop.Properties {
}
}
/// <summary>
/// 查找类似 ServerPort 的本地化字符串。
/// </summary>
internal
static
string
ServerPort
{
get
{
return
ResourceManager
.
GetString
(
"ServerPort"
,
resourceCulture
);
}
}
/// <summary>
/// 查找类似 ServerSecurity 的本地化字符串。
/// </summary>
...
...
Develop/DbManager.Desktop/Properties/Resources.resx
浏览文件 @
873b3da0
...
...
@@ -348,6 +348,9 @@
<data
name=
"ServerIp"
xml:space=
"preserve"
>
<value>
Server Ip
</value>
</data>
<data
name=
"ServerPort"
xml:space=
"preserve"
>
<value>
ServerPort
</value>
</data>
<data
name=
"ServerSecurity"
xml:space=
"preserve"
>
<value>
ServerSecurity
</value>
</data>
...
...
Develop/DbManager.Desktop/Properties/Resources.zh-CN.resx
浏览文件 @
873b3da0
...
...
@@ -348,6 +348,9 @@
<data
name=
"ServerIp"
xml:space=
"preserve"
>
<value>
服务器IP
</value>
</data>
<data
name=
"ServerPort"
xml:space=
"preserve"
>
<value>
服务端口
</value>
</data>
<data
name=
"ServerSecurity"
xml:space=
"preserve"
>
<value>
服务器安全
</value>
</data>
...
...
Develop/DbManager.Desktop/Properties/launchSettings.json
浏览文件 @
873b3da0
...
...
@@ -2,7 +2,7 @@
"profiles"
:
{
"DBInStudio.Desktop"
:
{
"commandName"
:
"Executable"
,
"executablePath"
:
"C:
\\
Users
\\
c
hongdaoyang
\\
source
\\
repos
\\
mars
\\
Output
\\
DBInStudio.exe"
"executablePath"
:
"C:
\\
Users
\\
c
dy81
\\
source
\\
repos
\\
mars
\\
Output
\\
DBInStudio.exe"
}
}
}
\ No newline at end of file
Develop/DbManager.Desktop/Themes/Generic.xaml
浏览文件 @
873b3da0
...
...
@@ -67,6 +67,11 @@
<view:MarInfoView />
</DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:DatabaseSettingConfigViewModel}">
<view:DatabaseSettingView />
</DataTemplate>
<BooleanToVisibilityConverter x:Key="bvc" />
...
...
Develop/DbManager.Desktop/View/DatabaseSettingView.xaml
0 → 100644
浏览文件 @
873b3da0
<UserControl x:Class="DBInStudio.Desktop.View.DatabaseSettingView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DBInStudio.Desktop"
xmlns:viewmodel="clr-namespace:DBInStudio.Desktop.ViewModel"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<Style x:Key="ListBoxItemContainerStyle1" TargetType="{x:Type ListBoxItem}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Padding" Value="4,1"/>
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate DataType="{x:Type viewmodel:DriverSetViewModel}">
<Grid HorizontalAlignment="Stretch" Background="Transparent" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,0.5" BorderBrush="LightGray" SnapsToDevicePixels="True" UseLayoutRounding="True">
<TextBlock Margin="10,0,2,5" Text="{Binding Name}" HorizontalAlignment="Stretch" VerticalAlignment="Center" Foreground="{DynamicResource Window.Forground}"/>
</Border>
<ListBox Grid.Row="1" BorderThickness="0" Background="{x:Null}" ItemsSource="{Binding Children}" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}">
</ListBox>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:DriverSettingItem}">
<Grid Height="32">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" VerticalAlignment="Center" Foreground="{DynamicResource Window.Forground}"/>
<TextBox CaretBrush="{DynamicResource Window.Forground}" VerticalContentAlignment="Center" Background="#1FFFFFFF" Foreground="{DynamicResource Window.Forground}" Height="24" VerticalAlignment="Center" Text="{Binding Value,Mode=TwoWay}" Grid.Column="1" Width="160" />
</Grid>
</DataTemplate>
</UserControl.Resources>
<Grid Background="#7F000000" SnapsToDevicePixels="True" UseLayoutRounding="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="{local:ResMarker ServerPort,:}" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center"/>
<TextBox CaretBrush="{DynamicResource Window.Forground}" Background="#1FFFFFFF" Foreground="{DynamicResource Window.Forground}" Height="24" VerticalContentAlignment="Center" Grid.Column="1" HorizontalAlignment="Left" Margin="10,0,0,0" Text="{Binding ServerPort,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" TextWrapping="Wrap" VerticalAlignment="Center" Width="120"/>
<ListBox HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,10" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" Background="{x:Null}" BorderThickness="0" Grid.Row="1" Grid.ColumnSpan="2" ItemsSource="{Binding Children}">
</ListBox>
</Grid>
</UserControl>
Develop/DbManager.Desktop/View/DatabaseSettingView.xaml.cs
0 → 100644
浏览文件 @
873b3da0
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
namespace
DBInStudio.Desktop.View
{
/// <summary>
/// DatabaseSettingView.xaml 的交互逻辑
/// </summary>
public
partial
class
DatabaseSettingView
:
UserControl
{
public
DatabaseSettingView
()
{
InitializeComponent
();
}
}
}
Develop/DbManager.Desktop/ViewModel/DatabaseSettingConfigViewModel.cs
0 → 100644
浏览文件 @
873b3da0
//==============================================================
// Copyright (C) 2020 Chongdaoyang Inc. All rights reserved.
//
//==============================================================
// Create by 种道洋 at 2020/9/15 21:23:53 .
// Version 1.0
// CDYWORK
//==============================================================
using
DBDevelopClientApi
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Text
;
namespace
DBInStudio.Desktop.ViewModel
{
/// <summary>
///
/// </summary>
public
class
DatabaseSettingConfigViewModel
:
ViewModelBase
,
IModeSwitch
{
#
region
...
Variables
...
private
int
mServerPort
=
0
;
private
ObservableCollection
<
DriverSetViewModel
>
mChildren
=
new
ObservableCollection
<
DriverSetViewModel
>();
#
endregion
...
Variables
...
#
region
...
Events
...
#
endregion
...
Events
...
#
region
...
Constructor
...
#
endregion
...
Constructor
...
#
region
...
Properties
...
/// <summary>
///
/// </summary>
public
ObservableCollection
<
DriverSetViewModel
>
Children
{
get
{
return
mChildren
;
}
}
/// <summary>
///
/// </summary>
public
string
Database
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
int
ServerPort
{
get
{
return
mServerPort
;
}
set
{
if
(
mServerPort
!=
value
)
{
if
(
DevelopServiceHelper
.
Helper
.
SetRealServerPort
(
this
.
Database
,
value
))
{
mServerPort
=
value
;
}
OnPropertyChanged
(
"ServerPort"
);
}
}
}
#
endregion
...
Properties
...
#
region
...
Methods
...
/// <summary>
///
/// </summary>
private
void
Init
()
{
mServerPort
=
DevelopServiceHelper
.
Helper
.
GetRealServerPort
(
this
.
Database
);
OnPropertyChanged
(
"ServerPort"
);
var
dds
=
DevelopServiceHelper
.
Helper
.
GetRegistorDrivers
(
this
.
Database
).
Keys
;
mChildren
.
Clear
();
foreach
(
var
vv
in
dds
)
{
var
ss
=
DevelopServiceHelper
.
Helper
.
GetDriverSetting
(
this
.
Database
,
vv
);
if
(
ss
!=
null
&&
ss
.
Count
>
0
)
{
DriverSetViewModel
dsm
=
new
DriverSetViewModel
()
{
Name
=
vv
};
dsm
.
Init
(
ss
);
mChildren
.
Add
(
dsm
);
}
}
}
#
endregion
...
Methods
...
#
region
...
Interfaces
...
#
endregion
...
Interfaces
...
/// <summary>
///
/// </summary>
public
void
Active
()
{
Init
();
}
/// <summary>
///
/// </summary>
public
void
DeActive
()
{
foreach
(
var
vv
in
mChildren
)
{
var
item
=
vv
.
ToDictionary
();
DevelopServiceHelper
.
Helper
.
UpdateDriverSetting
(
this
.
Database
,
vv
.
Name
,
item
);
}
}
}
/// <summary>
///
/// </summary>
public
class
DriverSetViewModel
:
ViewModelBase
{
#
region
...
Variables
...
private
string
mName
;
private
ObservableCollection
<
DriverSettingItem
>
mChildren
=
new
ObservableCollection
<
DriverSettingItem
>();
#
endregion
...
Variables
...
#
region
...
Events
...
#
endregion
...
Events
...
#
region
...
Constructor
...
#
endregion
...
Constructor
...
#
region
...
Properties
...
/// <summary>
///
/// </summary>
public
string
Name
{
get
{
return
mName
;
}
set
{
if
(
mName
!=
value
)
{
mName
=
value
;
OnPropertyChanged
(
"Name"
);
}
}
}
/// <summary>
///
/// </summary>
public
ObservableCollection
<
DriverSettingItem
>
Children
{
get
{
return
mChildren
;
}
}
#
endregion
...
Properties
...
#
region
...
Methods
...
/// <summary>
///
/// </summary>
/// <param name="vals"></param>
public
void
Init
(
Dictionary
<
string
,
string
>
vals
)
{
mChildren
.
Clear
();
foreach
(
var
vv
in
vals
)
{
mChildren
.
Add
(
new
DriverSettingItem
()
{
Name
=
vv
.
Key
,
Value
=
vv
.
Value
});
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public
Dictionary
<
string
,
string
>
ToDictionary
()
{
Dictionary
<
string
,
string
>
dtmp
=
new
Dictionary
<
string
,
string
>();
foreach
(
var
vv
in
mChildren
)
{
dtmp
.
Add
(
vv
.
Name
,
vv
.
Value
);
}
return
dtmp
;
}
#
endregion
...
Methods
...
#
region
...
Interfaces
...
#
endregion
...
Interfaces
...
}
public
class
DriverSettingItem
:
ViewModelBase
{
#
region
...
Variables
...
private
string
mValue
;
#
endregion
...
Variables
...
#
region
...
Events
...
#
endregion
...
Events
...
#
region
...
Constructor
...
#
endregion
...
Constructor
...
#
region
...
Properties
...
/// <summary>
///
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
Value
{
get
{
return
mValue
;
}
set
{
if
(
mValue
!=
value
)
{
mValue
=
value
;
OnPropertyChanged
(
"Value"
);
}
}
}
#
endregion
...
Properties
...
#
region
...
Methods
...
#
endregion
...
Methods
...
#
region
...
Interfaces
...
#
endregion
...
Interfaces
...
}
}
Develop/DbManager.Desktop/ViewModel/DatabaseSettingViewModel.cs
浏览文件 @
873b3da0
...
...
@@ -25,8 +25,6 @@ namespace DBInStudio.Desktop
#
region
...
Variables
...
private
int
mServerPort
;
#
endregion
...
Variables
...
#
region
...
Events
...
...
...
@@ -43,26 +41,6 @@ namespace DBInStudio.Desktop
#
region
...
Properties
...
/// <summary>
///
/// </summary>
public
int
ServerPort
{
get
{
return
mServerPort
;
}
set
{
if
(
mServerPort
!=
value
)
{
mServerPort
=
value
;
OnPropertyChanged
(
"ServerPort"
);
}
}
}
#
endregion
...
Properties
...
#
region
...
Methods
...
...
...
@@ -94,264 +72,7 @@ namespace DBInStudio.Desktop
#
endregion
...
Interfaces
...
}
/// <summary>
///
/// </summary>
public
class
DatabaseSettingConfigViewModel
:
ViewModelBase
,
IModeSwitch
{
#
region
...
Variables
...
private
int
mServerPort
=
0
;
private
ObservableCollection
<
DriverSetViewModel
>
mChildren
=
new
ObservableCollection
<
DriverSetViewModel
>();
#
endregion
...
Variables
...
#
region
...
Events
...
#
endregion
...
Events
...
#
region
...
Constructor
...
#
endregion
...
Constructor
...
#
region
...
Properties
...
/// <summary>
///
/// </summary>
public
ObservableCollection
<
DriverSetViewModel
>
Children
{
get
{
return
mChildren
;
}
}
/// <summary>
///
/// </summary>
public
string
Database
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
int
ServerPort
{
get
{
return
mServerPort
;
}
set
{
if
(
mServerPort
!=
value
)
{
if
(
DevelopServiceHelper
.
Helper
.
SetRealServerPort
(
this
.
Database
,
value
))
{
mServerPort
=
value
;
}
OnPropertyChanged
(
"ServerPort"
);
}
}
}
#
endregion
...
Properties
...
#
region
...
Methods
...
/// <summary>
///
/// </summary>
private
void
Init
()
{
mServerPort
=
DevelopServiceHelper
.
Helper
.
GetRealServerPort
(
this
.
Database
);
OnPropertyChanged
(
"ServerPort"
);
var
dds
=
DevelopServiceHelper
.
Helper
.
GetRegistorDrivers
(
this
.
Database
).
Keys
;
mChildren
.
Clear
();
foreach
(
var
vv
in
dds
)
{
var
ss
=
DevelopServiceHelper
.
Helper
.
GetDriverSetting
(
this
.
Database
,
vv
);
if
(
ss
!=
null
&&
ss
.
Count
>
0
)
{
DriverSetViewModel
dsm
=
new
DriverSetViewModel
()
{
Name
=
vv
};
dsm
.
Init
(
ss
);
mChildren
.
Add
(
dsm
);
}
}
}
#
endregion
...
Methods
...
#
region
...
Interfaces
...
#
endregion
...
Interfaces
...
/// <summary>
///
/// </summary>
public
void
Active
()
{
Init
();
}
/// <summary>
///
/// </summary>
public
void
DeActive
()
{
foreach
(
var
vv
in
mChildren
)
{
var
item
=
vv
.
ToDictionary
();
DevelopServiceHelper
.
Helper
.
UpdateDriverSetting
(
this
.
Database
,
vv
.
Name
,
item
);
}
}
}
/// <summary>
///
/// </summary>
public
class
DriverSetViewModel
:
ViewModelBase
{
#
region
...
Variables
...
private
string
mName
;
private
ObservableCollection
<
DriverSettingItem
>
mChildren
=
new
ObservableCollection
<
DriverSettingItem
>();
#
endregion
...
Variables
...
#
region
...
Events
...
#
endregion
...
Events
...
#
region
...
Constructor
...
#
endregion
...
Constructor
...
#
region
...
Properties
...
/// <summary>
///
/// </summary>
public
string
Name
{
get
{
return
mName
;
}
set
{
if
(
mName
!=
value
)
{
mName
=
value
;
OnPropertyChanged
(
"Name"
);
}
}
}
/// <summary>
///
/// </summary>
public
ObservableCollection
<
DriverSettingItem
>
Children
{
get
{
return
mChildren
;
}
}
#
endregion
...
Properties
...
#
region
...
Methods
...
/// <summary>
///
/// </summary>
/// <param name="vals"></param>
public
void
Init
(
Dictionary
<
string
,
string
>
vals
)
{
mChildren
.
Clear
();
foreach
(
var
vv
in
vals
)
{
mChildren
.
Add
(
new
DriverSettingItem
()
{
Name
=
vv
.
Key
,
Value
=
vv
.
Value
});
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public
Dictionary
<
string
,
string
>
ToDictionary
()
{
Dictionary
<
string
,
string
>
dtmp
=
new
Dictionary
<
string
,
string
>();
foreach
(
var
vv
in
mChildren
)
{
dtmp
.
Add
(
vv
.
Name
,
vv
.
Value
);
}
return
dtmp
;
}
#
endregion
...
Methods
...
#
region
...
Interfaces
...
#
endregion
...
Interfaces
...
}
public
class
DriverSettingItem
:
ViewModelBase
{
#
region
...
Variables
...
private
string
mValue
;
#
endregion
...
Variables
...
#
region
...
Events
...
#
endregion
...
Events
...
#
region
...
Constructor
...
#
endregion
...
Constructor
...
#
region
...
Properties
...
/// <summary>
///
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
Value
{
get
{
return
mValue
;
}
set
{
if
(
mValue
!=
value
)
{
mValue
=
value
;
OnPropertyChanged
(
"Value"
);
}
}
}
#
endregion
...
Properties
...
#
region
...
Methods
...
#
endregion
...
Methods
...
#
region
...
Interfaces
...
#
endregion
...
Interfaces
...
}
}
Develop/DbManager.Desktop/ViewModel/MainViewModel.cs
浏览文件 @
873b3da0
...
...
@@ -658,6 +658,9 @@ namespace DBInStudio.Desktop
securityModel
.
Database
=
mDatabase
;
securityModel
.
Init
();
dbitem
.
Children
.
Add
(
new
DatabaseSettingViewModel
()
{
Database
=
this
.
Database
});
Task
.
Run
(()
=>
{
TagViewModel
.
Drivers
=
DevelopServiceHelper
.
Helper
.
GetRegistorDrivers
(
mDatabase
);
QueryGroups
();
...
...
@@ -839,6 +842,9 @@ namespace DBInStudio.Desktop
dbitem
.
Children
.
Add
(
securityModel
);
securityModel
.
Database
=
mDatabase
;
securityModel
.
Init
();
dbitem
.
Children
.
Add
(
new
DatabaseSettingViewModel
()
{
Database
=
this
.
Database
});
Task
.
Run
(()
=>
{
TagViewModel
.
Drivers
=
DevelopServiceHelper
.
Helper
.
GetRegistorDrivers
(
mDatabase
);
QueryGroups
();
...
...
@@ -935,6 +941,9 @@ namespace DBInStudio.Desktop
dbitem
.
Children
.
Add
(
securityModel
);
securityModel
.
Database
=
mDatabase
;
securityModel
.
Init
();
dbitem
.
Children
.
Add
(
new
DatabaseSettingViewModel
()
{
Database
=
this
.
Database
});
Task
.
Run
(()
=>
{
TagViewModel
.
Drivers
=
DevelopServiceHelper
.
Helper
.
GetRegistorDrivers
(
mDatabase
);
QueryGroups
();
...
...
Driver/SimDriver/Driver.cs
浏览文件 @
873b3da0
...
...
@@ -317,6 +317,11 @@ namespace SimDriver
}
public
bool
Init
()
{
return
true
;
}
#
endregion
...
Methods
...
...
...
Driver/SpiderDriver/Driver.cs
浏览文件 @
873b3da0
...
...
@@ -27,7 +27,7 @@ namespace SpiderDriver
private
List
<
DataService
>
mService
;
p
ublic
void
Load
()
p
rivate
void
Load
()
{
string
sfileName
=
Assembly
.
GetEntryAssembly
().
Location
;
...
...
@@ -71,6 +71,53 @@ namespace SpiderDriver
Save
(
PathHelper
.
helper
.
GetApplicationFilePath
(
"Config"
,
"SpiderDriver.cfg"
));
}
/// <summary>
///
/// </summary>
/// <param name="database"></param>
public
void
SaveForDatabase
(
string
database
)
{
Save
(
System
.
IO
.
Path
.
Combine
(
PathHelper
.
helper
.
GetDatabasePath
(
database
),
"SpiderDriver.cfg"
));
}
/// <summary>
///
/// </summary>
/// <param name="database"></param>
/// <returns></returns>
public
Dictionary
<
string
,
string
>
LoadFromDatabase
(
string
database
)
{
Dictionary
<
string
,
string
>
re
=
new
Dictionary
<
string
,
string
>();
var
sfileName
=
System
.
IO
.
Path
.
Combine
(
PathHelper
.
helper
.
GetDatabasePath
(
database
),
"SpiderDriver.cfg"
);
if
(
System
.
IO
.
File
.
Exists
(
sfileName
))
{
XElement
xe
=
XElement
.
Load
(
sfileName
);
if
(
xe
.
Element
(
"Server"
)
!=
null
)
{
xe
=
xe
.
Element
(
"Server"
);
if
(
xe
.
Attribute
(
"StartPort"
)
!=
null
)
{
var
mPort
=
int
.
Parse
(
xe
.
Attribute
(
"StartPort"
).
Value
);
re
.
Add
(
"StartPort"
,
mPort
.
ToString
());
}
if
(
xe
.
Attribute
(
"EndPort"
)
!=
null
)
{
var
mEndPort
=
int
.
Parse
(
xe
.
Attribute
(
"EndPort"
).
Value
);
re
.
Add
(
"EndPort"
,
mEndPort
.
ToString
());
}
}
}
else
{
re
.
Add
(
"StartPort"
,
mPort
.
ToString
());
re
.
Add
(
"EndPort"
,
mEndPort
.
ToString
());
}
return
re
;
}
/// <summary>
///
/// </summary>
...
...
@@ -132,7 +179,7 @@ namespace SpiderDriver
/// <returns></returns>
public
Dictionary
<
string
,
string
>
GetConfig
(
string
database
)
{
throw
new
NotImplementedException
(
);
return
LoadFromDatabase
(
database
);
}
/// <summary>
...
...
@@ -142,7 +189,26 @@ namespace SpiderDriver
/// <param name="config"></param>
public
void
UpdateConfig
(
string
database
,
Dictionary
<
string
,
string
>
config
)
{
throw
new
NotImplementedException
();
if
(
config
.
ContainsKey
(
"StartPort"
))
{
mPort
=
int
.
Parse
(
config
[
"StartPort"
]);
}
if
(
config
.
ContainsKey
(
"EndPort"
))
{
mEndPort
=
int
.
Parse
(
config
[
"EndPort"
]);
}
SaveForDatabase
(
database
);
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public
bool
Init
()
{
Load
();
return
true
;
}
}
}
RunTime/DBRuntime.Proxy/Driver/NetTransformDriver.cs
浏览文件 @
873b3da0
...
...
@@ -396,6 +396,11 @@ namespace DBRuntime.Proxy
{
}
public
bool
Init
()
{
return
true
;
}
}
public
static
class
ApiClientExtends
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录