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
ad14109f
Commit
ad14109f
authored
May 07, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
把 JSONDIST 改为 使用 object.reflect
parent
b115f761
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
56 additions
and
229 deletions
+56
-229
BufferWindow.cs
...ct.FLY.OBJComponents/OBJComponents/Client/BufferWindow.cs
+5
-5
JsonDistServiceClient.cs
...JComponents/OBJComponents/Client/JsonDistServiceClient.cs
+10
-67
FLY.OBJComponents.csproj
....FLY.OBJComponents/OBJComponents/FLY.OBJComponents.csproj
+4
-2
IBuffer.cs
Project.FLY.OBJComponents/OBJComponents/IService/IBuffer.cs
+4
-4
IJsonDistService.cs
....OBJComponents/OBJComponents/IService/IJsonDistService.cs
+11
-4
JSONDIST_OBJ_INTERFACE.cs
...nts/OBJComponents/OBJ_INTERFACE/JSONDIST_OBJ_INTERFACE.cs
+0
-60
JsonDist_OBJProxy.cs
...onents/OBJComponents/Server.OBJProxy/JsonDist_OBJProxy.cs
+0
-66
BufferSQLite.cs
...ct.FLY.OBJComponents/OBJComponents/Server/BufferSQLite.cs
+13
-13
JsonDist.cs
Project.FLY.OBJComponents/OBJComponents/Server/JsonDist.cs
+4
-4
PasswordAuthorize.cs
...ect.FLY.Thick.Base/FLY.Thick.Base.UI/PasswordAuthorize.cs
+5
-4
No files found.
Project.FLY.OBJComponents/OBJComponents/Client/BufferWindow.cs
View file @
ad14109f
...
@@ -83,7 +83,7 @@ namespace FLY.OBJComponents.Client
...
@@ -83,7 +83,7 @@ namespace FLY.OBJComponents.Client
private
void
BufferWindow_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
private
void
BufferWindow_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
{
if
(
e
.
PropertyName
==
"Size"
)
if
(
e
.
PropertyName
==
nameof
(
Size
)
)
{
{
if
(
Size
<
10
)
if
(
Size
<
10
)
Size
=
10
;
Size
=
10
;
...
@@ -91,11 +91,11 @@ namespace FLY.OBJComponents.Client
...
@@ -91,11 +91,11 @@ namespace FLY.OBJComponents.Client
updatePageInfo
();
updatePageInfo
();
GetWindow
();
GetWindow
();
}
}
else
if
(
e
.
PropertyName
==
"WindowID"
)
else
if
(
e
.
PropertyName
==
nameof
(
WindowID
)
)
{
{
updatePageInfo
();
updatePageInfo
();
}
}
else
if
(
e
.
PropertyName
==
"IsKeepNewest"
)
else
if
(
e
.
PropertyName
==
nameof
(
IsKeepNewest
)
)
{
{
}
}
...
@@ -130,8 +130,8 @@ namespace FLY.OBJComponents.Client
...
@@ -130,8 +130,8 @@ namespace FLY.OBJComponents.Client
private
void
Buffer_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
private
void
Buffer_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
{
if
((
e
.
PropertyName
==
"Count"
)
||
if
((
e
.
PropertyName
==
nameof
(
Buffer
.
Count
)
)
||
(
e
.
PropertyName
==
"NewestID"
))
(
e
.
PropertyName
==
nameof
(
Buffer
.
NewestID
)
))
{
{
updatePageInfo
();
updatePageInfo
();
}
}
...
...
Project.FLY.OBJComponents/OBJComponents/Client/JsonDistServiceClient.cs
View file @
ad14109f
...
@@ -11,89 +11,32 @@ using System.Threading.Tasks;
...
@@ -11,89 +11,32 @@ using System.Threading.Tasks;
namespace
FLY.OBJComponents.Client
namespace
FLY.OBJComponents.Client
{
{
public
class
JsonDistServiceClient
:
FObj
Ser
viceClient
,
IJsonDistService
public
class
JsonDistServiceClient
:
FObj
Base
.
Reflect
.
Reflect_Se
viceClient
,
IJsonDistService
{
{
public
event
JsonDistValueChangedEventHandler
ValueChanged
;
protected
override
Type
InterfaceType
=>
typeof
(
IJsonDistService
);
public
JsonDistServiceClient
(
UInt32
serviceId
)
:
base
(
serviceId
)
{
}
public
JsonDistServiceClient
(
UInt32
serviceId
)
:
base
(
serviceId
)
{
}
public
JsonDistServiceClient
(
UInt32
serviceId
,
string
connName
)
:
base
(
serviceId
,
connName
)
{
}
public
JsonDistServiceClient
(
UInt32
serviceId
,
string
connName
)
:
base
(
serviceId
,
connName
)
{
}
public
void
GetValue
(
string
key
,
AsyncCBHandler
asyncCB
,
object
asyncContext
)
public
event
EventHandler
ValueChanged
;
{
var
request
=
new
JSONDIST_OBJ_INTERFACE
.
Pack_CallGetValueRequest
()
{
key
=
key
};
string
json
=
JsonConvert
.
SerializeObject
(
request
);
CurrObjSys
.
CallFunctionEx
(
mConn
,
mServerID
,
ID
,
JSONDIST_OBJ_INTERFACE
.
CALL_GetValue
,
Misc
.
Converter
.
StringToBytes
(
json
),
asyncCB
,
asyncContext
);
}
public
void
SetValue
(
string
key
,
JObject
value
)
{
var
request
=
new
JSONDIST_OBJ_INTERFACE
.
Pack_CallSetValueRequest
()
{
key
=
key
,
value
=
value
};
string
json
=
JsonConvert
.
SerializeObject
(
request
);
CurrObjSys
.
CallFunctionEx
(
mConn
,
mServerID
,
ID
,
JSONDIST_OBJ_INTERFACE
.
CALL_SetValue
,
Misc
.
Converter
.
StringToBytes
(
json
)
);
}
public
override
void
Dispose
()
{
CurrObjSys
.
ObjRemove
(
this
,
mConn
);
}
public
override
void
ConnectNotify
(
IFConn
from
)
public
void
Trigger_ValueChanged
(
JsonDistValueChangedEventArgs
e
)
{
{
base
.
ConnectNotify
(
from
);
ValueChanged
?.
Invoke
(
this
,
e
);
if
(
from
.
IsConnected
)
{
CurrObjSys
.
SenseConfigEx
(
mConn
,
mServerID
,
ID
,
0xffffffff
,
SENSE_CONFIG
.
ADD
);
}
}
}
public
override
void
PushInfo
(
IFConn
from
,
uint
srcid
,
ushort
infoid
,
byte
[]
infodata
)
public
void
GetValue
(
string
key
,
AsyncCBHandler
asyncDelegate
,
object
asyncContext
)
{
{
switch
(
infoid
)
Call
(
nameof
(
GetValue
),
new
{
key
},
asyncDelegate
,
asyncContext
);
{
case
JSONDIST_OBJ_INTERFACE
.
PUSH_ValueChanged
:
{
string
json
=
Misc
.
Converter
.
BytesToString
(
infodata
);
var
p
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
JsonDistValueValueChangedEventArgs
>(
json
);
ValueChanged
?.
Invoke
(
this
,
new
JsonDistValueValueChangedEventArgs
()
{
key
=
p
.
key
});
}
break
;
}
}
}
public
override
void
PushCallFunction
(
IFConn
from
,
uint
srcid
,
uint
magic
,
ushort
funcid
,
byte
[]
retdata
,
object
asyncDelegate
,
object
asyncContext
)
public
void
SetValue
(
string
key
,
JObject
value
)
{
switch
(
funcid
)
{
case
JSONDIST_OBJ_INTERFACE
.
CALL_GetValue
:
{
{
string
json
=
Misc
.
Converter
.
BytesToString
(
retdata
);
Call
(
nameof
(
SetValue
),
new
{
key
,
value
});
var
p
=
JsonConvert
.
DeserializeObject
<
DistCell
>(
json
);
((
AsyncCBHandler
)
asyncDelegate
)(
asyncContext
,
p
);
}
break
;
}
}
}
}
}
}
}
Project.FLY.OBJComponents/OBJComponents/FLY.OBJComponents.csproj
View file @
ad14109f
...
@@ -68,14 +68,12 @@
...
@@ -68,14 +68,12 @@
<Compile
Include=
"IService\IRemoteHistory.cs"
/>
<Compile
Include=
"IService\IRemoteHistory.cs"
/>
<Compile
Include=
"IService\IWarningService.cs"
/>
<Compile
Include=
"IService\IWarningService.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\BUFFER_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\BUFFER_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\JSONDIST_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\PLCOS_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\PLCOS_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\REMOTEHISTORY_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\REMOTEHISTORY_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\SYNCPROP_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\SYNCPROP_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\WARNING_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"OBJ_INTERFACE\WARNING_OBJ_INTERFACE.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Server.OBJProxy\Buffer_OBJProxy.cs"
/>
<Compile
Include=
"Server.OBJProxy\Buffer_OBJProxy.cs"
/>
<Compile
Include=
"Server.OBJProxy\JsonDist_OBJProxy.cs"
/>
<Compile
Include=
"Server.OBJProxy\PLCProxySystem_OBJProxy.cs"
/>
<Compile
Include=
"Server.OBJProxy\PLCProxySystem_OBJProxy.cs"
/>
<Compile
Include=
"Server.OBJProxy\RemoteHistory_OBJProxy.cs"
/>
<Compile
Include=
"Server.OBJProxy\RemoteHistory_OBJProxy.cs"
/>
<Compile
Include=
"Server.OBJProxy\SyncProp_OBJProxy.cs"
/>
<Compile
Include=
"Server.OBJProxy\SyncProp_OBJProxy.cs"
/>
...
@@ -101,6 +99,10 @@
...
@@ -101,6 +99,10 @@
</Content>
</Content>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\..\Project.FLY.FObjSys\FObjBaseReflect\FObjBase.Reflect.csproj"
>
<Project>
{15f40c32-d546-4b2a-8d80-b3ddbcdaa690}
</Project>
<Name>
FObjBase.Reflect
</Name>
</ProjectReference>
<ProjectReference
Include=
"..\..\Project.FLY.FObjSys\FObjSys\FObjBase.csproj"
>
<ProjectReference
Include=
"..\..\Project.FLY.FObjSys\FObjSys\FObjBase.csproj"
>
<Project>
{abfe87d4-b692-4ae9-a8c0-1f470b8acbb8}
</Project>
<Project>
{abfe87d4-b692-4ae9-a8c0-1f470b8acbb8}
</Project>
<Name>
FObjBase
</Name>
<Name>
FObjBase
</Name>
...
...
Project.FLY.OBJComponents/OBJComponents/IService/IBuffer.cs
View file @
ad14109f
...
@@ -44,17 +44,17 @@ namespace FLY.OBJComponents.IService
...
@@ -44,17 +44,17 @@ namespace FLY.OBJComponents.IService
/// </summary>
/// </summary>
/// <param name="last_id">最后的ID</param>
/// <param name="last_id">最后的ID</param>
/// <param name="count">数量</param>
/// <param name="count">数量</param>
/// <param name="async
CB
">回调</param>
/// <param name="async
Delegate
">回调</param>
/// <param name="asyncContext">回调里面的上下文</param>
/// <param name="asyncContext">回调里面的上下文</param>
void
GetRecord
(
int
last_id
,
int
count
,
AsyncCBHandler
async
CB
,
object
asyncContext
);
void
GetRecord
(
int
last_id
,
int
count
,
AsyncCBHandler
async
Delegate
,
object
asyncContext
);
/// <summary>
/// <summary>
/// 获取最新的N个数据
/// 获取最新的N个数据
/// </summary>
/// </summary>
/// <param name="count">数量</param>
/// <param name="count">数量</param>
/// <param name="async
CB
">回调</param>
/// <param name="async
Delegate
">回调</param>
/// <param name="asyncContext">回调里面的上下文</param>
/// <param name="asyncContext">回调里面的上下文</param>
void
GetRecord
(
int
count
,
AsyncCBHandler
async
CB
,
object
asyncContext
);
void
GetRecord
(
int
count
,
AsyncCBHandler
async
Delegate
,
object
asyncContext
);
}
}
public
class
GetRecordReponse
<
T
>
public
class
GetRecordReponse
<
T
>
{
{
...
...
Project.FLY.OBJComponents/OBJComponents/IService/IJsonDistService.cs
View file @
ad14109f
using
FObjBase
;
using
FObjBase
;
using
FObjBase.Reflect
;
using
Newtonsoft.Json.Linq
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -11,10 +12,16 @@ namespace FLY.OBJComponents.IService
...
@@ -11,10 +12,16 @@ namespace FLY.OBJComponents.IService
{
{
public
interface
IJsonDistService
public
interface
IJsonDistService
{
{
void
GetValue
(
string
key
,
AsyncCBHandler
asyncCB
,
object
asyncContext
);
[
Call
(
typeof
(
DistCell
))]
void
GetValue
(
string
key
,
AsyncCBHandler
asyncDelegate
,
object
asyncContext
);
void
SetValue
(
string
key
,
JObject
value
);
void
SetValue
(
string
key
,
JObject
value
);
event
JsonDistValueChangedEventHandler
ValueChanged
;
//event JsonDistValueChangedEventHandler ValueChanged;
[
Push
(
typeof
(
JsonDistValueChangedEventArgs
))]
event
EventHandler
ValueChanged
;
}
}
public
class
DistCell
public
class
DistCell
{
{
...
@@ -27,9 +34,9 @@ namespace FLY.OBJComponents.IService
...
@@ -27,9 +34,9 @@ namespace FLY.OBJComponents.IService
}
}
}
}
public
delegate
void
JsonDistValueChangedEventHandler
(
object
sender
,
JsonDistValue
Value
ChangedEventArgs
e
);
public
delegate
void
JsonDistValueChangedEventHandler
(
object
sender
,
JsonDistValueChangedEventArgs
e
);
public
class
JsonDistValue
ValueChangedEventArgs
public
class
JsonDistValue
ChangedEventArgs
:
EventArgs
{
{
public
string
key
;
public
string
key
;
}
}
...
...
Project.FLY.OBJComponents/OBJComponents/OBJ_INTERFACE/JSONDIST_OBJ_INTERFACE.cs
deleted
100644 → 0
View file @
b115f761
using
FLY.OBJComponents.IService
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
FLY.OBJComponents.OBJ_INTERFACE
{
public
class
JSONDIST_OBJ_INTERFACE
{
#
region
Pack
public
class
Pack_CallGetValueRequest
{
public
string
key
;
}
public
class
Pack_CallGetValueReponse
{
public
DistCell
distCell
;
}
public
class
Pack_CallSetValueRequest
{
public
string
key
;
public
JObject
value
;
}
#
endregion
#
region
SetValue
#
endregion
#
region
GetValue
#
endregion
#
region
PushMsg
/// <summary>
/// JsonDistValueValueChangedEventArgs
/// </summary>
public
const
UInt16
PUSH_ValueChanged
=
0
;
#
endregion
#
region
Call
/// <summary>
/// request:Pack_CallGetValueRequest
/// reponse:Pack_CallGetValueReponse
/// </summary>
public
const
UInt16
CALL_GetValue
=
1
;
/// <summary>
/// request:Pack_CallSetValueRequest
/// reponse:null
/// </summary>
public
const
UInt16
CALL_SetValue
=
2
;
#
endregion
}
}
Project.FLY.OBJComponents/OBJComponents/Server.OBJProxy/JsonDist_OBJProxy.cs
deleted
100644 → 0
View file @
b115f761
using
FLY.OBJComponents.IService
;
using
FLY.OBJComponents.OBJ_INTERFACE
;
using
FObjBase
;
using
Newtonsoft.Json
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
FLY.OBJComponents.Server.OBJProxy
{
public
class
JsonDist_OBJProxy
:
FObj
{
IJsonDistService
jsonDist
;
public
JsonDist_OBJProxy
(
int
objsys_idx
,
UInt32
id
,
IJsonDistService
jsonDist
)
:
base
(
objsys_idx
)
{
ID
=
id
;
this
.
jsonDist
=
jsonDist
;
this
.
jsonDist
.
ValueChanged
+=
JsonDist_ValueChanged
;
}
private
void
JsonDist_ValueChanged
(
object
sender
,
JsonDistValueValueChangedEventArgs
e
)
{
string
j
=
JsonConvert
.
SerializeObject
(
e
);
CurrObjSys
.
PushObjInfoEx
(
this
,
JSONDIST_OBJ_INTERFACE
.
PUSH_ValueChanged
,
Misc
.
Converter
.
StringToBytes
(
j
));
}
public
override
void
CallFunction
(
IFConn
from
,
uint
srcid
,
uint
magic
,
ushort
funcid
,
byte
[]
infodata
)
{
switch
(
funcid
)
{
case
JSONDIST_OBJ_INTERFACE
.
CALL_GetValue
:
{
string
json
=
Misc
.
Converter
.
BytesToString
(
infodata
);
var
request
=
JsonConvert
.
DeserializeObject
<
JSONDIST_OBJ_INTERFACE
.
Pack_CallGetValueRequest
>
(
json
);
jsonDist
.
GetValue
(
request
.
key
,
(
asyncContext
,
retData
)
=>
{
string
j
=
JsonConvert
.
SerializeObject
(
retData
);
CurrObjSys
.
PushCallFunctionEx
(
from
,
srcid
,
ID
,
magic
,
funcid
,
Misc
.
Converter
.
StringToBytes
(
j
));
},
null
);
}
break
;
case
JSONDIST_OBJ_INTERFACE
.
CALL_SetValue
:
{
string
json
=
Misc
.
Converter
.
BytesToString
(
infodata
);
var
request
=
JsonConvert
.
DeserializeObject
<
JSONDIST_OBJ_INTERFACE
.
Pack_CallSetValueRequest
>(
json
);
jsonDist
.
SetValue
(
request
.
key
,
request
.
value
);
}
break
;
}
}
}
}
Project.FLY.OBJComponents/OBJComponents/Server/BufferSQLite.cs
View file @
ad14109f
...
@@ -126,13 +126,13 @@ namespace FLY.OBJComponents.Server
...
@@ -126,13 +126,13 @@ namespace FLY.OBJComponents.Server
/// </summary>
/// </summary>
/// <param name="last_id">最后的ID</param>
/// <param name="last_id">最后的ID</param>
/// <param name="count">数量</param>
/// <param name="count">数量</param>
/// <param name="async
CB
">回调</param>
/// <param name="async
Delegate
">回调</param>
/// <param name="asyncContext">回调里面的上下文</param>
/// <param name="asyncContext">回调里面的上下文</param>
public
async
void
GetRecord
(
int
last_id
,
int
count
,
AsyncCBHandler
async
CB
,
object
asyncContext
)
public
async
void
GetRecord
(
int
last_id
,
int
count
,
AsyncCBHandler
async
Delegate
,
object
asyncContext
)
{
{
if
(
Count
==
0
)
if
(
Count
==
0
)
{
{
async
CB
(
asyncContext
,
new
GetRecordReponse
<
TLc
>()
async
Delegate
(
asyncContext
,
new
GetRecordReponse
<
TLc
>()
{
{
LastID
=
0
,
LastID
=
0
,
Items
=
null
Items
=
null
...
@@ -152,7 +152,7 @@ namespace FLY.OBJComponents.Server
...
@@ -152,7 +152,7 @@ namespace FLY.OBJComponents.Server
}
}
reponse
.
Items
=
lcs
;
reponse
.
Items
=
lcs
;
async
CB
(
asyncContext
,
reponse
);
async
Delegate
(
asyncContext
,
reponse
);
});
});
}
}
...
@@ -161,11 +161,11 @@ namespace FLY.OBJComponents.Server
...
@@ -161,11 +161,11 @@ namespace FLY.OBJComponents.Server
/// 获取最新的N个数据
/// 获取最新的N个数据
/// </summary>
/// </summary>
/// <param name="count">数量</param>
/// <param name="count">数量</param>
/// <param name="async
CB
">回调</param>
/// <param name="async
Delegate
">回调</param>
/// <param name="asyncContext">回调里面的上下文</param>
/// <param name="asyncContext">回调里面的上下文</param>
public
void
GetRecord
(
int
count
,
AsyncCBHandler
async
CB
,
object
asyncContext
)
public
void
GetRecord
(
int
count
,
AsyncCBHandler
async
Delegate
,
object
asyncContext
)
{
{
GetRecord
(
NewestID
,
count
,
async
CB
,
asyncContext
);
GetRecord
(
NewestID
,
count
,
async
Delegate
,
asyncContext
);
}
}
}
}
...
@@ -277,13 +277,13 @@ namespace FLY.OBJComponents.Server
...
@@ -277,13 +277,13 @@ namespace FLY.OBJComponents.Server
/// </summary>
/// </summary>
/// <param name="last_id">最后的ID</param>
/// <param name="last_id">最后的ID</param>
/// <param name="count">数量</param>
/// <param name="count">数量</param>
/// <param name="async
CB
">回调</param>
/// <param name="async
Delegate
">回调</param>
/// <param name="asyncContext">回调里面的上下文</param>
/// <param name="asyncContext">回调里面的上下文</param>
public
async
void
GetRecord
(
int
last_id
,
int
count
,
AsyncCBHandler
async
CB
,
object
asyncContext
)
public
async
void
GetRecord
(
int
last_id
,
int
count
,
AsyncCBHandler
async
Delegate
,
object
asyncContext
)
{
{
if
(
Count
==
0
)
if
(
Count
==
0
)
{
{
async
CB
(
asyncContext
,
new
GetRecordReponse
<
TDb
>()
async
Delegate
(
asyncContext
,
new
GetRecordReponse
<
TDb
>()
{
{
LastID
=
0
,
LastID
=
0
,
Items
=
null
Items
=
null
...
@@ -297,7 +297,7 @@ namespace FLY.OBJComponents.Server
...
@@ -297,7 +297,7 @@ namespace FLY.OBJComponents.Server
var
dbs
=
dbTable
.
Find
(
$"ORDER BY ID LIMIT
{
last_id
-
count
+
1
}
,
{
count
}
"
);
var
dbs
=
dbTable
.
Find
(
$"ORDER BY ID LIMIT
{
last_id
-
count
+
1
}
,
{
count
}
"
);
reponse
.
LastID
=
last_id
;
reponse
.
LastID
=
last_id
;
reponse
.
Items
=
dbs
;
reponse
.
Items
=
dbs
;
async
CB
(
asyncContext
,
reponse
);
async
Delegate
(
asyncContext
,
reponse
);
});
});
}
}
...
@@ -308,9 +308,9 @@ namespace FLY.OBJComponents.Server
...
@@ -308,9 +308,9 @@ namespace FLY.OBJComponents.Server
/// <param name="count">数量</param>
/// <param name="count">数量</param>
/// <param name="asyncCB">回调</param>
/// <param name="asyncCB">回调</param>
/// <param name="asyncContext">回调里面的上下文</param>
/// <param name="asyncContext">回调里面的上下文</param>
public
void
GetRecord
(
int
count
,
AsyncCBHandler
async
CB
,
object
asyncContext
)
public
void
GetRecord
(
int
count
,
AsyncCBHandler
async
Delegate
,
object
asyncContext
)
{
{
GetRecord
(
NewestID
,
count
,
async
CB
,
asyncContext
);
GetRecord
(
NewestID
,
count
,
async
Delegate
,
asyncContext
);
}
}
}
}
}
}
Project.FLY.OBJComponents/OBJComponents/Server/JsonDist.cs
View file @
ad14109f
...
@@ -18,7 +18,7 @@ namespace FLY.OBJComponents.Server
...
@@ -18,7 +18,7 @@ namespace FLY.OBJComponents.Server
public
class
JsonDist
:
IJsonDistService
public
class
JsonDist
:
IJsonDistService
{
{
public
event
JsonDistValueChanged
EventHandler
ValueChanged
;
public
event
EventHandler
ValueChanged
;
List
<
DistCell
>
cells
=
new
List
<
DistCell
>();
List
<
DistCell
>
cells
=
new
List
<
DistCell
>();
...
@@ -28,10 +28,10 @@ namespace FLY.OBJComponents.Server
...
@@ -28,10 +28,10 @@ namespace FLY.OBJComponents.Server
}
}
public
void
GetValue
(
string
key
,
AsyncCBHandler
async
CB
,
object
asyncContext
)
public
void
GetValue
(
string
key
,
AsyncCBHandler
async
Delegate
,
object
asyncContext
)
{
{
var
distCell
=
cells
.
Find
(
c
=>
c
.
Key
==
key
);
var
distCell
=
cells
.
Find
(
c
=>
c
.
Key
==
key
);
async
CB
(
asyncContext
,
distCell
);
async
Delegate
(
asyncContext
,
distCell
);
}
}
public
void
SetValue
(
string
key
,
JObject
value
)
public
void
SetValue
(
string
key
,
JObject
value
)
...
@@ -51,7 +51,7 @@ namespace FLY.OBJComponents.Server
...
@@ -51,7 +51,7 @@ namespace FLY.OBJComponents.Server
distCell
.
Time
=
DateTime
.
Now
;
distCell
.
Time
=
DateTime
.
Now
;
distCell
.
Value
=
value
;
distCell
.
Value
=
value
;
}
}
ValueChanged
?.
Invoke
(
this
,
new
JsonDistValue
Value
ChangedEventArgs
()
{
key
=
key
});
ValueChanged
?.
Invoke
(
this
,
new
JsonDistValueChangedEventArgs
()
{
key
=
key
});
Save
();
Save
();
}
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PasswordAuthorize.cs
View file @
ad14109f
...
@@ -60,7 +60,7 @@ namespace FLY.Thick.Base.UI
...
@@ -60,7 +60,7 @@ namespace FLY.Thick.Base.UI
private
void
ObjServiceClient_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
private
void
ObjServiceClient_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
{
if
(
e
.
PropertyName
==
"IsConnected"
)
if
(
e
.
PropertyName
==
nameof
(
FObjServiceClient
.
IsConnected
)
)
{
{
var
objServiceClient
=
sender
as
FObjServiceClient
;
var
objServiceClient
=
sender
as
FObjServiceClient
;
if
(
objServiceClient
.
IsConnected
)
if
(
objServiceClient
.
IsConnected
)
...
@@ -70,9 +70,9 @@ namespace FLY.Thick.Base.UI
...
@@ -70,9 +70,9 @@ namespace FLY.Thick.Base.UI
}
}
}
}
}
}
private
void
JsonDist_ValueChanged
(
object
sender
,
EventArgs
_e
)
private
void
JsonDist_ValueChanged
(
object
sender
,
JsonDistValueValueChangedEventArgs
e
)
{
{
var
e
=
_e
as
JsonDistValueChangedEventArgs
;
if
(
e
.
key
==
JSONDIST_KEY
)
if
(
e
.
key
==
JSONDIST_KEY
)
{
{
fetch_db
();
fetch_db
();
...
@@ -80,6 +80,7 @@ namespace FLY.Thick.Base.UI
...
@@ -80,6 +80,7 @@ namespace FLY.Thick.Base.UI
}
}
void
check_db
()
void
check_db
()
{
{
if
(
DbDefault
==
null
)
if
(
DbDefault
==
null
)
...
...
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