Auto status change to "Under Review"
@@ -0,0 +1,10 | |||||
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |||
|
2 | <container xmlns="http://implab.org/schemas/servicehost/unity.v1.xsd"> | |||
|
3 | <!-- foo1 --> | |||
|
4 | <register name="foo1" provides="IFoo" type="Foo"> | |||
|
5 | </register> | |||
|
6 | ||||
|
7 | <!-- foo2 --> | |||
|
8 | <register name="foo2" provides="IFoo" type="Foo"> | |||
|
9 | </register> | |||
|
10 | </container> No newline at end of file |
@@ -0,0 +1,16 | |||||
|
1 | <Project Sdk="Microsoft.NET.Sdk"> | |||
|
2 | ||||
|
3 | <PropertyGroup> | |||
|
4 | <TargetFrameworks>netstandard2.0;net46</TargetFrameworks> | |||
|
5 | <FrameworkPathOverride Condition="'$(TargetFramework)'=='net46'">/usr/lib/mono/4.6-api/</FrameworkPathOverride> | |||
|
6 | </PropertyGroup> | |||
|
7 | ||||
|
8 | <ItemGroup> | |||
|
9 | <PackageReference Include="Unity" Version="5.8.5" /> | |||
|
10 | </ItemGroup> | |||
|
11 | ||||
|
12 | <ItemGroup> | |||
|
13 | <ProjectReference Include="..\Implab\Implab.csproj" /> | |||
|
14 | </ItemGroup> | |||
|
15 | ||||
|
16 | </Project> |
@@ -0,0 +1,28 | |||||
|
1 | using Implab.Xml; | |||
|
2 | using System.Collections.Generic; | |||
|
3 | using System.Xml; | |||
|
4 | using System.Xml.Schema; | |||
|
5 | using System.Xml.Serialization; | |||
|
6 | ||||
|
7 | namespace Implab.ServiceHost.Unity { | |||
|
8 | [XmlRoot("container", Namespace = Schema.ContainerConfigurationNamespace)] | |||
|
9 | public class ContainerElement : IXmlSerializable { | |||
|
10 | ||||
|
11 | public List<ServiceElement> Registrations {get; set; } = new List<ServiceElement>(); | |||
|
12 | ||||
|
13 | public XmlSchema GetSchema() { | |||
|
14 | return null; | |||
|
15 | } | |||
|
16 | ||||
|
17 | public void ReadXml(XmlReader reader) { | |||
|
18 | while(reader.Read() && reader.NodeType != XmlNodeType.EndElement) { | |||
|
19 | var registration = SerializationHelpers.Deserialize<ServiceElement>(reader); | |||
|
20 | Registrations.Add(registration); | |||
|
21 | } | |||
|
22 | } | |||
|
23 | ||||
|
24 | public void WriteXml(XmlWriter writer) { | |||
|
25 | throw new System.NotImplementedException(); | |||
|
26 | } | |||
|
27 | } | |||
|
28 | } No newline at end of file |
@@ -0,0 +1,5 | |||||
|
1 | namespace Implab.ServiceHost.Unity { | |||
|
2 | public static class Schema { | |||
|
3 | public const string ContainerConfigurationNamespace = "http://implab.org/schemas/servicehost/unity.v1.xsd"; | |||
|
4 | } | |||
|
5 | } No newline at end of file |
@@ -0,0 +1,28 | |||||
|
1 | using System; | |||
|
2 | using System.Xml.Serialization; | |||
|
3 | ||||
|
4 | namespace Implab.ServiceHost.Unity { | |||
|
5 | ||||
|
6 | [XmlRoot("register", Namespace = Schema.ContainerConfigurationNamespace)] | |||
|
7 | public class ServiceElement { | |||
|
8 | /// <summary> | |||
|
9 | /// An optional name for a registration in the container | |||
|
10 | /// </summary> | |||
|
11 | [XmlAttribute("name")] | |||
|
12 | public string Name { get; set; } | |||
|
13 | ||||
|
14 | /// <summary> | |||
|
15 | /// An optional type specification for the service registration, | |||
|
16 | /// must be assignable from the type specified by <see cref="ImplementedType"/> | |||
|
17 | /// </summary> | |||
|
18 | [XmlAttribute("provides")] | |||
|
19 | public string ProvidesType { get; set; } | |||
|
20 | ||||
|
21 | /// <summary> | |||
|
22 | /// The type which is registered as a service in the container. | |||
|
23 | /// </summary> | |||
|
24 | [XmlAttribute("type")] | |||
|
25 | public string ImplementedType { get; set; } | |||
|
26 | } | |||
|
27 | ||||
|
28 | } No newline at end of file |
@@ -0,0 +1,9 | |||||
|
1 | namespace Implab.ServiceHost.Unity { | |||
|
2 | public class TypeReference { | |||
|
3 | public string TypeName { get; set; } | |||
|
4 | ||||
|
5 | public string Namespace { get; set; } | |||
|
6 | ||||
|
7 | public TypeReference[] GenericParameters { get; set; } | |||
|
8 | } | |||
|
9 | } No newline at end of file |
@@ -0,0 +1,156 | |||||
|
1 | using System; | |||
|
2 | using System.Collections.Generic; | |||
|
3 | using System.Text.RegularExpressions; | |||
|
4 | ||||
|
5 | namespace Implab.ServiceHost.Unity { | |||
|
6 | public class TypeReferenceParser { | |||
|
7 | enum TokenType { | |||
|
8 | None, | |||
|
9 | ||||
|
10 | Word, | |||
|
11 | ||||
|
12 | Dot, | |||
|
13 | ||||
|
14 | Comma, | |||
|
15 | ||||
|
16 | OpenList, | |||
|
17 | ||||
|
18 | CloseList, | |||
|
19 | ||||
|
20 | Eof | |||
|
21 | } | |||
|
22 | ||||
|
23 | readonly Regex _tokens = new Regex(@"(\w+)|\s*([\.{},])\s*"); | |||
|
24 | ||||
|
25 | TokenType m_token; | |||
|
26 | ||||
|
27 | string m_tokenValue; | |||
|
28 | ||||
|
29 | int m_pos; | |||
|
30 | ||||
|
31 | readonly string m_text; | |||
|
32 | ||||
|
33 | TokenType Token { get { return m_token; } } | |||
|
34 | ||||
|
35 | string TokenValue { get { return m_tokenValue; } } | |||
|
36 | ||||
|
37 | public TypeReferenceParser(string text) { | |||
|
38 | Safe.ArgumentNotEmpty(text, nameof(text)); | |||
|
39 | m_text = text; | |||
|
40 | } | |||
|
41 | ||||
|
42 | bool ReadToken() { | |||
|
43 | if (m_pos >= m_text.Length) { | |||
|
44 | m_token = TokenType.Eof; | |||
|
45 | m_tokenValue = null; | |||
|
46 | return false; | |||
|
47 | } | |||
|
48 | ||||
|
49 | var m = _tokens.Match(m_text, m_pos); | |||
|
50 | ||||
|
51 | if (m.Success) { | |||
|
52 | m_pos += m.Length; | |||
|
53 | if (m.Groups[1].Success) { | |||
|
54 | m_token = TokenType.Word; | |||
|
55 | m_tokenValue = m.Groups[1].Value; | |||
|
56 | } else if (m.Groups[2].Success) { | |||
|
57 | m_tokenValue = null; | |||
|
58 | switch (m.Groups[2].Value) { | |||
|
59 | case "{": | |||
|
60 | m_token = TokenType.OpenList; | |||
|
61 | break; | |||
|
62 | case "}": | |||
|
63 | m_token = TokenType.CloseList; | |||
|
64 | break; | |||
|
65 | case ".": | |||
|
66 | m_token = TokenType.Dot; | |||
|
67 | break; | |||
|
68 | case ",": | |||
|
69 | m_token = TokenType.Comma; | |||
|
70 | break; | |||
|
71 | } | |||
|
72 | } | |||
|
73 | return true; | |||
|
74 | } | |||
|
75 | throw new FormatException($"Failed to parse '{m_text}' at pos {m_pos}"); | |||
|
76 | } | |||
|
77 | ||||
|
78 | public TypeRerefence Pase() { | |||
|
79 | ||||
|
80 | } | |||
|
81 | ||||
|
82 | string[] ReadTypeName() { | |||
|
83 | var parts = new List<string>(); | |||
|
84 | ||||
|
85 | string current = null; | |||
|
86 | bool stop = false; | |||
|
87 | while ((!stop) && ReadToken()) { | |||
|
88 | switch (Token) { | |||
|
89 | case TokenType.Word: | |||
|
90 | if (current != null) | |||
|
91 | ThrowUnexpectedToken(); | |||
|
92 | current = TokenValue; | |||
|
93 | break; | |||
|
94 | case TokenType.Dot: | |||
|
95 | if (current == null) | |||
|
96 | ThrowUnexpectedToken(); | |||
|
97 | parts.Add(current); | |||
|
98 | current = null; | |||
|
99 | break; | |||
|
100 | default: | |||
|
101 | stop = true; | |||
|
102 | break; | |||
|
103 | } | |||
|
104 | } | |||
|
105 | if (current != null) | |||
|
106 | parts.Add(current); | |||
|
107 | ||||
|
108 | if (parts.Count == 0) | |||
|
109 | return null; | |||
|
110 | ||||
|
111 | return parts.ToArray(); | |||
|
112 | } | |||
|
113 | ||||
|
114 | TypeReference ReadTypeReference() { | |||
|
115 | ||||
|
116 | var parts = ReadTypeName(); | |||
|
117 | if (parts == null) | |||
|
118 | return null; | |||
|
119 | ||||
|
120 | var typeReference = new TypeReference { | |||
|
121 | Namespace = string.Join(",", parts, 0, parts.Length - 1), | |||
|
122 | TypeName = parts[parts.Length - 1] | |||
|
123 | }; | |||
|
124 | ||||
|
125 | switch (Token) { | |||
|
126 | case TokenType.Eof: | |||
|
127 | break; | |||
|
128 | case TokenType.OpenList: | |||
|
129 | typeReference.GenericParameters = ReadTypeReferenceList(); | |||
|
130 | if(Token != TokenType.CloseList) | |||
|
131 | ThrowUnexpectedToken(); | |||
|
132 | break; | |||
|
133 | default: | |||
|
134 | ThrowUnexpectedToken(); | |||
|
135 | break; | |||
|
136 | } | |||
|
137 | ||||
|
138 | return typeReference; | |||
|
139 | } | |||
|
140 | ||||
|
141 | TypeReference[] ReadTypeReferenceList() { | |||
|
142 | throw new NotImplementedException(); | |||
|
143 | } | |||
|
144 | ||||
|
145 | void ReadDot() { | |||
|
146 | if (!ReadToken() || Token != TokenType.Dot) | |||
|
147 | ThrowUnexpectedToken(); | |||
|
148 | } | |||
|
149 | ||||
|
150 | void ThrowUnexpectedToken() { | |||
|
151 | throw new FormatException($"Unexpected '{Token}' at {m_pos}"); | |||
|
152 | } | |||
|
153 | ||||
|
154 | ||||
|
155 | } | |||
|
156 | } No newline at end of file |
@@ -1,25 +1,27 | |||||
1 | syntax: glob |
|
1 | syntax: glob | |
2 | Implab.Test/bin/ |
|
2 | Implab.Test/bin/ | |
3 | *.user |
|
3 | *.user | |
4 | Implab.Test/obj/ |
|
4 | Implab.Test/obj/ | |
5 | *.userprefs |
|
5 | *.userprefs | |
6 | Implab/bin/ |
|
6 | Implab/bin/ | |
7 | Implab/obj/ |
|
7 | Implab/obj/ | |
8 | TestResults/ |
|
8 | TestResults/ | |
9 | Implab.Fx/obj/ |
|
9 | Implab.Fx/obj/ | |
10 | Implab.Fx/bin/ |
|
10 | Implab.Fx/bin/ | |
11 | Implab.Fx.Test/bin/ |
|
11 | Implab.Fx.Test/bin/ | |
12 | Implab.Fx.Test/obj/ |
|
12 | Implab.Fx.Test/obj/ | |
13 | _ReSharper.Implab/ |
|
13 | _ReSharper.Implab/ | |
14 | Implab.Diagnostics.Interactive/bin/ |
|
14 | Implab.Diagnostics.Interactive/bin/ | |
15 | Implab.Diagnostics.Interactive/obj/ |
|
15 | Implab.Diagnostics.Interactive/obj/ | |
16 | MonoPlay/bin/ |
|
16 | MonoPlay/bin/ | |
17 | MonoPlay/obj/ |
|
17 | MonoPlay/obj/ | |
18 | Implab.Test/Implab.Format.Test/bin/ |
|
18 | Implab.Test/Implab.Format.Test/bin/ | |
19 | Implab.Test/Implab.Format.Test/obj/ |
|
19 | Implab.Test/Implab.Format.Test/obj/ | |
20 | *.suo |
|
20 | *.suo | |
21 | Implab.Format.Test/bin/ |
|
21 | Implab.Format.Test/bin/ | |
22 | Implab.Format.Test/obj/ |
|
22 | Implab.Format.Test/obj/ | |
23 | packages/ |
|
23 | packages/ | |
24 | Implab.Playground/obj/ |
|
24 | Implab.Playground/obj/ | |
25 | Implab.Playground/bin/ |
|
25 | Implab.Playground/bin/ | |
|
26 | Implab.ServiceHost/bin/ | |||
|
27 | Implab.ServiceHost/obj/ |
@@ -1,39 +1,18 | |||||
1 | { |
|
1 | { | |
2 | "version": "0.2.0", |
|
2 | "version": "0.2.0", | |
3 | "configurations": [ |
|
3 | "configurations": [ | |
4 |
|
||||
5 | { |
|
4 | { | |
6 |
"name": "Launch |
|
5 | "name": ".NET Core Launch (console)", | |
7 |
"type": " |
|
6 | "type": "coreclr", | |
8 | "request": "launch", |
|
7 | "request": "launch", | |
9 | "program": "/usr/lib/mono/4.5/xsp4.exe", |
|
|||
10 | "args":[ |
|
|||
11 | "--root=.", |
|
|||
12 | "--port=8081", |
|
|||
13 | "-v", |
|
|||
14 | "--printlog" |
|
|||
15 | ], |
|
|||
16 | "preLaunchTask": "build", |
|
8 | "preLaunchTask": "build", | |
17 | "cwd": "${workspaceRoot}/Pallada.PoiskAvia.Web", |
|
9 | "program": "${workspaceRoot}/Implab.Playground/bin/Debug/netcoreapp2.0/Implab.Playground.dll", | |
18 | "runtimeExecutable": null, |
|
|||
19 | "env": {}, |
|
|||
20 | "console": "integratedTerminal" |
|
|||
21 | },{ |
|
|||
22 | "name": "Launch model tests", |
|
|||
23 | "type": "mono", |
|
|||
24 | "request": "launch", |
|
|||
25 | "program": "${env:HOME}/.nuget/packages/nunit.consolerunner/3.7.0/tools/nunit3-console.exe", |
|
|||
26 | "args": [ |
|
10 | "args": [ | |
27 | "${workspaceRoot}/Pallada.PoiskAvia.Model.Test/bin/Debug/net45/Pallada.PoiskAvia.Model.Test.mono.dll", |
|
11 | "-f", "netcoreapp2.0" | |
28 | "--where=\"cat==Debug\"", |
|
|||
29 | "--labels='On'", |
|
|||
30 | "--inprocess", |
|
|||
31 | "--workers=1" |
|
|||
32 | ], |
|
12 | ], | |
33 | "preLaunchTask": "build", |
|
13 | "cwd": "${workspaceRoot}/Implab.Playground", | |
34 |
" |
|
14 | "stopAtEntry": false, | |
35 | "internalConsoleOptions": "openOnSessionStart", |
|
15 | "console": "internalConsole" | |
36 | "cwd": "${workspaceRoot}/Pallada.PoiskAvia.Model.Test/" |
|
|||
37 | } |
|
16 | } | |
38 | ] |
|
17 | ] | |
39 | } No newline at end of file |
|
18 | } |
@@ -1,13 +1,12 | |||||
1 | // ΠΠΎΠΌΠ΅ΡΡΠΈΡΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ Π² ΡΡΠΎΡ ΡΠ°ΠΉΠ», ΡΡΠΎΠ±Ρ ΠΏΠ΅ΡΠ΅Π·Π°ΠΏΠΈΡΠ°ΡΡ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ ΠΈ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»ΡΡΠΊΠΈΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ. |
|
1 | // ΠΠΎΠΌΠ΅ΡΡΠΈΡΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ Π² ΡΡΠΎΡ ΡΠ°ΠΉΠ», ΡΡΠΎΠ±Ρ ΠΏΠ΅ΡΠ΅Π·Π°ΠΏΠΈΡΠ°ΡΡ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ ΠΈ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»ΡΡΠΊΠΈΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ. | |
2 | { |
|
2 | { | |
3 | "files.exclude": { |
|
3 | "files.exclude": { | |
4 | "**/.git": true, |
|
4 | "**/.git": true, | |
5 | "**/.svn": true, |
|
5 | "**/.svn": true, | |
6 | "**/.hg": true, |
|
6 | "**/.hg": true, | |
7 | "**/CVS": true, |
|
7 | "**/CVS": true, | |
8 | "**/.DS_Store": true, |
|
8 | "**/.DS_Store": true, | |
9 | "**/bin": true, |
|
9 | "**/bin": true, | |
10 | "**/obj": true |
|
10 | "**/obj": true | |
11 |
} |
|
11 | } | |
12 | "omnisharp.useMono": true |
|
|||
13 | } No newline at end of file |
|
12 | } |
@@ -1,55 +1,37 | |||||
1 | { |
|
1 | { | |
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 |
|
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 | |
3 | // for the documentation about the tasks.json format |
|
3 | // for the documentation about the tasks.json format | |
4 | "version": "0.1.0", |
|
4 | "version": "0.1.0", | |
5 |
"command": " |
|
5 | "command": "dotnet", | |
6 | "args": [ |
|
6 | "args": [ | |
7 | // Ask msbuild to generate full paths for file names. |
|
|||
8 | "/property:GenerateFullPaths=true" |
|
|||
9 | ], |
|
7 | ], | |
10 | "taskSelector": "/t:", |
|
|||
11 | "showOutput": "silent", |
|
8 | "showOutput": "silent", | |
12 | "tasks": [ |
|
9 | "tasks": [ | |
13 | { |
|
10 | { | |
14 | "taskName": "build", |
|
11 | "taskName": "build", | |
15 | "suppressTaskName": true, |
|
|||
16 | // Show the output window only if unrecognized errors occur. |
|
12 | // Show the output window only if unrecognized errors occur. | |
17 | "showOutput": "always", |
|
13 | "showOutput": "always", | |
18 | // Use the standard MS compiler pattern to detect errors, warnings and infos |
|
14 | // Use the standard MS compiler pattern to detect errors, warnings and infos | |
19 | "problemMatcher": "$msCompile", |
|
15 | "problemMatcher": "$msCompile", | |
20 |
|
16 | |||
21 | "args" : [ |
|
17 | "args" : [ | |
22 |
"/ |
|
18 | "/p:Configuration=Debug" | |
23 | "/p:Configuration=DebugMono", |
|
|||
24 | "Pallada.PoiskAvia.mono.sln" |
|
|||
25 | ] |
|
19 | ] | |
26 | }, |
|
20 | }, | |
27 | { |
|
21 | { | |
28 | "taskName": "clean", |
|
22 | "taskName": "clean", | |
29 | // Show the output window only if unrecognized errors occur. |
|
23 | // Show the output window only if unrecognized errors occur. | |
30 | "showOutput": "always", |
|
24 | "showOutput": "always", | |
31 | // Use the standard MS compiler pattern to detect errors, warnings and infos |
|
25 | // Use the standard MS compiler pattern to detect errors, warnings and infos | |
32 |
"problemMatcher": "$msCompile" |
|
26 | "problemMatcher": "$msCompile" | |
33 |
|
||||
34 | "args" : [ |
|
|||
35 | "/p:Configuration=DebugMono", |
|
|||
36 | "Pallada.PoiskAvia.mono.sln" |
|
|||
37 | ] |
|
|||
38 | }, |
|
27 | }, | |
39 | { |
|
28 | { | |
40 |
"taskName": " |
|
29 | "taskName": "test", | |
41 | "isTestCommand": true, |
|
30 | "isTestCommand": true, | |
42 | "suppressTaskName": true, |
|
|||
43 | // Show the output window only if unrecognized errors occur. |
|
31 | // Show the output window only if unrecognized errors occur. | |
44 | "showOutput": "always", |
|
32 | "showOutput": "always", | |
45 | // Use the standard MS compiler pattern to detect errors, warnings and infos |
|
33 | // Use the standard MS compiler pattern to detect errors, warnings and infos | |
46 |
"problemMatcher": "$msCompile" |
|
34 | "problemMatcher": "$msCompile" | |
47 |
|
||||
48 | "args" : [ |
|
|||
49 | "/t:runtests", |
|
|||
50 | "/p:Configuration=DebugMono", |
|
|||
51 | "Pallada.PoiskAvia.mono.sln" |
|
|||
52 | ] |
|
|||
53 | } |
|
35 | } | |
54 | ] |
|
36 | ] | |
55 | } No newline at end of file |
|
37 | } |
@@ -1,20 +1,25 | |||||
1 |
ο»Ώ<Project Sdk="Microsoft.NET.Sdk"> |
|
1 | ο»Ώ<Project Sdk="Microsoft.NET.Sdk"> | |
2 |
<PropertyGroup Condition="'$(OSTYPE)'=='linux'"> |
|
2 | <PropertyGroup Condition="'$(OSTYPE)'=='linux'"> | |
3 |
<TargetFramework |
|
3 | <TargetFramework>netcoreapp2.0</TargetFramework> | |
4 |
<FrameworkPathOverride Condition="'$(TargetFramework)'=='net46'">/usr/lib/mono/4.6-api/</FrameworkPathOverride> |
|
4 | <FrameworkPathOverride Condition="'$(TargetFramework)'=='net46'">/usr/lib/mono/4.6-api/</FrameworkPathOverride> | |
5 |
</PropertyGroup> |
|
5 | </PropertyGroup> | |
6 |
|
6 | |||
7 |
<PropertyGroup Condition="'$(OSTYPE)'=='windows'"> |
|
7 | <PropertyGroup Condition="'$(OSTYPE)'=='windows'"> | |
8 |
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks> |
|
8 | <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks> | |
9 |
</PropertyGroup> |
|
9 | </PropertyGroup> | |
10 |
|
10 | |||
11 |
<PropertyGroup> |
|
11 | <PropertyGroup> | |
12 |
<OutputType>Exe</OutputType> |
|
12 | <OutputType>Exe</OutputType> | |
13 |
<IsPackable>false</IsPackable> |
|
13 | <IsPackable>false</IsPackable> | |
14 |
</PropertyGroup> |
|
14 | </PropertyGroup> | |
15 |
|
15 | |||
16 |
<ItemGroup> |
|
16 | <ItemGroup> | |
17 |
<ProjectReference Include="../Implab/Implab.csproj"/> |
|
17 | <ProjectReference Include="../Implab/Implab.csproj" /> | |
|
18 | <ProjectReference Include="..\Implab.ServiceHost\Implab.ServiceHost.csproj" /> | |||
|
19 | </ItemGroup> | |||
|
20 | ||||
|
21 | <ItemGroup> | |||
|
22 | <PackageReference Include="Unity" Version="5.8.5" /> | |||
18 |
</ItemGroup> |
|
23 | </ItemGroup> | |
19 |
|
24 | |||
20 |
</Project> |
|
25 | </Project> |
@@ -1,54 +1,40 | |||||
1 | using Implab.Diagnostics; |
|
1 | using System; | |
2 |
using Implab. |
|
2 | using Implab.ServiceHost.Unity; | |
3 | using Implab.Parallels; |
|
|||
4 | using Implab.Xml; |
|
3 | using Implab.Xml; | |
5 |
using |
|
4 | using Unity; | |
6 | using System.Collections.Concurrent; |
|
5 | using Unity.Injection; | |
7 | using System.Collections.Generic; |
|
|||
8 | using System.IO; |
|
|||
9 | using System.Linq; |
|
|||
10 | using System.Text; |
|
|||
11 | using System.Threading; |
|
|||
12 | using System.Threading.Tasks; |
|
|||
13 | using System.Xml; |
|
|||
14 | using System.Xml.Serialization; |
|
|||
15 |
|
6 | |||
16 | namespace Implab.Playground { |
|
7 | namespace Implab.Playground { | |
17 | using System.Diagnostics; |
|
8 | ||
18 | using static Trace<Program>; |
|
9 | public class Foo { | |
|
10 | public int IntValue { get; set; } | |||
|
11 | ||||
|
12 | public string StringValue { get; set; } | |||
|
13 | ||||
|
14 | } | |||
|
15 | ||||
|
16 | public class Container<T> { | |||
|
17 | public Container() { | |||
|
18 | ||||
|
19 | } | |||
|
20 | ||||
|
21 | public Container(T instance) { | |||
|
22 | Instance = instance; | |||
|
23 | } | |||
|
24 | ||||
|
25 | public T Instance { get; set; } | |||
|
26 | } | |||
19 |
|
27 | |||
20 | public class Program { |
|
28 | public class Program { | |
21 |
|
29 | |||
22 | static void Main(string[] args) { |
|
30 | static void Main(string[] args) { | |
23 |
var |
|
31 | var container = new UnityContainer(); | |
24 |
|
||||
25 | var source = Trace<Program>.TraceSource; |
|
|||
26 | source.Switch.Level = SourceLevels.All; |
|
|||
27 |
|
||||
28 | source.Listeners.Add(listener); |
|
|||
29 |
|
32 | |||
30 | var t = Environment.TickCount; |
|
33 | var containerConfig = SerializationHelpers.DeserializeFromFile<ContainerElement>("data/sample.xml"); | |
31 |
|
34 | |||
32 | Main().Wait(); |
|
35 | Console.WriteLine($"container: {containerConfig.Registrations.Count}"); | |
33 |
|
||||
34 | Console.WriteLine($"Done: {Environment.TickCount - t} ms"); |
|
|||
35 | Console.ReadKey(); |
|
|||
36 | } |
|
36 | } | |
37 |
|
37 | |||
38 | static async Task Main() { |
|
38 | ||
39 | using (LogicalOperation(nameof(Main))) { |
|
|||
40 | Log("Start"); |
|
|||
41 | await SomeAsync(); |
|
|||
42 | Log("End"); |
|
|||
43 | } |
|
39 | } | |
44 | } |
|
40 | } | |
45 |
|
||||
46 | static async Task SomeAsync() { |
|
|||
47 | using (LogicalOperation(nameof(SomeAsync))) { |
|
|||
48 | Log("Do prepare"); |
|
|||
49 | await Task.Yield(); |
|
|||
50 | Log("Yield"); |
|
|||
51 | } |
|
|||
52 | } |
|
|||
53 | } |
|
|||
54 | } |
|
@@ -1,23 +1,23 | |||||
1 | <Project Sdk="Microsoft.NET.Sdk"> |
|
1 | <Project Sdk="Microsoft.NET.Sdk"> | |
2 | <PropertyGroup Condition="'$(OSTYPE)'=='linux'"> |
|
2 | <PropertyGroup Condition="'$(OSTYPE)'=='linux'"> | |
3 | <TargetFrameworks>netcoreapp2.0</TargetFrameworks> |
|
3 | <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks> | |
4 | <FrameworkPathOverride Condition="'$(TargetFramework)'=='net46'">/usr/lib/mono/4.5/</FrameworkPathOverride> |
|
4 | <FrameworkPathOverride Condition="'$(TargetFramework)'=='net46'">/usr/lib/mono/4.5/</FrameworkPathOverride> | |
5 | </PropertyGroup> |
|
5 | </PropertyGroup> | |
6 |
|
6 | |||
7 | <PropertyGroup Condition="'$(OSTYPE)'=='windows'"> |
|
7 | <PropertyGroup Condition="'$(OSTYPE)'=='windows'"> | |
8 | <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks> |
|
8 | <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks> | |
9 | </PropertyGroup> |
|
9 | </PropertyGroup> | |
10 |
|
10 | |||
11 | <PropertyGroup> |
|
11 | <PropertyGroup> | |
12 | <IsPackable>false</IsPackable> |
|
12 | <IsPackable>false</IsPackable> | |
13 | </PropertyGroup> |
|
13 | </PropertyGroup> | |
14 |
|
14 | |||
15 | <ItemGroup> |
|
15 | <ItemGroup> | |
16 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0-preview-20180109-01" /> |
|
16 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0-preview-20180109-01" /> | |
17 | <PackageReference Include="xunit" Version="2.3.1" /> |
|
17 | <PackageReference Include="xunit" Version="2.3.1" /> | |
18 | <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" /> |
|
18 | <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" /> | |
19 | <ProjectReference Include="../Implab/Implab.csproj"/> |
|
19 | <ProjectReference Include="../Implab/Implab.csproj"/> | |
20 | <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" /> |
|
20 | <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" /> | |
21 | </ItemGroup> |
|
21 | </ItemGroup> | |
22 |
|
22 | |||
23 | </Project> |
|
23 | </Project> |
@@ -1,37 +1,55 | |||||
1 |
|
|
1 | ||
2 | Microsoft Visual Studio Solution File, Format Version 12.00 |
|
2 | Microsoft Visual Studio Solution File, Format Version 12.00 | |
3 | # Visual Studio 15 |
|
3 | # Visual Studio 15 | |
4 | VisualStudioVersion = 15.0.27428.2005 |
|
4 | VisualStudioVersion = 15.0.27428.2005 | |
5 | MinimumVisualStudioVersion = 10.0.40219.1 |
|
5 | MinimumVisualStudioVersion = 10.0.40219.1 | |
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Implab", "Implab\Implab.csproj", "{FF2052B6-9C8F-4022-A347-F07ABF635885}" |
|
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Implab", "Implab\Implab.csproj", "{FF2052B6-9C8F-4022-A347-F07ABF635885}" | |
7 | EndProject |
|
7 | EndProject | |
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Implab.Test", "Implab.Test\Implab.Test.csproj", "{6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}" |
|
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Implab.Test", "Implab.Test\Implab.Test.csproj", "{6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}" | |
9 | EndProject |
|
9 | EndProject | |
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab.Playground", "Implab.Playground\Implab.Playground.csproj", "{100DFEB0-75BE-436F-ADDF-1F46EF433F46}" |
|
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab.Playground", "Implab.Playground\Implab.Playground.csproj", "{100DFEB0-75BE-436F-ADDF-1F46EF433F46}" | |
11 | EndProject |
|
11 | EndProject | |
|
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Implab.ServiceHost", "Implab.ServiceHost\Implab.ServiceHost.csproj", "{8B79FCBE-50DD-40A0-9B5E-E572072E4868}" | |||
|
13 | EndProject | |||
12 | Global |
|
14 | Global | |
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | |
14 | Debug|Any CPU = Debug|Any CPU |
|
16 | Debug|Any CPU = Debug|Any CPU | |
15 | Release|Any CPU = Release|Any CPU |
|
17 | Release|Any CPU = Release|Any CPU | |
|
18 | Debug|x64 = Debug|x64 | |||
|
19 | Debug|x86 = Debug|x86 | |||
|
20 | Release|x64 = Release|x64 | |||
|
21 | Release|x86 = Release|x86 | |||
16 | EndGlobalSection |
|
22 | EndGlobalSection | |
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution | |
18 | {FF2052B6-9C8F-4022-A347-F07ABF635885}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
24 | {FF2052B6-9C8F-4022-A347-F07ABF635885}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |
19 | {FF2052B6-9C8F-4022-A347-F07ABF635885}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
25 | {FF2052B6-9C8F-4022-A347-F07ABF635885}.Debug|Any CPU.Build.0 = Debug|Any CPU | |
20 | {FF2052B6-9C8F-4022-A347-F07ABF635885}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
26 | {FF2052B6-9C8F-4022-A347-F07ABF635885}.Release|Any CPU.ActiveCfg = Release|Any CPU | |
21 | {FF2052B6-9C8F-4022-A347-F07ABF635885}.Release|Any CPU.Build.0 = Release|Any CPU |
|
27 | {FF2052B6-9C8F-4022-A347-F07ABF635885}.Release|Any CPU.Build.0 = Release|Any CPU | |
22 | {6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
28 | {6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |
23 | {6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
29 | {6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}.Debug|Any CPU.Build.0 = Debug|Any CPU | |
24 | {6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
30 | {6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}.Release|Any CPU.ActiveCfg = Release|Any CPU | |
25 | {6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}.Release|Any CPU.Build.0 = Release|Any CPU |
|
31 | {6CD0DA18-8D9B-4AA8-A3DC-17322E27335E}.Release|Any CPU.Build.0 = Release|Any CPU | |
26 | {100DFEB0-75BE-436F-ADDF-1F46EF433F46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
32 | {100DFEB0-75BE-436F-ADDF-1F46EF433F46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |
27 | {100DFEB0-75BE-436F-ADDF-1F46EF433F46}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
33 | {100DFEB0-75BE-436F-ADDF-1F46EF433F46}.Debug|Any CPU.Build.0 = Debug|Any CPU | |
28 | {100DFEB0-75BE-436F-ADDF-1F46EF433F46}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
34 | {100DFEB0-75BE-436F-ADDF-1F46EF433F46}.Release|Any CPU.ActiveCfg = Release|Any CPU | |
29 | {100DFEB0-75BE-436F-ADDF-1F46EF433F46}.Release|Any CPU.Build.0 = Release|Any CPU |
|
35 | {100DFEB0-75BE-436F-ADDF-1F46EF433F46}.Release|Any CPU.Build.0 = Release|Any CPU | |
|
36 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
|
37 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
|
38 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Debug|x64.ActiveCfg = Debug|x64 | |||
|
39 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Debug|x64.Build.0 = Debug|x64 | |||
|
40 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Debug|x86.ActiveCfg = Debug|x86 | |||
|
41 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Debug|x86.Build.0 = Debug|x86 | |||
|
42 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
|
43 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Release|Any CPU.Build.0 = Release|Any CPU | |||
|
44 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Release|x64.ActiveCfg = Release|x64 | |||
|
45 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Release|x64.Build.0 = Release|x64 | |||
|
46 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Release|x86.ActiveCfg = Release|x86 | |||
|
47 | {8B79FCBE-50DD-40A0-9B5E-E572072E4868}.Release|x86.Build.0 = Release|x86 | |||
30 | EndGlobalSection |
|
48 | EndGlobalSection | |
31 | GlobalSection(SolutionProperties) = preSolution |
|
49 | GlobalSection(SolutionProperties) = preSolution | |
32 | HideSolutionNode = FALSE |
|
50 | HideSolutionNode = FALSE | |
33 | EndGlobalSection |
|
51 | EndGlobalSection | |
34 | GlobalSection(ExtensibilityGlobals) = postSolution |
|
52 | GlobalSection(ExtensibilityGlobals) = postSolution | |
35 | SolutionGuid = {36D837FC-4CDD-4AEA-87BF-F130FEB22E02} |
|
53 | SolutionGuid = {36D837FC-4CDD-4AEA-87BF-F130FEB22E02} | |
36 | EndGlobalSection |
|
54 | EndGlobalSection | |
37 | EndGlobal |
|
55 | EndGlobal |
General Comments 3
ok, latest stable version should be in default
You need to be logged in to leave comments.
Login now