Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
W
WSCF
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
WSCF
Commits
0c9fb158
Commit
0c9fb158
authored
May 27, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 Reflect_SeviceClient添加IsSynced, 标识客户端的全部属性已经与服务器同步完成。
parent
db7e16b8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
4 deletions
+29
-4
MainWindow.xaml
WSCF.Test.Client/MainWindow.xaml
+3
-0
WSCF.standard.csproj
WSCF.standard/WSCF.standard.csproj
+1
-1
AssemblyInfo.cs
WSCF/Properties/AssemblyInfo.cs
+2
-2
Reflect_SeviceClient.cs
WSCF/Reflect_SeviceClient.cs
+23
-1
No files found.
WSCF.Test.Client/MainWindow.xaml
View file @
0c9fb158
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
IsConnected=<Run Text="{Binding IsConnected,Mode=OneWay}"/>
IsConnected=<Run Text="{Binding IsConnected,Mode=OneWay}"/>
</TextBlock>
</TextBlock>
<TextBlock>
<TextBlock>
IsSynced=<Run Text="{Binding IsSynced,Mode=OneWay}"/>
</TextBlock>
<TextBlock>
Number=<Run Text="{Binding Number,Mode=OneWay}"/>
Number=<Run Text="{Binding Number,Mode=OneWay}"/>
</TextBlock>
</TextBlock>
<TextBlock>
<TextBlock>
...
...
WSCF.standard/WSCF.standard.csproj
View file @
0c9fb158
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<PackageProjectUrl>http://private.flyautomation.net:82/panruising/wscf</PackageProjectUrl>
<PackageProjectUrl>http://private.flyautomation.net:82/panruising/wscf</PackageProjectUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Version>2.0.
0
</Version>
<Version>2.0.
1
</Version>
</PropertyGroup>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
...
...
WSCF/Properties/AssemblyInfo.cs
View file @
0c9fb158
...
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
...
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.
0
.0")]
[assembly: AssemblyVersion("2.0.
1
.0")]
[assembly: AssemblyFileVersion("2.0.
0
.0")]
[assembly: AssemblyFileVersion("2.0.
1
.0")]
WSCF/Reflect_SeviceClient.cs
View file @
0c9fb158
...
@@ -23,7 +23,11 @@ namespace WSCF
...
@@ -23,7 +23,11 @@ namespace WSCF
/// </summary>
/// </summary>
protected
virtual
Type
InterfaceType
{
get
;
}
protected
virtual
Type
InterfaceType
{
get
;
}
/// <summary>
/// 已经同步完成;
/// 已经收到了 CALL_GetAllProperties, 全部属性都与服务器一致
/// </summary>
public
bool
IsSynced
{
get
;
private
set
;
}
class
AnyEvent
class
AnyEvent
{
{
public
string
name
;
public
string
name
;
...
@@ -79,7 +83,19 @@ namespace WSCF
...
@@ -79,7 +83,19 @@ namespace WSCF
COMMON
.
InitPropertyPush
(
rootNode
);
COMMON
.
InitPropertyPush
(
rootNode
);
InitEventPush
();
InitEventPush
();
InitCall
();
InitCall
();
this
.
PropertyChanged
+=
(
s
,
e
)
=>
{
if
(
e
.
PropertyName
==
nameof
(
IsConnected
))
{
if
(
IsConnected
==
false
)
{
IsSynced
=
false
;
}
}
};
}
}
void
InitPropertyChanged
()
void
InitPropertyChanged
()
{
{
if
(!
typeof
(
INotifyPropertyChanged
).
IsAssignableFrom
(
InterfaceType
))
if
(!
typeof
(
INotifyPropertyChanged
).
IsAssignableFrom
(
InterfaceType
))
...
@@ -341,9 +357,15 @@ namespace WSCF
...
@@ -341,9 +357,15 @@ namespace WSCF
switch
(
pkgName
)
switch
(
pkgName
)
{
{
case
Reflect_OBJ_INTERFACE
.
PkgName
.
PUSH_PropertyChanged
:
case
Reflect_OBJ_INTERFACE
.
PkgName
.
PUSH_PropertyChanged
:
{
var
rData
=
pkgData
.
data
.
ToObject
<
Reflect_OBJ_INTERFACE
.
ReflectData
>();
request_PUSH_PropertyChanged
(
rData
);
}
break
;
case
Reflect_OBJ_INTERFACE
.
PkgName
.
CALL_GetAllProperties
:
case
Reflect_OBJ_INTERFACE
.
PkgName
.
CALL_GetAllProperties
:
{
{
var
rData
=
pkgData
.
data
.
ToObject
<
Reflect_OBJ_INTERFACE
.
ReflectData
>();
var
rData
=
pkgData
.
data
.
ToObject
<
Reflect_OBJ_INTERFACE
.
ReflectData
>();
IsSynced
=
true
;
request_PUSH_PropertyChanged
(
rData
);
request_PUSH_PropertyChanged
(
rData
);
}
}
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment