Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
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
潘栩锋
Thick-Common
Commits
9bbbd8c5
Commit
9bbbd8c5
authored
Dec 17, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 IsInPushValue, 当PropertyChanged 被触发,能知道是否远程推送过来,导致的改变
parent
52fa4a1a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
SyncPropServiceClient.cs
...JComponents/OBJComponents/Client/SyncPropServiceClient.cs
+13
-3
No files found.
Project.FLY.OBJComponents/OBJComponents/Client/SyncPropServiceClient.cs
View file @
9bbbd8c5
...
@@ -17,7 +17,13 @@ namespace FLY.OBJComponents.Client
...
@@ -17,7 +17,13 @@ namespace FLY.OBJComponents.Client
IFConn
mConn
;
IFConn
mConn
;
UInt32
mServerID
;
UInt32
mServerID
;
public
event
PropertyChangedEventHandler
PropertyChanged
;
//public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// 当前 INotifyPropertyChanged 对象 引发了 PropertyChanged, 是由于 接收到数据导致的
/// </summary>
public
bool
IsInPushValue
{
get
;
protected
set
;
}
public
SyncPropServiceClient
(
UInt32
serverID
,
Dictionary
<
string
,
INotifyPropertyChanged
>
objnames
)
public
SyncPropServiceClient
(
UInt32
serverID
,
Dictionary
<
string
,
INotifyPropertyChanged
>
objnames
)
{
{
...
@@ -105,17 +111,20 @@ namespace FLY.OBJComponents.Client
...
@@ -105,17 +111,20 @@ namespace FLY.OBJComponents.Client
{
{
string
json
=
Misc
.
Converter
.
BytesToString
(
infodata
);
string
json
=
Misc
.
Converter
.
BytesToString
(
infodata
);
Dictionary
<
string
,
Dictionary
<
string
,
object
>>
DsDso
=
JsonConvert
.
DeserializeObject
<
Dictionary
<
string
,
Dictionary
<
string
,
object
>>>(
json
);
Dictionary
<
string
,
Dictionary
<
string
,
object
>>
DsDso
=
JsonConvert
.
DeserializeObject
<
Dictionary
<
string
,
Dictionary
<
string
,
object
>>>(
json
);
IsInPushValue
=
true
;
foreach
(
var
Dso
in
DsDso
)
foreach
(
var
Dso
in
DsDso
)
{
{
INotifyPropertyChanged
obj
=
ObjNames
[
Dso
.
Key
]
as
INotifyPropertyChanged
;
INotifyPropertyChanged
obj
=
ObjNames
[
Dso
.
Key
]
as
INotifyPropertyChanged
;
obj
.
PropertyChanged
-=
Data_PropertyChanged
;
obj
.
PropertyChanged
-=
Data_PropertyChanged
;
foreach
(
var
dv
in
Dso
.
Value
)
foreach
(
var
dv
in
Dso
.
Value
)
{
{
PropertiesManager_JSON
.
SetValue
(
obj
,
dv
.
Key
,
dv
.
Value
);
PropertiesManager_JSON
.
SetValue
(
obj
,
dv
.
Key
,
dv
.
Value
);
}
}
obj
.
PropertyChanged
+=
Data_PropertyChanged
;
obj
.
PropertyChanged
+=
Data_PropertyChanged
;
}
}
IsInPushValue
=
false
;
}
}
break
;
break
;
}
}
...
@@ -129,7 +138,7 @@ namespace FLY.OBJComponents.Client
...
@@ -129,7 +138,7 @@ namespace FLY.OBJComponents.Client
{
{
string
json
=
Misc
.
Converter
.
BytesToString
(
retdata
);
string
json
=
Misc
.
Converter
.
BytesToString
(
retdata
);
Dictionary
<
string
,
Dictionary
<
string
,
object
>>
DsDso
=
JsonConvert
.
DeserializeObject
<
Dictionary
<
string
,
Dictionary
<
string
,
object
>>>(
json
);
Dictionary
<
string
,
Dictionary
<
string
,
object
>>
DsDso
=
JsonConvert
.
DeserializeObject
<
Dictionary
<
string
,
Dictionary
<
string
,
object
>>>(
json
);
IsInPushValue
=
true
;
foreach
(
var
Dso
in
DsDso
)
foreach
(
var
Dso
in
DsDso
)
{
{
INotifyPropertyChanged
obj
=
ObjNames
[
Dso
.
Key
]
as
INotifyPropertyChanged
;
INotifyPropertyChanged
obj
=
ObjNames
[
Dso
.
Key
]
as
INotifyPropertyChanged
;
...
@@ -140,6 +149,7 @@ namespace FLY.OBJComponents.Client
...
@@ -140,6 +149,7 @@ namespace FLY.OBJComponents.Client
}
}
obj
.
PropertyChanged
+=
Data_PropertyChanged
;
obj
.
PropertyChanged
+=
Data_PropertyChanged
;
}
}
IsInPushValue
=
false
;
}
}
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