Commit 6337e659 authored by 潘栩锋's avatar 潘栩锋 🚴

添加 Reflect_SeviceClient IsSynced

parent a8a2fe2d
...@@ -22,7 +22,11 @@ namespace FObjBase.Reflect ...@@ -22,7 +22,11 @@ namespace FObjBase.Reflect
/// </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;
...@@ -67,6 +71,17 @@ namespace FObjBase.Reflect ...@@ -67,6 +71,17 @@ namespace FObjBase.Reflect
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()
{ {
...@@ -232,6 +247,11 @@ namespace FObjBase.Reflect ...@@ -232,6 +247,11 @@ namespace FObjBase.Reflect
Call(methodName, null, null, null); Call(methodName, null, null, null);
} }
void request_CALL_GetAllProperties(Reflect_OBJ_INTERFACE.ReflectData rData)
{
IsSynced = true;
request_PUSH_PropertyChanged(rData);
}
void request_PUSH_PropertyChanged(Reflect_OBJ_INTERFACE.ReflectData rData) void request_PUSH_PropertyChanged(Reflect_OBJ_INTERFACE.ReflectData rData)
{ {
ignoreSet = true; ignoreSet = true;
...@@ -356,7 +376,7 @@ namespace FObjBase.Reflect ...@@ -356,7 +376,7 @@ namespace FObjBase.Reflect
string json = Misc.Converter.BytesToString(retdata); string json = Misc.Converter.BytesToString(retdata);
var rData = JsonConvert.DeserializeObject<Reflect_OBJ_INTERFACE.ReflectData>(json); var rData = JsonConvert.DeserializeObject<Reflect_OBJ_INTERFACE.ReflectData>(json);
request_PUSH_PropertyChanged(rData); request_CALL_GetAllProperties(rData);
} }
break; break;
case Reflect_OBJ_INTERFACE.CALL_MethodInvoke: case Reflect_OBJ_INTERFACE.CALL_MethodInvoke:
......
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