개정판 f0ad40d3
Process Kill 완료
Change-Id: I63e6eaa9eebd57eb3835eeeca651084b8d66d7f2
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseItemsModel.cs | ||
---|---|---|
158 | 158 |
set |
159 | 159 |
{ |
160 | 160 |
_FilterConvertSource = value; |
161 |
OnPropertyChanged(() => FilterConvertSource); |
|
161 |
OnPropertyChanged(() => FilterConvertSource);
|
|
162 | 162 |
} |
163 | 163 |
} |
164 | 164 |
|
... | ... | |
592 | 592 |
} |
593 | 593 |
} |
594 | 594 |
|
595 |
|
|
595 |
|
|
596 | 596 |
|
597 | 597 |
#endregion |
598 | 598 |
|
... | ... | |
1014 | 1014 |
itemsToEach.UniqueKey = item.UniqueKey; |
1015 | 1015 |
itemsToEach.GroupNo = item.GroupNo; |
1016 | 1016 |
itemsToEach.DocumentName = item.DocumnetName; |
1017 |
itemsToEach.Revision = item.Revision;
|
|
1017 |
itemsToEach.Revision = item.Revision; |
|
1018 | 1018 |
itemsToEach.Exception = item.Exception; |
1019 | 1019 |
itemsToEach.ConvertPath = item.ConvertPath; |
1020 | 1020 |
itemsToEach.CreateTime = item.CreateTime; |
... | ... | |
1192 | 1192 |
|
1193 | 1193 |
public async void SetCleanUpItem(ConvertPDF _ConvertItem) |
1194 | 1194 |
{ |
1195 |
|
|
1195 |
|
|
1196 | 1196 |
var items = await WcfClient.GET_SELECT_CONVERT_ITEMAsync(_ConvertItem.ConvertID, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); |
1197 |
|
|
1197 |
|
|
1198 | 1198 |
if (items.Count() > 0) |
1199 | 1199 |
{ |
1200 | 1200 |
var item = items.First(); |
... | ... | |
1314 | 1314 |
|
1315 | 1315 |
private void Stop_Process(object obj) |
1316 | 1316 |
{ |
1317 |
|
|
1317 |
|
|
1318 | 1318 |
string convertid = ""; |
1319 | 1319 |
|
1320 |
#if RELEASE
|
|
1320 |
#if DEBUG
|
|
1321 | 1321 |
convertid = "TEST"; |
1322 | 1322 |
#endif |
1323 |
if (obj is ConvertPDF)
|
|
1323 |
if (SelectRealConvert != null)
|
|
1324 | 1324 |
{ |
1325 |
if (obj != null)
|
|
1325 |
if (AliveItems.Count(x => x.ConvertID == SelectRealConvert.ConvertID) == 0)
|
|
1326 | 1326 |
{ |
1327 |
var convertitem = obj as ConvertPDF; |
|
1328 |
|
|
1329 |
SelectRealConvert = convertitem; |
|
1330 |
|
|
1331 |
SelectAliveConvert = convertitem; |
|
1332 |
|
|
1333 |
convertid = convertitem.ConvertID; |
|
1327 |
convertid = SelectRealConvert.ConvertID; |
|
1328 |
} |
|
1329 |
} |
|
1330 |
if (SelectAliveConvert != null) |
|
1331 |
{ |
|
1332 |
if (RealConvertSource.Count(x => x.ConvertID == SelectAliveConvert.ConvertID) == 0) |
|
1333 |
{ |
|
1334 |
convertid = SelectAliveConvert.ConvertID; |
|
1334 | 1335 |
} |
1335 | 1336 |
} |
1336 | 1337 |
|
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/FinalPDFViewModel.cs | ||
---|---|---|
1394 | 1394 |
|
1395 | 1395 |
private void Stop_Process(object obj) |
1396 | 1396 |
{ |
1397 |
if (SelectFilterConvertList.Count() > 1) |
|
1397 |
|
|
1398 |
string convertid = ""; |
|
1399 |
|
|
1400 |
#if DEBUG |
|
1401 |
convertid = "TEST"; |
|
1402 |
#endif |
|
1403 |
if (SelectRealConvert != null) |
|
1398 | 1404 |
{ |
1399 |
MessageBox.Show("하나만 클릭해 주세요"); |
|
1405 |
if (AliveItems.Count(x => x.ConvertID == SelectRealConvert.ConvertID) == 0) |
|
1406 |
{ |
|
1407 |
convertid = SelectRealConvert.ConvertID; |
|
1408 |
} |
|
1400 | 1409 |
} |
1401 |
else
|
|
1410 |
if (SelectAliveConvert != null)
|
|
1402 | 1411 |
{ |
1403 |
RadWindow.Alert("프로세스 종료 할까요??", this.ON_Stop_Process); |
|
1404 |
|
|
1412 |
if (RealConvertSource.Count(x => x.ConvertID == SelectAliveConvert.ConvertID) == 0) |
|
1413 |
{ |
|
1414 |
convertid = SelectAliveConvert.ConvertID; |
|
1415 |
} |
|
1405 | 1416 |
} |
1406 | 1417 |
|
1418 |
EventHandler<WindowClosedEventArgs> handler = (snd, evt) => |
|
1419 |
{ |
|
1420 |
var result = evt.DialogResult; |
|
1421 |
|
|
1422 |
if (result == true) |
|
1423 |
{ |
|
1424 |
Stop_Process(convertid); |
|
1425 |
} |
|
1426 |
}; |
|
1427 |
|
|
1428 |
//ID 찾아서 멈춰라 |
|
1429 |
RadWindow.Confirm("프로세스 종료 할까요??", handler); |
|
1407 | 1430 |
} |
1408 | 1431 |
|
1409 |
private void ON_Stop_Process(object sender, WindowClosedEventArgs e)
|
|
1432 |
private void Stop_Process(string convertId)
|
|
1410 | 1433 |
{ |
1411 |
var result = e.DialogResult; |
|
1412 |
if (result == true) |
|
1413 |
{ |
|
1414 |
var process = Process.GetProcessesByName("Markus.Service.ConvertProcess"); |
|
1415 | 1434 |
|
1416 |
for (int i = process.Count() - 1; i >= 0; i--) |
|
1435 |
var process = Process.GetProcessesByName("Markus.Service.ConvertProcess"); |
|
1436 |
|
|
1437 |
for (int i = process.Count() - 1; i >= 0; i--) |
|
1438 |
{ |
|
1439 |
try |
|
1417 | 1440 |
{ |
1418 |
try |
|
1419 |
{ |
|
1420 |
var commandLines = process[i].Arguments().CommandLine; |
|
1441 |
var commandLines = process[i].Arguments().CommandLine; |
|
1421 | 1442 |
|
1422 |
if (commandLines.Count() > 0) |
|
1443 |
if (commandLines.Count() > 0) |
|
1444 |
{ |
|
1445 |
if (commandLines[0] == convertId) |
|
1423 | 1446 |
{ |
1424 |
if (commandLines[0] == "TEST" && commandLines[1] == "1") |
|
1425 |
{ |
|
1426 |
process[i].Kill(); |
|
1427 |
} |
|
1428 |
//if (AliveItems.Count(f => f.ConvertID == commandLines[0]) == 0) |
|
1429 |
//{ |
|
1430 |
// process[i].Kill(); |
|
1431 |
//} |
|
1447 |
process[i].Kill(); |
|
1432 | 1448 |
} |
1433 | 1449 |
} |
1434 |
catch (Exception ex)
|
|
1435 |
{
|
|
1436 |
System.Diagnostics.Debug.WriteLine(ex.ToString());
|
|
1437 |
}
|
|
1450 |
}
|
|
1451 |
catch (Exception ex)
|
|
1452 |
{
|
|
1453 |
System.Diagnostics.Debug.WriteLine(ex.ToString());
|
|
1438 | 1454 |
} |
1439 | 1455 |
} |
1440 | 1456 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/Views/DataBaseView.xaml | ||
---|---|---|
8 | 8 |
xmlns:VM="clr-namespace:Markus.Service.StationController.ViewModel" |
9 | 9 |
xmlns:Data="clr-namespace:Markus.Service.StationController.Data" |
10 | 10 |
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" |
11 |
xmlns:local="clr-namespace:Markus.Service.StationController.Views" x:Class="Markus.Service.StationController.Views.DataBaseView" |
|
11 |
xmlns:local="clr-namespace:Markus.Service.StationController.Views" x:Name="userControl" x:Class="Markus.Service.StationController.Views.DataBaseView"
|
|
12 | 12 |
mc:Ignorable="d" Background="White" DataContext="{DynamicResource DataBaseItemsModel}" d:DesignHeight="450" d:DesignWidth="1000"> |
13 | 13 |
<UserControl.Resources> |
14 | 14 |
<Style TargetType="telerik:GridViewCell" x:Key="StretchCellStyle"> |
... | ... | |
148 | 148 |
</DataTemplate> |
149 | 149 |
</telerik:GridViewDataColumn.CellTemplate> |
150 | 150 |
</telerik:GridViewDataColumn> |
151 |
|
|
151 |
|
|
152 | 152 |
<telerik:GridViewDataColumn Header="ProjectNO" |
153 | 153 |
DataMemberBinding="{Binding ProjectNumber}" Width="*" /> |
154 | 154 |
<telerik:GridViewDataColumn Header="UniqueKey" |
... | ... | |
225 | 225 |
<telerik:RadMenuItem Header="Convert" Command="{Binding ConvertCommand}"/> |
226 | 226 |
<telerik:RadMenuItem Header="Validation" Command="{Binding ValidateCommand}"/> |
227 | 227 |
<telerik:RadMenuItem Header="Delete" Command="{Binding DeleteCommand}"/> |
228 |
<telerik:RadMenuItem Header="Stop Process" Command="{Binding Stop_ProcessCommand, Source={StaticResource DataBaseItemsModel}}" CommandParameter="{Binding DataContext, RelativeSource={RelativeSource Self}}"/>
|
|
228 |
<telerik:RadMenuItem Header="Stop Process" Command="{Binding Stop_ProcessCommand}" />
|
|
229 | 229 |
</telerik:RadContextMenu> |
230 | 230 |
</telerik:RadContextMenu.ContextMenu> |
231 | 231 |
<telerik:RadGridView.Columns> |
... | ... | |
234 | 234 |
|
235 | 235 |
<telerik:GridViewDataColumn Header="Convert ID" |
236 | 236 |
DataMemberBinding="{Binding ConvertID}" Width="*" /> |
237 |
<telerik:GridViewDataColumn Header="Markus " Width="0.5*" CellStyle="{StaticResource StretchCellStyle}"> |
|
237 |
|
|
238 |
<telerik:GridViewDataColumn Header="Markus " Width="0.5*" > |
|
238 | 239 |
<telerik:GridViewDataColumn.CellTemplate> |
239 | 240 |
<DataTemplate> |
240 |
<telerik:RadButton Content="Click " BorderThickness="0" Background="Transparent" |
|
241 |
<telerik:RadButton Content="Click" BorderThickness="0" |
|
242 |
Background="Transparent" |
|
241 | 243 |
Command="{Binding MarkusLinkCommand, Source={StaticResource DataBaseItemsModel}}" CommandParameter="{Binding DataContext, RelativeSource={RelativeSource Self}}"/> |
242 | 244 |
</DataTemplate> |
243 | 245 |
</telerik:GridViewDataColumn.CellTemplate> |
... | ... | |
293 | 295 |
</telerik:RadGridView.Columns> |
294 | 296 |
</telerik:RadGridView> |
295 | 297 |
</telerik:RadExpander> |
296 |
|
|
298 |
|
|
297 | 299 |
<telerik:RadExpander Grid.Row="4" ExpandDirection="Down" BorderThickness="0" VerticalAlignment="Stretch" Margin="0,0,0,10" |
298 | 300 |
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" |
299 | 301 |
telerik:AnimationManager.IsAnimationEnabled="False" IsExpanded ="{Binding AliveShow, Mode=TwoWay}"> |
... | ... | |
337 | 339 |
</telerik:GridViewDataColumn> |
338 | 340 |
|
339 | 341 |
<telerik:GridViewDataColumn Header="ProjectNO" |
340 |
DataMemberBinding="{Binding ProjectNumber}" Width="*" />
|
|
342 |
DataMemberBinding="{Binding ProjectNumber}" Width="*" /> |
|
341 | 343 |
<telerik:GridViewDataColumn Header="UniqueKey" |
342 | 344 |
DataMemberBinding="{Binding UniqueKey}" Width="*" /> |
343 | 345 |
<telerik:GridViewDataColumn Header="ConvertState" |
내보내기 Unified diff