Skip to content

Commit dc4b6fd

Browse files
committed
Релиз 2.0.1.0
1 parent fa4a1ce commit dc4b6fd

13 files changed

Lines changed: 106 additions & 26 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using ScriptEngine.Machine.Contexts;
2+
using ScriptEngine.Machine;
3+
4+
namespace oscs
5+
{
6+
[ContextClass ("КсДействие", "CsAction")]
7+
public class CsAction : AutoContext<CsAction>
8+
{
9+
public CsAction(IRuntimeContextInstance script, string methodName)
10+
{
11+
Script = script;
12+
MethodName = methodName;
13+
}
14+
15+
[ContextProperty("ИмяМетода", "MethodName")]
16+
public string MethodName { get; set; }
17+
18+
[ContextProperty("Сценарий", "Script")]
19+
public IRuntimeContextInstance Script { get; set; }
20+
21+
}
22+
}

OneScriptClientServer/OneScriptClientServer/DoAtClientArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public CsDoAtClientArgs(DoAtClientArgs p1)
4242
public DoAtClientArgs Base_obj;
4343

4444
[ContextProperty("Действие", "EventAction")]
45-
public DelegateAction EventAction
45+
public IValue EventAction
4646
{
4747
get { return Base_obj.EventAction; }
4848
set { Base_obj.EventAction = value; }

OneScriptClientServer/OneScriptClientServer/DoAtServerArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public CsDoAtServerArgs(DoAtServerArgs p1)
4242
public DoAtServerArgs Base_obj;
4343

4444
[ContextProperty("Действие", "EventAction")]
45-
public DelegateAction EventAction
45+
public IValue EventAction
4646
{
4747
get { return Base_obj.EventAction; }
4848
set { Base_obj.EventAction = value; }

OneScriptClientServer/OneScriptClientServer/EventArgs.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace oscs
77
public class EventArgs
88
{
99
public CsEventArgs dll_obj;
10-
public DelegateAction EventAction;
10+
public IValue EventAction;
1111
public dynamic Sender;
1212

1313
public EventArgs()
@@ -37,7 +37,7 @@ public CsEventArgs(EventArgs p1)
3737
public EventArgs Base_obj;
3838

3939
[ContextProperty("Действие", "EventAction")]
40-
public DelegateAction EventAction
40+
public IValue EventAction
4141
{
4242
get { return Base_obj.EventAction; }
4343
set { Base_obj.EventAction = value; }

OneScriptClientServer/OneScriptClientServer/MessageEventArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public CsMessageEventArgs(oscs.MessageEventArgs p1)
6767

6868

6969
[ContextProperty("Действие", "EventAction")]
70-
public DelegateAction EventAction
70+
public IValue EventAction
7171
{
7272
get { return Base_obj.EventAction; }
7373
set { Base_obj.EventAction = value; }

OneScriptClientServer/OneScriptClientServer/OneScriptClientServer.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public class OneScriptClientServer : AutoContext<OneScriptClientServer>
1414
public static CsServiceApplication CurrentServiceApplication = null;
1515
public static CsServiceClient CurrentServiceClient = null;
1616
public static IValue Event = null;
17-
public static DelegateAction EventAction = null;
17+
public static IValue EventAction = null;
1818
public static ConcurrentQueue<dynamic> EventQueue = new ConcurrentQueue<dynamic>();
1919
public static bool goOn = true;
20-
public static DelegateAction ServerMessageReceived;
21-
public static DelegateAction ServerMessageSent;
20+
public static IValue ServerMessageReceived;
21+
public static IValue ServerMessageSent;
2222
public static bool thirdPartyClientMode = false;
2323

2424
[ScriptConstructor]
@@ -67,6 +67,12 @@ public CsTcpClient TcpClient(CsTcpEndPoint p1)
6767
return new CsTcpClient(p1);
6868
}
6969

70+
[ContextMethod("Действие", "Action")]
71+
public CsAction Action(IRuntimeContextInstance script, string methodName)
72+
{
73+
return new CsAction(script, methodName);
74+
}
75+
7076
[ContextMethod("TCPКонечнаяТочка", "TcpEndPoint")]
7177
public CsTcpEndPoint TcpEndPoint(string p1, int p2)
7278
{
@@ -86,10 +92,16 @@ public DelegateAction DoEvents()
8692
{
8793
System.Threading.Thread.Sleep(7);
8894
}
89-
return EventHandling();
95+
96+
IValue Action1 = EventHandling();
97+
if (Action1.GetType() == typeof(CsAction))
98+
{
99+
return DelegateAction.Create(((CsAction)Action1).Script, ((CsAction)Action1).MethodName);
100+
}
101+
return (DelegateAction)Action1;
90102
}
91103

92-
public static DelegateAction EventHandling()
104+
public static IValue EventHandling()
93105
{
94106
dynamic EventArgs1;
95107
EventQueue.TryDequeue(out EventArgs1);

OneScriptClientServer/OneScriptClientServer/OneScriptClientServer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<Reference Include="System.Xml" />
5050
</ItemGroup>
5151
<ItemGroup>
52+
<Compile Include="Action.cs" />
5253
<Compile Include="BoolMessage.cs" />
5354
<Compile Include="ByteMessage.cs" />
5455
<Compile Include="ClientInfo.cs" />

OneScriptClientServer/OneScriptClientServer/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// Можно задать все значения или принять номера сборки и редакции по умолчанию
3333
// используя "*", как показано ниже:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.0.0.0")]
36-
[assembly: AssemblyFileVersion("2.0.0.0")]
35+
[assembly: AssemblyVersion("2.0.1.0")]
36+
[assembly: AssemblyFileVersion("2.0.1.0")]

OneScriptClientServer/OneScriptClientServer/ServerClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ public CsServerClient(IScsServerClient p1)
106106
Base_obj = ServerClient1;
107107
}
108108

109-
public DelegateAction MessageSent { get; set; }
109+
public IValue MessageSent { get; set; }
110110

111-
public DelegateAction MessageReceived { get; set; }
111+
public IValue MessageReceived { get; set; }
112112

113113
public oscs.ServerClient Base_obj;
114114

@@ -119,7 +119,7 @@ public decimal ClientId
119119
}
120120

121121
[ContextProperty("ПриОтключении", "Disconnected")]
122-
public DelegateAction Disconnected { get; set; }
122+
public IValue Disconnected { get; set; }
123123

124124
[ContextProperty("СостояниеСоединения", "CommunicationState")]
125125
public int CommunicationState

OneScriptClientServer/OneScriptClientServer/ServerClientEventArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public CsServerClientEventArgs(oscs.ServerClientEventArgs p1)
5555

5656

5757
[ContextProperty("Действие", "EventAction")]
58-
public DelegateAction EventAction
58+
public IValue EventAction
5959
{
6060
get { return Base_obj.EventAction; }
6161
set { Base_obj.EventAction = value; }

0 commit comments

Comments
 (0)