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

添加 Reflect_SeviceClient IsSynced

parent a8a2fe2d
......@@ -22,7 +22,11 @@ namespace FObjBase.Reflect
/// </summary>
protected virtual Type InterfaceType { get; }
/// <summary>
/// 已经同步完成;
/// 已经收到了 CALL_GetAllProperties, 全部属性都与服务器一致
/// </summary>
public bool IsSynced { get; private set; }
class AnyEvent
{
public string name;
......@@ -67,6 +71,17 @@ namespace FObjBase.Reflect
COMMON.InitPropertyPush(rootNode);
InitEventPush();
InitCall();
this.PropertyChanged += (s, e) =>
{
if (e.PropertyName == nameof(IsConnected))
{
if (IsConnected == false)
{
IsSynced = false;
}
}
};
}
void InitPropertyChanged()
{
......@@ -232,6 +247,11 @@ namespace FObjBase.Reflect
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)
{
ignoreSet = true;
......@@ -356,7 +376,7 @@ namespace FObjBase.Reflect
string json = Misc.Converter.BytesToString(retdata);
var rData = JsonConvert.DeserializeObject<Reflect_OBJ_INTERFACE.ReflectData>(json);
request_PUSH_PropertyChanged(rData);
request_CALL_GetAllProperties(rData);
}
break;
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