개정판 b92f142f
convert service 수정
Controller 수정
Change-Id: I38994fcc4d4452d638ea74b27cc8638f4157e17a
ConvertService/ServiceBase/ConnectionStringBuild/ConnectionStringBuild.csproj | ||
---|---|---|
33 | 33 |
<DefineConstants>TRACE</DefineConstants> |
34 | 34 |
<ErrorReport>prompt</ErrorReport> |
35 | 35 |
<WarningLevel>4</WarningLevel> |
36 |
<Prefer32Bit>false</Prefer32Bit> |
|
36 | 37 |
</PropertyGroup> |
37 | 38 |
<ItemGroup> |
38 | 39 |
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> |
ConvertService/ServiceBase/ConnectionStringBuild/MainWindow.xaml.cs | ||
---|---|---|
45 | 45 |
{ |
46 | 46 |
using (Markus.Service.DataBase.ConvertDatabase database = new Markus.Service.DataBase.ConvertDatabase(txtDecrypt.Text)) |
47 | 47 |
{ |
48 |
var result = database.GetConvertItems(Markus.Message.StatusCodeType.Wait).ToList();
|
|
48 |
var result = database.GetWaitConvertItems(new List<string>(),30).ToList();
|
|
49 | 49 |
|
50 |
txtLog.Text += "Test Ok"; |
|
50 |
txtLog.Text += "Test Ok" + result.Count().ToString();
|
|
51 | 51 |
} |
52 | 52 |
} |
53 | 53 |
catch (Exception ex) |
ConvertService/ServiceBase/IServiceBase/ConvertItem.cs | ||
---|---|---|
8 | 8 |
namespace Markus.Service.Interface |
9 | 9 |
{ |
10 | 10 |
[DataContract] |
11 |
public class ConvertItem |
|
11 |
public class ConvertItem : IEquatable<ConvertItem>
|
|
12 | 12 |
{ |
13 |
public bool Equals(ConvertItem other) |
|
14 |
{ |
|
15 |
if (other is null) |
|
16 |
return false; |
|
17 |
|
|
18 |
return this.ConvertID == other.ConvertID && this.ProjectNumber == other.ProjectNumber; |
|
19 |
} |
|
20 |
|
|
21 |
public override bool Equals(object obj) => Equals(obj as ConvertItem); |
|
22 |
public override int GetHashCode() |
|
23 |
{ |
|
24 |
var id = (ConvertID != null) ? ConvertID : ""; |
|
25 |
var project = (ProjectNumber != null) ? ProjectNumber : ""; |
|
26 |
|
|
27 |
return (id + project).GetHashCode(); |
|
28 |
} |
|
29 |
|
|
13 | 30 |
public ConvertItem(string ProjectNo , string ID) |
14 | 31 |
{ |
15 | 32 |
this._projectNumber = ProjectNo; |
... | ... | |
101 | 118 |
|
102 | 119 |
[DataMember] |
103 | 120 |
public Int64 ProcessorAffinity { get; set; } |
121 |
|
|
104 | 122 |
} |
105 | 123 |
} |
ConvertService/ServiceBase/Markus.Mvvm.ToolKit/Markus.Mvvm.ToolKit.csproj | ||
---|---|---|
55 | 55 |
</ItemGroup> |
56 | 56 |
<ItemGroup> |
57 | 57 |
<Compile Include="AsyncCommand\AsyncCommand.cs" /> |
58 |
<Compile Include="PackIcon\PackIcon.cs" /> |
|
59 |
<Compile Include="PackIcon\PackIconBase.cs" /> |
|
60 |
<Compile Include="PackIcon\PackIconDataFactory.cs" /> |
|
61 |
<Compile Include="PackIcon\PackIconExtension.cs" /> |
|
62 |
<Compile Include="PackIcon\PackIconKind.cs" /> |
|
63 | 58 |
<Compile Include="RelayCommand\EventRaiser.cs" /> |
64 | 59 |
<Compile Include="RelayCommand\RelayCommand.cs" /> |
65 | 60 |
<Compile Include="AsyncCommand\IAsyncCommand.cs" /> |
... | ... | |
69 | 64 |
<Compile Include="TaskUtilities.cs" /> |
70 | 65 |
<Compile Include="ViewModelBase.cs" /> |
71 | 66 |
</ItemGroup> |
67 |
<ItemGroup> |
|
68 |
<Page Include="Themes\Generic.xaml"> |
|
69 |
<Generator>MSBuild:Compile</Generator> |
|
70 |
<SubType>Designer</SubType> |
|
71 |
</Page> |
|
72 |
</ItemGroup> |
|
72 | 73 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
73 | 74 |
</Project> |
ConvertService/ServiceBase/Markus.Mvvm.ToolKit/Properties/AssemblyInfo.cs | ||
---|---|---|
1 | 1 |
using System.Reflection; |
2 | 2 |
using System.Runtime.CompilerServices; |
3 | 3 |
using System.Runtime.InteropServices; |
4 |
using System.Windows; |
|
4 | 5 |
|
5 | 6 |
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 |
6 | 7 |
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 |
... | ... | |
19 | 20 |
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. |
20 | 21 |
[assembly: ComVisible(false)] |
21 | 22 |
|
23 |
[assembly: ThemeInfo( |
|
24 |
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located |
|
25 |
//(used if a resource is not found in the page, |
|
26 |
// or application resource dictionaries) |
|
27 |
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located |
|
28 |
//(used if a resource is not found in the page, |
|
29 |
// app, or any theme specific resource dictionaries) |
|
30 |
)] |
|
31 |
|
|
22 | 32 |
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. |
23 | 33 |
[assembly: Guid("9efe95d6-9985-422a-a76f-285c8cf73617")] |
24 | 34 |
|
ConvertService/ServiceBase/Markus.Mvvm.ToolKit/Themes/Generic.xaml | ||
---|---|---|
1 |
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
2 |
xmlns:local="clr-namespace:Markus.Mvvm.ToolKit" |
|
3 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
4 |
<!--<Style TargetType="local:PackIcon"> |
|
5 |
<Setter Property="Width" Value="20" /> |
|
6 |
<Setter Property="Height" Value="20" /> |
|
7 |
<Setter Property="Kind" Value="Abc"/> |
|
8 |
<Setter Property="IconBrush" Value="White"/> |
|
9 |
<Setter Property="Template"> |
|
10 |
<Setter.Value> |
|
11 |
<ControlTemplate> |
|
12 |
<Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> |
|
13 |
<Path x:Name="PART_PATH" Fill="{TemplateBinding IconBrush}" Stroke="{TemplateBinding IconBrush}"/> |
|
14 |
</Grid> |
|
15 |
</ControlTemplate> |
|
16 |
</Setter.Value> |
|
17 |
</Setter> |
|
18 |
</Style>--> |
|
19 |
</ResourceDictionary> |
ConvertService/ServiceBase/Markus.Service.DataBase/ConvertDatabase.cs | ||
---|---|---|
237 | 237 |
{ |
238 | 238 |
var convertWaitingItems = entities.CONVERTER_DOC.OrderBy(x => x.CREATE_DATETIME).Where( |
239 | 239 |
x => |
240 |
projectList.Contains(x.PROJECT_NO) && x.RECONVERTER < 2 && |
|
240 |
//projectList.Contains(x.PROJECT_NO) && x.RECONVERTER < 2 && |
|
241 |
x.RECONVERTER < 2 && |
|
241 | 242 |
(x.STATUS == (int)StatusCodeType.None || x.STATUS == (int)StatusCodeType.FileError && x.STATUS == (int)StatusCodeType.Error)) |
242 | 243 |
.GroupBy(x=>x.DOCUMENT_ID).Select(x => x.FirstOrDefault()) |
243 | 244 |
.Take(TakeCount); |
... | ... | |
333 | 334 |
} |
334 | 335 |
|
335 | 336 |
/// <summary> |
337 |
/// 전체 컨버터를 가져온다. 비동기로 변경하여야 한다. |
|
338 |
/// </summary> |
|
339 |
/// <returns></returns> |
|
340 |
public List<Interface.ConvertItem> GetConvertItems(StatusCodeType statusCodeType,Func<CONVERTER_DOC, bool> @where,int takeCount = 100) |
|
341 |
{ |
|
342 |
List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>(); |
|
343 |
|
|
344 |
var items = entities.CONVERTER_DOC.Where(x => x.STATUS == (int)statusCodeType && where(x)).Take(takeCount).ToList(); //.Where(x => x.PROJECT_NO == gProjectNo); |
|
345 |
|
|
346 |
if (items.Count() > 0) |
|
347 |
{ |
|
348 |
foreach (var item in items) |
|
349 |
{ |
|
350 |
var convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL) |
|
351 |
{ |
|
352 |
ReConverter = item.RECONVERTER, |
|
353 |
ServiceID = item.SERVICE_ID, |
|
354 |
ConvertState = ((StatusCodeType)item.STATUS).ToString(), |
|
355 |
CreateTime = item.CREATE_DATETIME, |
|
356 |
TotalPage = item.TOTAL_PAGE, |
|
357 |
CurrentPageNo = item.CURRENT_PAGE, |
|
358 |
|
|
359 |
ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID) |
|
360 |
}; |
|
361 |
|
|
362 |
|
|
363 |
convertItems.Add(convertitem); |
|
364 |
} |
|
365 |
} |
|
366 |
return convertItems; |
|
367 |
} |
|
368 |
|
|
369 |
|
|
370 |
/// <summary> |
|
336 | 371 |
/// 현재 서비스에서 컨버터중인 아이템. |
337 | 372 |
/// </summary> |
338 | 373 |
/// <returns></returns> |
ConvertService/ServiceBase/Markus.Service.Extensions/Exntensions/CollectionExtensions.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Linq.Expressions; |
|
5 |
using System.Text; |
|
6 |
using System.Threading.Tasks; |
|
7 |
|
|
8 |
namespace Markus.Service.Extensions |
|
9 |
{ |
|
10 |
public static class CollectionExtensions |
|
11 |
{ |
|
12 |
//public static void Update<T>(this IList<T> source,IList<T> Target,IList<string> Keys) |
|
13 |
//{ |
|
14 |
// for (int i = source.Count; i == 0 ; --i) |
|
15 |
// { |
|
16 |
// var item = source[i]; |
|
17 |
// Target.Where(f=>) |
|
18 |
// item.GetType().GetProperty() |
|
19 |
// } |
|
20 |
//} |
|
21 |
|
|
22 |
/// <summary> |
|
23 |
/// Changes all elements of IEnumerable by the change function |
|
24 |
/// </summary> |
|
25 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
26 |
/// <param name="change">The way you want to change the stuff</param> |
|
27 |
/// <returns>An IEnumerable with all changes applied</returns> |
|
28 |
public static IEnumerable<T> Change<T>(this IEnumerable<T> enumerable, Func<T, T> change) |
|
29 |
{ |
|
30 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
31 |
ArgumentCheck.IsNullorWhiteSpace(change, "change"); |
|
32 |
|
|
33 |
foreach (var item in enumerable) |
|
34 |
{ |
|
35 |
yield return change(item); |
|
36 |
} |
|
37 |
} |
|
38 |
|
|
39 |
/// <summary> |
|
40 |
/// Changes all elements of IEnumerable by the change function, that fullfill the where function |
|
41 |
/// </summary> |
|
42 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
43 |
/// <param name="change">The way you want to change the stuff</param> |
|
44 |
/// <param name="where">The function to check where changes should be made</param> |
|
45 |
/// <returns> |
|
46 |
/// An IEnumerable with all changes applied |
|
47 |
/// </returns> |
|
48 |
public static IEnumerable<T> ChangeWhere<T>(this IEnumerable<T> enumerable, |
|
49 |
Func<T, T> change, |
|
50 |
Func<T, bool> @where) |
|
51 |
{ |
|
52 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
53 |
ArgumentCheck.IsNullorWhiteSpace(change, "change"); |
|
54 |
ArgumentCheck.IsNullorWhiteSpace(@where, "where"); |
|
55 |
|
|
56 |
foreach (var item in enumerable) |
|
57 |
{ |
|
58 |
if (@where(item)) |
|
59 |
{ |
|
60 |
yield return change(item); |
|
61 |
} |
|
62 |
else |
|
63 |
{ |
|
64 |
yield return item; |
|
65 |
} |
|
66 |
} |
|
67 |
} |
|
68 |
|
|
69 |
public static class ArgumentCheck |
|
70 |
{ |
|
71 |
|
|
72 |
|
|
73 |
/// <summary> |
|
74 |
/// Checks if a value is string or any other object if it is string |
|
75 |
/// it checks for nullorwhitespace otherwhise it checks for null only |
|
76 |
/// </summary> |
|
77 |
/// <typeparam name="T">Type of the item you want to check</typeparam> |
|
78 |
/// <param name="item">The item you want to check</param> |
|
79 |
/// <param name="nameOfTheArgument">Name of the argument</param> |
|
80 |
public static void IsNullorWhiteSpace<T>(T item, string nameOfTheArgument = "") |
|
81 |
{ |
|
82 |
|
|
83 |
Type type = typeof(T); |
|
84 |
if (type == typeof(string) || |
|
85 |
type == typeof(String)) |
|
86 |
{ |
|
87 |
if (string.IsNullOrWhiteSpace(item as string)) |
|
88 |
{ |
|
89 |
throw new ArgumentException(nameOfTheArgument + " is null or Whitespace"); |
|
90 |
} |
|
91 |
} |
|
92 |
else |
|
93 |
{ |
|
94 |
if (item == null) |
|
95 |
{ |
|
96 |
throw new ArgumentException(nameOfTheArgument + " is null"); |
|
97 |
} |
|
98 |
} |
|
99 |
|
|
100 |
} |
|
101 |
} |
|
102 |
|
|
103 |
/// <summary> |
|
104 |
/// Changes all elements of IEnumerable by the change function that do not fullfill the except function |
|
105 |
/// </summary> |
|
106 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
107 |
/// <param name="change">The way you want to change the stuff</param> |
|
108 |
/// <param name="where">The function to check where changes should not be made</param> |
|
109 |
/// <returns> |
|
110 |
/// An IEnumerable with all changes applied |
|
111 |
/// </returns> |
|
112 |
public static IEnumerable<T> ChangeExcept<T>(this IEnumerable<T> enumerable, |
|
113 |
Func<T, T> change, |
|
114 |
Func<T, bool> @where) |
|
115 |
{ |
|
116 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
117 |
ArgumentCheck.IsNullorWhiteSpace(change, "change"); |
|
118 |
ArgumentCheck.IsNullorWhiteSpace(@where, "where"); |
|
119 |
|
|
120 |
foreach (var item in enumerable) |
|
121 |
{ |
|
122 |
if (!@where(item)) |
|
123 |
{ |
|
124 |
yield return change(item); |
|
125 |
} |
|
126 |
else |
|
127 |
{ |
|
128 |
yield return item; |
|
129 |
} |
|
130 |
} |
|
131 |
} |
|
132 |
|
|
133 |
/// <summary> |
|
134 |
/// Update all elements of IEnumerable by the update function (only works with reference types) |
|
135 |
/// </summary> |
|
136 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
137 |
/// <param name="update">The way you want to change the stuff</param> |
|
138 |
/// <returns> |
|
139 |
/// The same enumerable you passed in |
|
140 |
/// </returns> |
|
141 |
public static IEnumerable<T> Update<T>(this IEnumerable<T> enumerable, |
|
142 |
Action<T> update) where T : class |
|
143 |
{ |
|
144 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
145 |
ArgumentCheck.IsNullorWhiteSpace(update, "update"); |
|
146 |
foreach (var item in enumerable) |
|
147 |
{ |
|
148 |
update(item); |
|
149 |
} |
|
150 |
return enumerable; |
|
151 |
} |
|
152 |
|
|
153 |
/// <summary> |
|
154 |
/// Update all elements of IEnumerable by the update function (only works with reference types) |
|
155 |
/// where the where function returns true |
|
156 |
/// </summary> |
|
157 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
158 |
/// <param name="update">The way you want to change the stuff</param> |
|
159 |
/// <param name="where">The function to check where updates should be made</param> |
|
160 |
/// <returns> |
|
161 |
/// The same enumerable you passed in |
|
162 |
/// </returns> |
|
163 |
public static IEnumerable<T> UpdateWhere<T>(this IEnumerable<T> enumerable, |
|
164 |
Action<T> update, Func<T, bool> where) where T : class |
|
165 |
{ |
|
166 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
167 |
ArgumentCheck.IsNullorWhiteSpace(update, "update"); |
|
168 |
foreach (var item in enumerable) |
|
169 |
{ |
|
170 |
if (where(item)) |
|
171 |
{ |
|
172 |
update(item); |
|
173 |
} |
|
174 |
} |
|
175 |
return enumerable; |
|
176 |
} |
|
177 |
|
|
178 |
/// <summary> |
|
179 |
/// Update all elements of IEnumerable by the update function (only works with reference types) |
|
180 |
/// Except the elements from the where function |
|
181 |
/// </summary> |
|
182 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
183 |
/// <param name="update">The way you want to change the stuff</param> |
|
184 |
/// <param name="where">The function to check where changes should not be made</param> |
|
185 |
/// <returns> |
|
186 |
/// The same enumerable you passed in |
|
187 |
/// </returns> |
|
188 |
public static IEnumerable<T> UpdateExcept<T>(this IEnumerable<T> enumerable, |
|
189 |
Action<T> update, Func<T, bool> where) where T : class |
|
190 |
{ |
|
191 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
192 |
ArgumentCheck.IsNullorWhiteSpace(update, "update"); |
|
193 |
|
|
194 |
foreach (var item in enumerable) |
|
195 |
{ |
|
196 |
if (!where(item)) |
|
197 |
{ |
|
198 |
update(item); |
|
199 |
} |
|
200 |
} |
|
201 |
return enumerable; |
|
202 |
} |
|
203 |
} |
|
204 |
} |
ConvertService/ServiceBase/Markus.Service.Extensions/Exntensions/CollectionExtenstions.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Linq.Expressions; |
|
5 |
using System.Text; |
|
6 |
using System.Threading.Tasks; |
|
7 |
|
|
8 |
namespace Markus.Service.Extensions |
|
9 |
{ |
|
10 |
public static class CollectionExtensions |
|
11 |
{ |
|
12 |
//public static void Update<T>(this IList<T> source,IList<T> Target,IList<string> Keys) |
|
13 |
//{ |
|
14 |
// for (int i = source.Count; i == 0 ; --i) |
|
15 |
// { |
|
16 |
// var item = source[i]; |
|
17 |
// Target.Where(f=>) |
|
18 |
// item.GetType().GetProperty() |
|
19 |
// } |
|
20 |
//} |
|
21 |
|
|
22 |
/// <summary> |
|
23 |
/// Changes all elements of IEnumerable by the change function |
|
24 |
/// </summary> |
|
25 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
26 |
/// <param name="change">The way you want to change the stuff</param> |
|
27 |
/// <returns>An IEnumerable with all changes applied</returns> |
|
28 |
public static IEnumerable<T> Change<T>(this IEnumerable<T> enumerable, Func<T, T> change) |
|
29 |
{ |
|
30 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
31 |
ArgumentCheck.IsNullorWhiteSpace(change, "change"); |
|
32 |
|
|
33 |
foreach (var item in enumerable) |
|
34 |
{ |
|
35 |
yield return change(item); |
|
36 |
} |
|
37 |
} |
|
38 |
|
|
39 |
/// <summary> |
|
40 |
/// Changes all elements of IEnumerable by the change function, that fullfill the where function |
|
41 |
/// </summary> |
|
42 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
43 |
/// <param name="change">The way you want to change the stuff</param> |
|
44 |
/// <param name="where">The function to check where changes should be made</param> |
|
45 |
/// <returns> |
|
46 |
/// An IEnumerable with all changes applied |
|
47 |
/// </returns> |
|
48 |
public static IEnumerable<T> ChangeWhere<T>(this IEnumerable<T> enumerable, |
|
49 |
Func<T, T> change, |
|
50 |
Func<T, bool> @where) |
|
51 |
{ |
|
52 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
53 |
ArgumentCheck.IsNullorWhiteSpace(change, "change"); |
|
54 |
ArgumentCheck.IsNullorWhiteSpace(@where, "where"); |
|
55 |
|
|
56 |
foreach (var item in enumerable) |
|
57 |
{ |
|
58 |
if (@where(item)) |
|
59 |
{ |
|
60 |
yield return change(item); |
|
61 |
} |
|
62 |
else |
|
63 |
{ |
|
64 |
yield return item; |
|
65 |
} |
|
66 |
} |
|
67 |
} |
|
68 |
|
|
69 |
public static class ArgumentCheck |
|
70 |
{ |
|
71 |
|
|
72 |
|
|
73 |
/// <summary> |
|
74 |
/// Checks if a value is string or any other object if it is string |
|
75 |
/// it checks for nullorwhitespace otherwhise it checks for null only |
|
76 |
/// </summary> |
|
77 |
/// <typeparam name="T">Type of the item you want to check</typeparam> |
|
78 |
/// <param name="item">The item you want to check</param> |
|
79 |
/// <param name="nameOfTheArgument">Name of the argument</param> |
|
80 |
public static void IsNullorWhiteSpace<T>(T item, string nameOfTheArgument = "") |
|
81 |
{ |
|
82 |
|
|
83 |
Type type = typeof(T); |
|
84 |
if (type == typeof(string) || |
|
85 |
type == typeof(String)) |
|
86 |
{ |
|
87 |
if (string.IsNullOrWhiteSpace(item as string)) |
|
88 |
{ |
|
89 |
throw new ArgumentException(nameOfTheArgument + " is null or Whitespace"); |
|
90 |
} |
|
91 |
} |
|
92 |
else |
|
93 |
{ |
|
94 |
if (item == null) |
|
95 |
{ |
|
96 |
throw new ArgumentException(nameOfTheArgument + " is null"); |
|
97 |
} |
|
98 |
} |
|
99 |
|
|
100 |
} |
|
101 |
} |
|
102 |
|
|
103 |
/// <summary> |
|
104 |
/// Changes all elements of IEnumerable by the change function that do not fullfill the except function |
|
105 |
/// </summary> |
|
106 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
107 |
/// <param name="change">The way you want to change the stuff</param> |
|
108 |
/// <param name="where">The function to check where changes should not be made</param> |
|
109 |
/// <returns> |
|
110 |
/// An IEnumerable with all changes applied |
|
111 |
/// </returns> |
|
112 |
public static IEnumerable<T> ChangeExcept<T>(this IEnumerable<T> enumerable, |
|
113 |
Func<T, T> change, |
|
114 |
Func<T, bool> @where) |
|
115 |
{ |
|
116 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
117 |
ArgumentCheck.IsNullorWhiteSpace(change, "change"); |
|
118 |
ArgumentCheck.IsNullorWhiteSpace(@where, "where"); |
|
119 |
|
|
120 |
foreach (var item in enumerable) |
|
121 |
{ |
|
122 |
if (!@where(item)) |
|
123 |
{ |
|
124 |
yield return change(item); |
|
125 |
} |
|
126 |
else |
|
127 |
{ |
|
128 |
yield return item; |
|
129 |
} |
|
130 |
} |
|
131 |
} |
|
132 |
|
|
133 |
/// <summary> |
|
134 |
/// Update all elements of IEnumerable by the update function (only works with reference types) |
|
135 |
/// </summary> |
|
136 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
137 |
/// <param name="update">The way you want to change the stuff</param> |
|
138 |
/// <returns> |
|
139 |
/// The same enumerable you passed in |
|
140 |
/// </returns> |
|
141 |
public static IEnumerable<T> Update<T>(this IEnumerable<T> enumerable, |
|
142 |
Action<T> update) where T : class |
|
143 |
{ |
|
144 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
145 |
ArgumentCheck.IsNullorWhiteSpace(update, "update"); |
|
146 |
foreach (var item in enumerable) |
|
147 |
{ |
|
148 |
update(item); |
|
149 |
} |
|
150 |
return enumerable; |
|
151 |
} |
|
152 |
|
|
153 |
/// <summary> |
|
154 |
/// Update all elements of IEnumerable by the update function (only works with reference types) |
|
155 |
/// where the where function returns true |
|
156 |
/// </summary> |
|
157 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
158 |
/// <param name="update">The way you want to change the stuff</param> |
|
159 |
/// <param name="where">The function to check where updates should be made</param> |
|
160 |
/// <returns> |
|
161 |
/// The same enumerable you passed in |
|
162 |
/// </returns> |
|
163 |
public static IEnumerable<T> UpdateWhere<T>(this IEnumerable<T> enumerable, |
|
164 |
Action<T> update, Func<T, bool> where) where T : class |
|
165 |
{ |
|
166 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
167 |
ArgumentCheck.IsNullorWhiteSpace(update, "update"); |
|
168 |
foreach (var item in enumerable) |
|
169 |
{ |
|
170 |
if (where(item)) |
|
171 |
{ |
|
172 |
update(item); |
|
173 |
} |
|
174 |
} |
|
175 |
return enumerable; |
|
176 |
} |
|
177 |
|
|
178 |
/// <summary> |
|
179 |
/// Update all elements of IEnumerable by the update function (only works with reference types) |
|
180 |
/// Except the elements from the where function |
|
181 |
/// </summary> |
|
182 |
/// <param name="enumerable">The enumerable where you want to change stuff</param> |
|
183 |
/// <param name="update">The way you want to change the stuff</param> |
|
184 |
/// <param name="where">The function to check where changes should not be made</param> |
|
185 |
/// <returns> |
|
186 |
/// The same enumerable you passed in |
|
187 |
/// </returns> |
|
188 |
public static IEnumerable<T> UpdateExcept<T>(this IEnumerable<T> enumerable, |
|
189 |
Action<T> update, Func<T, bool> where) where T : class |
|
190 |
{ |
|
191 |
ArgumentCheck.IsNullorWhiteSpace(enumerable, "enumerable"); |
|
192 |
ArgumentCheck.IsNullorWhiteSpace(update, "update"); |
|
193 |
|
|
194 |
foreach (var item in enumerable) |
|
195 |
{ |
|
196 |
if (!where(item)) |
|
197 |
{ |
|
198 |
update(item); |
|
199 |
} |
|
200 |
} |
|
201 |
return enumerable; |
|
202 |
} |
|
203 |
} |
|
204 |
} |
ConvertService/ServiceBase/Markus.Service.Extensions/Helper/ConvertItemComparer.cs | ||
---|---|---|
1 |
using Markus.Service.Interface; |
|
2 |
using System; |
|
3 |
using System.Collections.Generic; |
|
4 |
using System.Linq; |
|
5 |
using System.Text; |
|
6 |
using System.Threading.Tasks; |
|
7 |
|
|
8 |
namespace Markus.Service.Helper |
|
9 |
{ |
|
10 |
public class ConvertItemComparer : IEqualityComparer<ConvertItem> |
|
11 |
{ |
|
12 |
public bool Equals(ConvertItem x, ConvertItem y) |
|
13 |
{ |
|
14 |
if (Object.ReferenceEquals(x, y)) return true; |
|
15 |
|
|
16 |
if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null)) |
|
17 |
return false; |
|
18 |
|
|
19 |
return x.ConvertID == y.ConvertID && x.ProjectNumber == y.ProjectNumber; |
|
20 |
} |
|
21 |
|
|
22 |
|
|
23 |
public int GetHashCode(ConvertItem convertItem) |
|
24 |
{ |
|
25 |
var id = (convertItem.ConvertID != null) ? convertItem.ConvertID : ""; |
|
26 |
var project = (convertItem.ProjectNumber != null) ? convertItem.ProjectNumber : ""; |
|
27 |
|
|
28 |
return (id + project).GetHashCode(); |
|
29 |
} |
|
30 |
} |
|
31 |
} |
ConvertService/ServiceBase/Markus.Service.Extensions/Markus.Service.Extensions.csproj | ||
---|---|---|
66 | 66 |
<Reference Include="System.Xml" /> |
67 | 67 |
</ItemGroup> |
68 | 68 |
<ItemGroup> |
69 |
<Compile Include="Exntensions\CollectionExtensions.cs" /> |
|
69 |
<Compile Include="Exntensions\CollectionExtenstions.cs" />
|
|
70 | 70 |
<Compile Include="Exntensions\Sytem.IO.cs" /> |
71 | 71 |
<Compile Include="Exntensions\SytemNet.cs" /> |
72 | 72 |
<Compile Include="Helper\Compress.cs" /> |
73 |
<Compile Include="Helper\ConvertItemComparer.cs" /> |
|
73 | 74 |
<Compile Include="Helper\GetDownloadFileName.cs" /> |
74 | 75 |
<Compile Include="Helper\MathBytes.cs" /> |
75 | 76 |
<Compile Include="Helper\ObjectToBytesStringConvert.cs" /> |
... | ... | |
87 | 88 |
<ItemGroup> |
88 | 89 |
<None Include="packages.config" /> |
89 | 90 |
</ItemGroup> |
91 |
<ItemGroup> |
|
92 |
<ProjectReference Include="..\IServiceBase\Markus.Service.Interface.csproj"> |
|
93 |
<Project>{4a465fd0-8130-4d6b-a65f-c3cd6cc355a4}</Project> |
|
94 |
<Name>Markus.Service.Interface</Name> |
|
95 |
</ProjectReference> |
|
96 |
</ItemGroup> |
|
90 | 97 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
91 | 98 |
</Project> |
ConvertService/ServiceBase/Markus.Service.Station/Markus.Service.Station.csproj | ||
---|---|---|
156 | 156 |
<None Include="obfuscar.xml"> |
157 | 157 |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
158 | 158 |
</None> |
159 |
<Content Include="ServiceStation.ini"> |
|
159 |
<Content Include="ServiceStation_DEBUG.ini">
|
|
160 | 160 |
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
161 | 161 |
</Content> |
162 | 162 |
<None Include="Properties\DataSources\Markus.Service.IWcfService.Item.datasource" /> |
163 |
<Content Include="ServiceStation.ini"> |
|
164 |
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
|
165 |
</Content> |
|
163 | 166 |
</ItemGroup> |
164 | 167 |
<ItemGroup> |
165 | 168 |
<EmbeddedResource Include="ProjectInstaller.resx"> |
ConvertService/ServiceBase/Markus.Service.Station/ServiceStation.cs | ||
---|---|---|
171 | 171 |
private void Timer_Elapsed(object sender, ElapsedEventArgs e) |
172 | 172 |
{ |
173 | 173 |
timer.Stop(); |
174 |
try |
|
175 |
{ |
|
176 |
if (!IsReleaseItems) |
|
177 |
{ |
|
178 |
ReleaseItems(); |
|
179 |
} |
|
174 | 180 |
|
175 |
if (!IsReleaseItems) |
|
181 |
logger.Info("StationService Info"); |
|
182 |
} |
|
183 |
catch (Exception ex) |
|
176 | 184 |
{ |
177 |
ReleaseItems();
|
|
185 |
logger.Error("Timer Error " ,ex);
|
|
178 | 186 |
} |
179 |
|
|
180 | 187 |
System.Threading.Thread.SpinWait(10000); |
181 | 188 |
|
182 | 189 |
timer.Start(); |
ConvertService/ServiceBase/Markus.Service.Station/ServiceStation.ini | ||
---|---|---|
1 | 1 |
[SERVICE] |
2 |
CONVERT_SERVICE_PROCESS = 3
|
|
2 |
CONVERT_SERVICE_PROCESS = 15
|
|
3 | 3 |
WINDOW = true |
4 | 4 |
IS_STATAION = true |
5 |
STATAION_ADDRESS = http://localhost:9101/StationService |
|
5 |
|
|
6 |
STATAION_ADDRESS = http://LOCALHOST:9101/StationService |
|
6 | 7 |
|
7 | 8 |
SERVICE_ID = 03A98B3B-ECCD-4972-B658-43C7571965DA |
8 | 9 |
|
9 |
# 구분자는 ,
|
|
10 |
# 구분자는 ','
|
|
10 | 11 |
SERVICE_LIST = 03A98B3B-ECCD-4972-B658-43C7571965DA,0AC6FD8E-5060-4B0F-9E6B-A7380B9FCF7B |
11 |
#MarkusDataBaseConnectionString = data source=.\SQLEXPRESS;initial catalog=Markus;persist security info=True;user id=ConvertService;Password=ConvertService;MultipleActiveResultSets=True; |
|
12 |
#MarkusDataBaseConnectionString = data source=DESKTOP-MARKUS;initial catalog=Markus_V3;persist security info=True;user id=doftech;Password=dof1073#;MultipleActiveResultSets=True; |
|
13 |
|
|
14 |
# local test |
|
15 |
#MarkusDataBaseConnectionString = AkxeK6rlR/pvDogtyJST7sHEFe9zDPwVf8W7ulsvVrFnqBcpEKFhacEE4OpBvuJYrkkubP91v40LyQ6mReCd3pXhTAPs5gL4W6eRhG6GszFyxlv0fncEZ+aacRQNNIzTlQCenZdTJdt2ylaRyCRYXb9HZCIeZKcuDef2pn1ny3dp90lB2vv15bn5UIaqIZA8bLSbBTXt8Ft4Xttl4In5Ow== |
|
16 |
|
|
17 |
# remote test MARKUS |
|
18 |
#MarkusDataBaseConnectionString = YNP/egPgsKY5wO/j9T7VgkiSClJH7p9hANqnTbQFNYaOnS1f9eeZS5UzPwsGuI3sy8IS1sJxP4YmPOmv6hnMKUwCZJkjW6ypzHVlGlP3UDDq2i+rz1LKVYIEXpcFMVKUOBMjxQouZ6h/Svf5ohlw3pG4DLKFk7HxUwYot19soGo6wXOTmO722OsWPsVuUbo1 |
|
19 | 12 |
|
20 |
# remote test MARKUS_V3
|
|
21 |
MarkusDataBaseConnectionString = YNP/egPgsKY5wO/j9T7VgkiSClJH7p9hANqnTbQFNYaOnS1f9eeZS5UzPwsGuI3syNfjUnBbiLk37BjsNNWzZevN8Jbd9EzwE9l5g8upXhNqX9eF2brizRZ4ud+GK/35HvqSjvIaz5ggszA3dHT2b+r9279mJXo42QzRBNbUcBgnl2njNNSB7EfckQ5Hwd7eatvWuf3ESIUv4KTqGU5V6A==
|
|
13 |
# DAELIM
|
|
14 |
MarkusDataBaseConnectionString = yRW0I8OJY/boJcR9rTFeH229g456BwO8BaXQbW8h6iCR10JRc5tOl2BDWa1595q0bvW9uD5HsHn9ke4oK3yaw2OYHh8pgYKdhW48xeAl49510h1DPv8uSbqcWdwZ2AjernORxxaEAUqHZb5DFlndcWuid82ZwP/EGxGNhaaCG+KVogeHwI5FZZKrmUTWe3159qk11Q4XswrHeLy8HQn5Qg==
|
|
22 | 15 |
|
23 |
#daelim |
|
24 |
#MarkusDataBaseConnectionString = yRW0I8OJY/boJcR9rTFeH229g456BwO8BaXQbW8h6iCR10JRc5tOl2BDWa1595q0bvW9uD5HsHn9ke4oK3yaw2OYHh8pgYKdhW48xeAl49510h1DPv8uSbqcWdwZ2AjernORxxaEAUqHZb5DFlndcWuid82ZwP/EGxGNhaaCG+KVogeHwI5FZZKrmUTWe3159qk11Q4XswrHeLy8HQn5Qg== |
|
25 |
|
|
26 |
DownloadTempFolder = D:\CONVERT_SERVICE_TEMP |
|
27 |
MULTI_TRHEAD_MAX_PAGE = 250 |
|
16 |
DownloadTempFolder = C:\CONVERT_SERVICE_TEMP |
|
17 |
MULTI_TRHEAD_MAX_PAGE = 150 |
|
28 | 18 |
|
29 | 19 |
# MIN_FONT_SIZE = -1 인 경우 기본 Resolution 100으로 사용 |
30 | 20 |
# 페이지에 설정된 폰트 이하의 문자가 있는 경우 Resolution 200으로 변환 |
... | ... | |
33 | 23 |
|
34 | 24 |
# 설정된 Resolution으로 강제 변환 |
35 | 25 |
# 기본 = 0 |
36 |
USE_RESOLUTION = 150
|
|
26 |
USE_RESOLUTION = 300
|
|
37 | 27 |
|
38 | 28 |
# 상태 저장 간격(페이지당 상태 저장 간각) |
39 | 29 |
# 기본 5 |
40 | 30 |
SAVE_STATUS_INTERVAL = 5 |
41 | 31 |
|
42 | 32 |
# Convert Process의 최대 메모리(GB) |
43 |
RELEASE_WORK_MEMORY = 1 |
|
33 |
RELEASE_WORK_MEMORY = 1.5 |
|
34 |
|
|
44 | 35 |
|
45 | 36 |
# 구분자는 콤마 |
46 |
FITER_PROCECT = 110000,000000,111111
|
|
37 |
FITER_PROCECT = 000000,130351,150052,150128,150472,170062,170098,170108,180087,180105,180108,180116,180146,180183,180220,180229
|
|
47 | 38 |
|
48 | 39 |
[WCF_ENDPOINT] |
49 | 40 |
STATION_PORT = 9101 |
ConvertService/ServiceBase/Markus.Service.Station/ServiceStation_DEBUG.ini | ||
---|---|---|
1 |
[SERVICE] |
|
2 |
CONVERT_SERVICE_PROCESS = 3 |
|
3 |
WINDOW = true |
|
4 |
IS_STATAION = true |
|
5 |
STATAION_ADDRESS = http://localhost:9101/StationService |
|
6 |
|
|
7 |
SERVICE_ID = 03A98B3B-ECCD-4972-B658-43C7571965DA |
|
8 |
|
|
9 |
# 구분자는 , |
|
10 |
SERVICE_LIST = 03A98B3B-ECCD-4972-B658-43C7571965DA,0AC6FD8E-5060-4B0F-9E6B-A7380B9FCF7B |
|
11 |
#MarkusDataBaseConnectionString = data source=.\SQLEXPRESS;initial catalog=Markus;persist security info=True;user id=ConvertService;Password=ConvertService;MultipleActiveResultSets=True; |
|
12 |
#MarkusDataBaseConnectionString = data source=DESKTOP-MARKUS;initial catalog=Markus_V3;persist security info=True;user id=doftech;Password=dof1073#;MultipleActiveResultSets=True; |
|
13 |
|
|
14 |
# local test |
|
15 |
#MarkusDataBaseConnectionString = AkxeK6rlR/pvDogtyJST7sHEFe9zDPwVf8W7ulsvVrFnqBcpEKFhacEE4OpBvuJYrkkubP91v40LyQ6mReCd3pXhTAPs5gL4W6eRhG6GszFyxlv0fncEZ+aacRQNNIzTlQCenZdTJdt2ylaRyCRYXb9HZCIeZKcuDef2pn1ny3dp90lB2vv15bn5UIaqIZA8bLSbBTXt8Ft4Xttl4In5Ow== |
|
16 |
|
|
17 |
# remote test MARKUS |
|
18 |
#MarkusDataBaseConnectionString = YNP/egPgsKY5wO/j9T7VgkiSClJH7p9hANqnTbQFNYaOnS1f9eeZS5UzPwsGuI3sy8IS1sJxP4YmPOmv6hnMKUwCZJkjW6ypzHVlGlP3UDDq2i+rz1LKVYIEXpcFMVKUOBMjxQouZ6h/Svf5ohlw3pG4DLKFk7HxUwYot19soGo6wXOTmO722OsWPsVuUbo1 |
|
19 |
|
|
20 |
# remote test MARKUS_V3 |
|
21 |
MarkusDataBaseConnectionString = YNP/egPgsKY5wO/j9T7VgkiSClJH7p9hANqnTbQFNYaOnS1f9eeZS5UzPwsGuI3syNfjUnBbiLk37BjsNNWzZevN8Jbd9EzwE9l5g8upXhNqX9eF2brizRZ4ud+GK/35HvqSjvIaz5ggszA3dHT2b+r9279mJXo42QzRBNbUcBgnl2njNNSB7EfckQ5Hwd7eatvWuf3ESIUv4KTqGU5V6A== |
|
22 |
|
|
23 |
#daelim |
|
24 |
#MarkusDataBaseConnectionString = yRW0I8OJY/boJcR9rTFeH229g456BwO8BaXQbW8h6iCR10JRc5tOl2BDWa1595q0bvW9uD5HsHn9ke4oK3yaw2OYHh8pgYKdhW48xeAl49510h1DPv8uSbqcWdwZ2AjernORxxaEAUqHZb5DFlndcWuid82ZwP/EGxGNhaaCG+KVogeHwI5FZZKrmUTWe3159qk11Q4XswrHeLy8HQn5Qg== |
|
25 |
|
|
26 |
DownloadTempFolder = D:\CONVERT_SERVICE_TEMP |
|
27 |
MULTI_TRHEAD_MAX_PAGE = 250 |
|
28 |
|
|
29 |
# MIN_FONT_SIZE = -1 인 경우 기본 Resolution 100으로 사용 |
|
30 |
# 페이지에 설정된 폰트 이하의 문자가 있는 경우 Resolution 200으로 변환 |
|
31 |
# 기본 = 10 |
|
32 |
MIN_FONT_SIZE = -1 |
|
33 |
|
|
34 |
# 설정된 Resolution으로 강제 변환 |
|
35 |
# 기본 = 0 |
|
36 |
USE_RESOLUTION = 150 |
|
37 |
|
|
38 |
# 상태 저장 간격(페이지당 상태 저장 간각) |
|
39 |
# 기본 5 |
|
40 |
SAVE_STATUS_INTERVAL = 5 |
|
41 |
|
|
42 |
# Convert Process의 최대 메모리(GB) |
|
43 |
RELEASE_WORK_MEMORY = 1 |
|
44 |
|
|
45 |
# 구분자는 콤마 |
|
46 |
FITER_PROCECT = 000000,130351,150052,150128,150472,170062,170098,170108,180087,180105,180108,180116,180146,180183,180220,180229 |
|
47 |
|
|
48 |
[WCF_ENDPOINT] |
|
49 |
STATION_PORT = 9101 |
|
50 |
CONVERT_PORT = 9102 |
|
51 |
FINAL_PORT = 9103 |
|
52 |
STATION_SERVICE_NAME = StationService |
ConvertService/ServiceBase/Markus.Service.StationController/App.xaml | ||
---|---|---|
6 | 6 |
<Application.Resources> |
7 | 7 |
<ResourceDictionary> |
8 | 8 |
<ResourceDictionary.MergedDictionaries> |
9 |
<ResourceDictionary Source="Themes/ControllerThemes.xaml"/> |
|
9 |
<ResourceDictionary Source="Themes/DefaultThemes.xaml"/> |
|
10 |
<ResourceDictionary Source="Themes/MaterialDesignTheme.xaml"/> |
|
10 | 11 |
<ResourceDictionary Source="Themes/TelerikTheme.xaml"/> |
11 | 12 |
</ResourceDictionary.MergedDictionaries> |
12 | 13 |
</ResourceDictionary> |
ConvertService/ServiceBase/Markus.Service.StationController/Extensions/ConvertItemChangeValue.cs | ||
---|---|---|
1 |
using Markus.Service.WcfClient.StationServiceTask; |
|
2 |
using System; |
|
3 |
using System.Collections.Generic; |
|
4 |
using System.Linq; |
|
5 |
using System.Text; |
|
6 |
using System.Threading.Tasks; |
|
7 |
|
|
8 |
namespace Markus.Service.StationController.Extensions |
|
9 |
{ |
|
10 |
public static class ConvertItemEx |
|
11 |
{ |
|
12 |
public static void ChangeValues(object changeitem, object newitem) |
|
13 |
{ |
|
14 |
var changeProp = changeitem.GetType().GetProperties(); |
|
15 |
var newProp = newitem.GetType().GetProperties(); |
|
16 |
|
|
17 |
foreach (var item in changeProp) |
|
18 |
{ |
|
19 |
|
|
20 |
var newinfo = newProp.Where(x => x.Name == item.Name); |
|
21 |
|
|
22 |
if(newinfo.Count() > 0) |
|
23 |
{ |
|
24 |
item.SetValue(changeitem, newinfo.First().GetValue(newitem)); |
|
25 |
} |
|
26 |
} |
|
27 |
} |
|
28 |
} |
|
29 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/MainWindow.xaml | ||
---|---|---|
7 | 7 |
mc:Ignorable="d" d:DataContext="{d:DesignInstance vm:MainViewModel, IsDesignTimeCreatable=true}" |
8 | 8 |
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" |
9 | 9 |
xmlns:vm="clr-namespace:Markus.Service.StationController.ViewModel" |
10 |
xmlns:packIcon="clr-namespace:Markus.Mvvm.ToolKit.PackIcon;assembly=Markus.Mvvm.ToolKit"
|
|
10 |
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
11 | 11 |
xmlns:localData="clr-namespace:Markus.Service.StationController.Data" |
12 | 12 |
Title="Markus Convert Service" Height="450" Width="800" d:DesignHeight="450" d:DesignWidth="800"> |
13 | 13 |
<Window.Background> |
... | ... | |
24 | 24 |
<Window.DataContext> |
25 | 25 |
<vm:MainViewModel/> |
26 | 26 |
</Window.DataContext> |
27 |
<Grid> |
|
28 |
<Grid> |
|
29 |
<Grid.RowDefinitions> |
|
30 |
<RowDefinition Height="Auto"/> |
|
31 |
<RowDefinition/> |
|
32 |
</Grid.RowDefinitions> |
|
27 |
<materialDesign:DialogHost x:Name="m_dialogHost" Identifier="dialogHost"> |
|
28 |
<materialDesign:DrawerHost IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}"> |
|
29 |
<materialDesign:DrawerHost.LeftDrawerContent> |
|
30 |
<DockPanel MinWidth="212"> |
|
31 |
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}" |
|
32 |
DockPanel.Dock="Top" |
|
33 |
HorizontalAlignment="Right" Margin="16" |
|
34 |
IsChecked="{Binding ElementName=MenuToggleButton, Path=IsChecked, Mode=TwoWay}" /> |
|
35 |
<ListBox x:Name="MenuListBox" Margin="0 16 0 16" SelectedIndex="0" |
|
36 |
ItemsSource="{Binding NavigationItems}" SelectedItem="{Binding SelectNavigationItem}"> |
|
37 |
<i:Interaction.Triggers> |
|
38 |
<i:EventTrigger EventName="PreviewMouseLeftButtonUp"> |
|
39 |
<i:InvokeCommandAction Command="{Binding ListboxItemMouseUpCommand}"/> |
|
40 |
</i:EventTrigger> |
|
41 |
</i:Interaction.Triggers> |
|
42 |
<ListBox.ItemTemplate> |
|
43 |
<DataTemplate DataType="localData:NavigationItem"> |
|
44 |
<TextBlock Text="{Binding Name}" Margin="32 0 32 0" /> |
|
45 |
</DataTemplate> |
|
46 |
</ListBox.ItemTemplate> |
|
47 |
</ListBox> |
|
48 |
</DockPanel> |
|
49 |
</materialDesign:DrawerHost.LeftDrawerContent> |
|
33 | 50 |
<Grid> |
34 |
<Grid.ColumnDefinitions> |
|
35 |
<ColumnDefinition Width="Auto"/> |
|
36 |
<ColumnDefinition Width="Auto"/> |
|
37 |
<ColumnDefinition/> |
|
38 |
</Grid.ColumnDefinitions> |
|
39 |
<telerik:RadToggleButton IsThreeState="False" Width="50"> |
|
40 |
<telerik:RadToggleButton.Content> |
|
41 |
<packIcon:PackIcon Kind="Bike"/> |
|
42 |
</telerik:RadToggleButton.Content> |
|
43 |
<telerik:RadToggleButton.Style> |
|
44 |
<Style TargetType="telerik:RadToggleButton"> |
|
45 |
<Setter Property="telerik:StyleManager.Theme" Value="{x:Null}"/> |
|
46 |
<Setter Property="Background" Value="Transparent"/> |
|
47 |
<Setter Property="BorderThickness" Value="0"/> |
|
48 |
<Style.Triggers> |
|
49 |
<DataTrigger Binding="{Binding IsChecked}" Value="false"> |
|
50 |
<Setter Property="Content" Value="Menu"/> |
|
51 |
</DataTrigger> |
|
52 |
<DataTrigger Binding="{Binding IsChecked}" Value="true"> |
|
53 |
<Setter Property="Content" Value="close"/> |
|
54 |
</DataTrigger> |
|
55 |
</Style.Triggers> |
|
56 |
</Style> |
|
57 |
</telerik:RadToggleButton.Style> |
|
58 |
</telerik:RadToggleButton> |
|
59 |
<TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,0,0,0" Style="{StaticResource TitleTextBoxStyle}" >Markus Convert Management</TextBlock> |
|
60 |
<TextBlock Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" |
|
61 |
Text="{Binding SelectNavigationItem.Description}"/> |
|
51 |
<Grid.RowDefinitions> |
|
52 |
<RowDefinition Height="Auto"/> |
|
53 |
<RowDefinition/> |
|
54 |
</Grid.RowDefinitions> |
|
55 |
<materialDesign:ColorZone Padding="16" materialDesign:ShadowAssist.ShadowDepth="Depth2" |
|
56 |
Mode="PrimaryMid"> |
|
57 |
<DockPanel> |
|
58 |
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}" IsChecked="{Binding IsMenuOpen}" |
|
59 |
x:Name="MenuToggleButton"/> |
|
60 |
<Grid> |
|
61 |
<Grid.ColumnDefinitions> |
|
62 |
<ColumnDefinition Width="Auto"/> |
|
63 |
<ColumnDefinition/> |
|
64 |
</Grid.ColumnDefinitions> |
|
65 |
<TextBlock Style="{StaticResource MaterialDesignSubheadingTextBlock}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,0,0,0" >Markus Convert Management</TextBlock> |
|
66 |
<TextBlock Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" |
|
67 |
Text="{Binding SelectNavigationItem.Description}" |
|
68 |
Style="{StaticResource MaterialDesignDisplay1TextBlock}"/> |
|
69 |
</Grid> |
|
70 |
</DockPanel> |
|
71 |
</materialDesign:ColorZone> |
|
72 |
<Grid Grid.Row="1"> |
|
73 |
<Grid.RowDefinitions> |
|
74 |
<RowDefinition Height="Auto" /> |
|
75 |
<RowDefinition Height="*" /> |
|
76 |
</Grid.RowDefinitions> |
|
77 |
<ScrollViewer Grid.Row="1" |
|
78 |
HorizontalScrollBarVisibility="Auto" |
|
79 |
VerticalScrollBarVisibility="Auto"> |
|
80 |
<ContentControl Content="{Binding SelectNavigationItem.Content}"/> |
|
81 |
</ScrollViewer> |
|
82 |
</Grid> |
|
62 | 83 |
</Grid> |
63 |
<ContentControl Grid.Row="1" Content="{Binding SelectNavigationItem.Content}"/> |
|
64 |
<Grid/> |
|
65 |
</Grid> |
|
66 |
<Grid Background="#807A7A7A"> |
|
67 |
<Grid.ColumnDefinitions> |
|
68 |
<ColumnDefinition Width="Auto"/> |
|
69 |
<ColumnDefinition Width="*"/> |
|
70 |
</Grid.ColumnDefinitions> |
|
71 |
<telerik:RadListBox/> |
|
72 |
</Grid> |
|
73 |
</Grid> |
|
84 |
</materialDesign:DrawerHost> |
|
85 |
</materialDesign:DialogHost> |
|
74 | 86 |
</Window> |
75 | 87 |
|
ConvertService/ServiceBase/Markus.Service.StationController/Markus.Service.StationController.csproj | ||
---|---|---|
65 | 65 |
<Reference Include="Markus.Message, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL"> |
66 | 66 |
<HintPath>..\packages\Markus.Message.1.5.4\lib\net45\Markus.Message.dll</HintPath> |
67 | 67 |
</Reference> |
68 |
<Reference Include="MaterialDesignColors, Version=1.2.0.325, Culture=neutral, processorArchitecture=MSIL"> |
|
69 |
<HintPath>..\packages\MaterialDesignColors.1.2.0\lib\net45\MaterialDesignColors.dll</HintPath> |
|
70 |
</Reference> |
|
71 |
<Reference Include="MaterialDesignThemes.Wpf, Version=2.6.0.325, Culture=neutral, processorArchitecture=MSIL"> |
|
72 |
<HintPath>..\packages\MaterialDesignThemes.2.6.0\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath> |
|
73 |
</Reference> |
|
68 | 74 |
<Reference Include="Microsoft.EntityFrameworkCore"> |
69 | 75 |
<HintPath>C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.entityframeworkcore\2.2.0\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll</HintPath> |
70 | 76 |
</Reference> |
... | ... | |
122 | 128 |
<Compile Include="AppInit.cs" /> |
123 | 129 |
<Compile Include="AppDefine.cs" /> |
124 | 130 |
<Compile Include="Data\NavigationItem.cs" /> |
131 |
<Compile Include="Extensions\ConvertItemChangeValue.cs" /> |
|
125 | 132 |
<Compile Include="ViewModel\DataBaseByStatusViewModel.cs" /> |
126 | 133 |
<Compile Include="ViewModel\AliveViewModel.cs" /> |
127 | 134 |
<Compile Include="ViewModel\MainViewModel.cs" /> |
... | ... | |
153 | 160 |
<DependentUpon>MainWindow.xaml</DependentUpon> |
154 | 161 |
<SubType>Code</SubType> |
155 | 162 |
</Compile> |
156 |
<Page Include="Themes\ControllerThemes.xaml">
|
|
163 |
<Page Include="Themes\DefaultThemes.xaml">
|
|
157 | 164 |
<SubType>Designer</SubType> |
158 | 165 |
<Generator>MSBuild:Compile</Generator> |
159 | 166 |
</Page> |
167 |
<Page Include="Themes\MaterialDesignTheme.xaml"> |
|
168 |
<Generator>MSBuild:Compile</Generator> |
|
169 |
<SubType>Designer</SubType> |
|
170 |
</Page> |
|
160 | 171 |
<Page Include="Themes\TelerikTheme.xaml"> |
161 | 172 |
<SubType>Designer</SubType> |
162 | 173 |
<Generator>MSBuild:Compile</Generator> |
... | ... | |
225 | 236 |
<None Include="Resources\Tranfer_Error.ico" /> |
226 | 237 |
</ItemGroup> |
227 | 238 |
<ItemGroup> |
239 |
<ProjectReference Include="..\IServiceBase\Markus.Service.Interface.csproj"> |
|
240 |
<Project>{4A465FD0-8130-4D6B-A65F-C3CD6CC355A4}</Project> |
|
241 |
<Name>Markus.Service.Interface</Name> |
|
242 |
</ProjectReference> |
|
228 | 243 |
<ProjectReference Include="..\Markus.Mvvm.ToolKit\Markus.Mvvm.ToolKit.csproj"> |
229 | 244 |
<Project>{9efe95d6-9985-422a-a76f-285c8cf73617}</Project> |
230 | 245 |
<Name>Markus.Mvvm.ToolKit</Name> |
231 | 246 |
</ProjectReference> |
247 |
<ProjectReference Include="..\Markus.Service.DataBase\Markus.Service.DataBase.csproj"> |
|
248 |
<Project>{400736fb-92c9-4bc0-b447-e8274103d813}</Project> |
|
249 |
<Name>Markus.Service.DataBase</Name> |
|
250 |
</ProjectReference> |
|
232 | 251 |
<ProjectReference Include="..\Markus.Service.Extensions\Markus.Service.Extensions.csproj"> |
233 | 252 |
<Project>{5f983789-3e8f-4f9a-a601-138c3a83ca5f}</Project> |
234 | 253 |
<Name>Markus.Service.Extensions</Name> |
... | ... | |
250 | 269 |
<Install>false</Install> |
251 | 270 |
</BootstrapperPackage> |
252 | 271 |
</ItemGroup> |
272 |
<ItemGroup /> |
|
253 | 273 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
254 | 274 |
<PropertyGroup> |
255 | 275 |
<PostBuildEvent>mkdir $(TargetDir)Bin |
ConvertService/ServiceBase/Markus.Service.StationController/StationController.ini | ||
---|---|---|
1 | 1 |
[SERVICE] |
2 |
SERVICE_ADDRESS = http://localhost:9101/StationService,http://localhost:9991/StationService
|
|
2 |
SERVICE_ADDRESS = http://172.20.120.142:9991/StationService
|
|
3 | 3 |
|
4 | 4 |
# remote test MARKUS_V3 |
5 | 5 |
MarkusDataBaseConnectionString = YNP/egPgsKY5wO/j9T7VgkiSClJH7p9hANqnTbQFNYaOnS1f9eeZS5UzPwsGuI3syNfjUnBbiLk37BjsNNWzZevN8Jbd9EzwE9l5g8upXhNqX9eF2brizRZ4ud+GK/35HvqSjvIaz5ggszA3dHT2b+r9279mJXo42QzRBNbUcBgnl2njNNSB7EfckQ5Hwd7eatvWuf3ESIUv4KTqGU5V6A== |
ConvertService/ServiceBase/Markus.Service.StationController/Themes/DefaultThemes.xaml | ||
---|---|---|
1 |
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
2 |
xmlns:toolkit="clr-namespace:Markus.Mvvm.ToolKit;assembly=Markus.Mvvm.ToolKit" |
|
3 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
4 |
<!--color--> |
|
5 |
<!--color--> |
|
6 |
<Style TargetType="TextBlock" x:Key="TitleTextBoxStyle"> |
|
7 |
<Setter Property="FontSize" Value="18"/> |
|
8 |
<Setter Property="FontWeight" Value="Bold"/> |
|
9 |
<Setter Property="Foreground" Value="White"/> |
|
10 |
</Style> |
|
11 |
<Style TargetType="TextBlock" x:Key="SelectMenuTextBoxStyle"> |
|
12 |
<Setter Property="FontSize" Value="26"/> |
|
13 |
<Setter Property="FontWeight" Value="Bold"/> |
|
14 |
<Setter Property="Foreground" Value="White"/> |
|
15 |
</Style> |
|
16 |
</ResourceDictionary> |
ConvertService/ServiceBase/Markus.Service.StationController/Themes/MaterialDesignTheme.xaml | ||
---|---|---|
1 |
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
2 |
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" |
|
3 |
xmlns:system="clr-namespace:System;assembly=mscorlib" |
|
4 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
5 |
<ResourceDictionary.MergedDictionaries> |
|
6 |
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml"/> |
|
7 |
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml"/> |
|
8 |
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml" /> |
|
9 |
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.DeepPurple.xaml" /> |
|
10 |
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" /> |
|
11 |
</ResourceDictionary.MergedDictionaries> |
|
12 |
</ResourceDictionary> |
ConvertService/ServiceBase/Markus.Service.StationController/Themes/TelerikTheme.xaml | ||
---|---|---|
1 |
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
2 |
xmlns:system="clr-namespace:System;assembly=mscorlib" |
|
3 |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
|
4 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
5 |
<ResourceDictionary.MergedDictionaries> |
|
6 |
<ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/System.Windows.xaml"/> |
|
7 |
<ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.xaml"/> |
|
8 |
<ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Input.xaml"/> |
|
9 |
<ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.GridView.xaml"/> |
|
10 |
</ResourceDictionary.MergedDictionaries> |
|
11 |
<Style TargetType="telerik:RadGridView"> |
|
12 |
<Setter Property="ShowGroupPanel" Value="False"/> |
|
13 |
</Style> |
|
14 |
</ResourceDictionary> |
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/AliveViewModel.cs | ||
---|---|---|
6 | 6 |
using System.Text; |
7 | 7 |
using System.Threading.Tasks; |
8 | 8 |
using Markus.Service.Extensions; |
9 |
|
|
9 |
using Markus.Service.Helper; |
|
10 |
using Markus.Service.StationController.Extensions; |
|
10 | 11 |
|
11 | 12 |
namespace Markus.Service.StationController.ViewModel |
12 | 13 |
{ |
... | ... | |
14 | 15 |
{ |
15 | 16 |
BackgroundWorker backgroundWorker; |
16 | 17 |
|
17 |
private List<ConvertItem> aliveItems;
|
|
18 |
private System.Collections.ObjectModel.ObservableCollection<ConvertItem> aliveItems;
|
|
18 | 19 |
private bool isLoading; |
19 | 20 |
|
20 |
public List<ConvertItem> AliveItems
|
|
21 |
public System.Collections.ObjectModel.ObservableCollection<ConvertItem> AliveItems
|
|
21 | 22 |
{ |
22 | 23 |
get => aliveItems; set |
23 | 24 |
{ |
... | ... | |
73 | 74 |
newitems.AddRange(items); |
74 | 75 |
} |
75 | 76 |
} |
76 |
|
|
77 | 77 |
|
78 |
if (AliveItems == null) |
|
79 |
{ |
|
80 |
AliveItems = new System.Collections.ObjectModel.ObservableCollection<ConvertItem>(); |
|
78 | 81 |
|
79 |
//newitems.UpdateWhere(AliveItems, new ConvertItem().ConvertID); |
|
82 |
foreach (var item in newitems) |
|
83 |
{ |
|
84 |
AliveItems.Add(item); |
|
85 |
} |
|
86 |
} |
|
87 |
else |
|
88 |
{ |
|
89 |
/// 데이터 업데이트 |
|
90 |
newitems.ForEach(newitem => |
|
91 |
{ |
|
92 |
AliveItems.UpdateWhere(changeitem => ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID); |
|
93 |
}); |
|
80 | 94 |
|
81 |
AliveItems = newitems; |
|
95 |
// 추가 |
|
96 |
foreach (var item in newitems) |
|
97 |
{ |
|
98 |
if (AliveItems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0) |
|
99 |
{ |
|
100 |
AliveItems.Add(item); |
|
101 |
} |
|
102 |
} |
|
103 |
|
|
104 |
/// 삭제 |
|
105 |
|
|
106 |
for (int i = AliveItems.Count() -1; i > -1; --i) |
|
107 |
{ |
|
108 |
var item = AliveItems[i]; |
|
82 | 109 |
|
110 |
if (newitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0) |
|
111 |
{ |
|
112 |
AliveItems.RemoveAt(i); |
|
113 |
} |
|
114 |
} |
|
115 |
} |
|
83 | 116 |
} |
84 | 117 |
catch (Exception ex) |
85 | 118 |
{ |
... | ... | |
88 | 121 |
|
89 | 122 |
} |
90 | 123 |
|
124 |
|
|
125 |
|
|
91 | 126 |
|
92 | 127 |
public static bool SimplePing(string uri) |
93 | 128 |
{ |
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseByStatusViewModel.cs | ||
---|---|---|
7 | 7 |
using System.Threading.Tasks; |
8 | 8 |
using Markus.Service.Extensions; |
9 | 9 |
using Markus.Message; |
10 |
using Markus.Service.WcfClient.StationServiceTask; |
|
10 |
using Markus.Service.StationController.Extensions; |
|
11 |
using Markus.Service.Interface; |
|
11 | 12 |
|
12 | 13 |
namespace Markus.Service.StationController.ViewModel |
13 | 14 |
{ |
... | ... | |
15 | 16 |
{ |
16 | 17 |
BackgroundWorker backgroundWorker; |
17 | 18 |
|
18 |
private List<ConvertItem> items; |
|
19 |
private System.Collections.ObjectModel.ObservableCollection<ConvertItem> items; |
|
20 |
private ConvertItem selectItem; |
|
21 |
|
|
19 | 22 |
private StatusCodeType statusType; |
20 | 23 |
private bool isLoading; |
21 | 24 |
|
22 |
public List<ConvertItem> Items
|
|
25 |
public System.Collections.ObjectModel.ObservableCollection<ConvertItem> Items
|
|
23 | 26 |
{ |
24 | 27 |
get => items; set |
25 | 28 |
{ |
... | ... | |
28 | 31 |
} |
29 | 32 |
} |
30 | 33 |
|
31 |
|
|
34 |
public ConvertItem SelectItem |
|
35 |
{ |
|
36 |
get => selectItem; set |
|
37 |
{ |
|
38 |
selectItem = value; |
|
39 |
OnPropertyChanged(() => SelectItem); |
|
40 |
} |
|
41 |
} |
|
42 |
|
|
43 |
|
|
32 | 44 |
public StatusCodeType StatusType |
33 | 45 |
{ |
34 | 46 |
get => statusType; set |
... | ... | |
50 | 62 |
} |
51 | 63 |
} |
52 | 64 |
|
65 |
|
|
66 |
|
|
53 | 67 |
public DataBaseByStatusViewModel() |
54 | 68 |
{ |
55 | 69 |
} |
... | ... | |
65 | 79 |
} |
66 | 80 |
|
67 | 81 |
// BackgroundWorker에서 수행할 일을 정의. |
68 |
private async void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
|
|
82 |
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) |
|
69 | 83 |
{ |
70 | 84 |
while (IsAcitve) |
71 | 85 |
{ |
... | ... | |
77 | 91 |
|
78 | 92 |
List<ConvertItem> newitems = new List<ConvertItem>(); |
79 | 93 |
|
80 |
foreach (var client in App.StationClientList)
|
|
94 |
using (Markus.Service.DataBase.ConvertDatabase database = new Markus.Service.DataBase.ConvertDatabase(App.MarkusDataBaseConnecitonString))
|
|
81 | 95 |
{ |
82 |
var items = await client.AliveConvertListAsync(); |
|
83 |
|
|
84 |
newitems.AddRange(items); |
|
96 |
newitems = database.GetConvertItems(StatusType, x=>x.CREATE_DATETIME > DateTime.Today,10).ToList(); |
|
85 | 97 |
} |
86 | 98 |
|
87 |
//newitems.Update(Items);
|
|
88 |
|
|
89 |
Items = newitems;
|
|
99 |
if (Items == null)
|
|
100 |
{ |
|
101 |
Items = new System.Collections.ObjectModel.ObservableCollection<ConvertItem>();
|
|
90 | 102 |
|
103 |
foreach (var item in newitems) |
|
104 |
{ |
|
105 |
Items.Add(item); |
|
106 |
} |
|
107 |
} |
|
108 |
else |
|
109 |
{ |
|
110 |
/// 데이터 업데이트 |
|
111 |
newitems.ForEach(newitem => |
|
112 |
{ |
|
113 |
Items.UpdateWhere(changeitem => ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID); |
|
114 |
}); |
|
115 |
|
|
116 |
// 추가 |
|
117 |
foreach (var item in newitems) |
|
118 |
{ |
|
119 |
if (Items.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0) |
|
120 |
{ |
|
121 |
Items.Add(item); |
|
122 |
} |
|
123 |
} |
|
124 |
|
|
125 |
/// 삭제 |
|
126 |
|
|
127 |
for (int i = Items.Count() - 1; i > -1; --i) |
|
128 |
{ |
|
129 |
var item = Items[i]; |
|
130 |
|
|
131 |
if (newitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0) |
|
132 |
{ |
|
133 |
Items.RemoveAt(i); |
|
134 |
} |
|
135 |
} |
|
136 |
} |
|
91 | 137 |
} |
92 | 138 |
catch (Exception ex) |
93 | 139 |
{ |
... | ... | |
100 | 146 |
{ |
101 | 147 |
base.Loaded(); |
102 | 148 |
|
103 |
backgroundWorker = new BackgroundWorker(); |
|
104 |
backgroundWorker.DoWork += backgroundWorker_DoWork; |
|
105 |
backgroundWorker.RunWorkerCompleted += backgroundWorker_RunWorkerCompleted; |
|
106 |
backgroundWorker.WorkerReportsProgress = false; |
|
107 |
backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker_ProgressChanged); |
|
149 |
if (!IsDesignMode) |
|
150 |
{ |
|
151 |
backgroundWorker = new BackgroundWorker(); |
|
152 |
backgroundWorker.DoWork += backgroundWorker_DoWork; |
|
153 |
backgroundWorker.RunWorkerCompleted += backgroundWorker_RunWorkerCompleted; |
|
154 |
backgroundWorker.WorkerReportsProgress = false; |
|
155 |
backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker_ProgressChanged); |
|
108 | 156 |
|
109 |
backgroundWorker.RunWorkerAsync(); |
|
157 |
backgroundWorker.RunWorkerAsync(); |
|
158 |
} |
|
110 | 159 |
} |
111 | 160 |
|
112 | 161 |
public override void Closed() |
113 | 162 |
{ |
114 |
backgroundWorker.DoWork -= backgroundWorker_DoWork; |
|
115 |
backgroundWorker.RunWorkerCompleted -= backgroundWorker_RunWorkerCompleted; |
|
116 |
backgroundWorker.WorkerReportsProgress = false; |
|
117 |
backgroundWorker.ProgressChanged -= new ProgressChangedEventHandler(backgroundWorker_ProgressChanged); |
|
163 |
if (!IsDesignMode) |
|
164 |
{ |
|
165 |
backgroundWorker.DoWork -= backgroundWorker_DoWork; |
|
166 |
backgroundWorker.RunWorkerCompleted -= backgroundWorker_RunWorkerCompleted; |
|
167 |
backgroundWorker.WorkerReportsProgress = false; |
|
168 |
backgroundWorker.ProgressChanged -= new ProgressChangedEventHandler(backgroundWorker_ProgressChanged); |
|
118 | 169 |
|
119 |
backgroundWorker.Dispose(); |
|
170 |
backgroundWorker.Dispose(); |
|
171 |
} |
|
120 | 172 |
|
121 | 173 |
base.Closed(); |
122 | 174 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/Views/DataBaseByStatusView.xaml | ||
---|---|---|
4 | 4 |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
5 | 5 |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 | 6 |
mc:Ignorable="d" |
7 |
xmlns:markusMsg="clr-namespace:Markus.Message;assembly=Markus.Message" |
|
7 | 8 |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
8 | 9 |
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" |
9 | 10 |
xmlns:vm="clr-namespace:Markus.Service.StationController.ViewModel" |
10 | 11 |
d:DesignHeight="450" d:DesignWidth="800"> |
11 | 12 |
<UserControl.DataContext> |
12 |
<vm:AliveViewModel/>
|
|
13 |
<vm:DataBaseByStatusViewModel StatusType="Completed"/>
|
|
13 | 14 |
</UserControl.DataContext> |
14 | 15 |
<i:Interaction.Triggers> |
15 | 16 |
<i:EventTrigger EventName="Loaded"> |
... | ... | |
20 | 21 |
</i:EventTrigger> |
21 | 22 |
</i:Interaction.Triggers> |
22 | 23 |
<Grid> |
24 |
|
|
23 | 25 |
<Grid.RowDefinitions> |
24 | 26 |
<RowDefinition Height="*"/> |
25 | 27 |
<RowDefinition Height="Auto"/> |
26 | 28 |
</Grid.RowDefinitions> |
27 |
<telerik:RadGridView ItemsSource="{Binding AliveItems}" AutoGenerateColumns="False"
|
|
29 |
<telerik:RadGridView ItemsSource="{Binding Items}" AutoGenerateColumns="False" SelectedItem="{Binding SelectItem}"
|
|
28 | 30 |
x:Name="DataGrid" ScrollViewer.CanContentScroll="False"> |
29 | 31 |
<telerik:RadGridView.Columns> |
30 | 32 |
<telerik:GridViewDataColumn Header="Service ID" DataMemberBinding="{Binding ServiceID}"/> |
ConvertService/ServiceBase/Markus.Service.StationController/Views/DataBaseByStatusView.xaml.cs | ||
---|---|---|
1 |
using System; |
|
1 |
using Markus.Message; |
|
2 |
using System; |
|
2 | 3 |
using System.Collections.Generic; |
3 | 4 |
using System.Linq; |
4 | 5 |
using System.Text; |
... | ... | |
24 | 25 |
{ |
25 | 26 |
InitializeComponent(); |
26 | 27 |
} |
28 |
|
|
29 |
public static readonly DependencyProperty StatusTypeProperty = DependencyProperty.Register("StatusTypes", typeof(IList<string>), typeof(DataBaseByStatusView) |
|
30 |
,new FrameworkPropertyMetadata(){ BindsTwoWayByDefault=true }); |
|
31 |
|
|
32 |
public IList<StatusCodeType> StatusType |
|
33 |
{ |
|
34 |
get { return (IList<StatusCodeType>)GetValue(StatusTypeProperty); } |
|
35 |
set { SetValue(StatusTypeProperty, value); } |
|
36 |
} |
|
27 | 37 |
} |
28 | 38 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/Views/MergeDataView.xaml | ||
---|---|---|
4 | 4 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
5 | 5 |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
6 | 6 |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
7 |
xmlns:markus="clr-namespace:Markus.Message;assembly=Markus.Message" |
내보내기 Unified diff