Commit 0c9fb158 authored by 潘栩锋's avatar 潘栩锋 🚴

添加 Reflect_SeviceClient添加IsSynced, 标识客户端的全部属性已经与服务器同步完成。

parent db7e16b8
......@@ -13,6 +13,9 @@
IsConnected=<Run Text="{Binding IsConnected,Mode=OneWay}"/>
</TextBlock>
<TextBlock>
IsSynced=<Run Text="{Binding IsSynced,Mode=OneWay}"/>
</TextBlock>
<TextBlock>
Number=<Run Text="{Binding Number,Mode=OneWay}"/>
</TextBlock>
<TextBlock>
......
......@@ -9,7 +9,7 @@
<PackageProjectUrl>http://private.flyautomation.net:82/panruising/wscf</PackageProjectUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
......
......@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
......@@ -23,7 +23,11 @@ namespace WSCF
/// </summary>
protected virtual Type InterfaceType { get; }
/// <summary>
/// 已经同步完成;
/// 已经收到了 CALL_GetAllProperties, 全部属性都与服务器一致
/// </summary>
public bool IsSynced { get; private set; }
class AnyEvent
{
public string name;
......@@ -79,7 +83,19 @@ namespace WSCF
COMMON.InitPropertyPush(rootNode);
InitEventPush();
InitCall();
this.PropertyChanged += (s, e) =>
{
if (e.PropertyName == nameof(IsConnected))
{
if (IsConnected == false)
{
IsSynced = false;
}
}
};
}
void InitPropertyChanged()
{
if (!typeof(INotifyPropertyChanged).IsAssignableFrom(InterfaceType))
......@@ -341,9 +357,15 @@ namespace WSCF
switch (pkgName)
{
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:
{
var rData = pkgData.data.ToObject<Reflect_OBJ_INTERFACE.ReflectData>();
IsSynced = true;
request_PUSH_PropertyChanged(rData);
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment