개정판 fd19a116
Fix: Conslidate할때 Z정렬이 유지되지 않는 오류 수정
Change-Id: I54e1878e0365f94ede14e366e6e769fe9fd4b4ec
KCOM/Events/Implementation/TopMenuEvent.cs | ||
---|---|---|
36 | 36 |
{ |
37 | 37 |
public partial class TopMenu : UserControl |
38 | 38 |
{ |
39 |
public int rotateOffSet = 0; |
|
40 |
private double[] rotateValue = { 0, 90, 180, 270 }; |
|
41 | 39 |
public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; } |
42 | 40 |
public bool isClosed = true; |
43 | 41 |
|
... | ... | |
69 | 67 |
Error, |
70 | 68 |
} |
71 | 69 |
|
72 |
/// <summary> |
|
73 |
/// comment의 속성 변경시 저장여부 확인 하도록 undocommand에 추가 |
|
74 |
/// </summary> |
|
75 |
/// <param name="adnoerFinal"></param> |
|
76 |
public void ChangeComment(Controls.AdornerFinal adnoerFinal) |
|
77 |
{ |
|
78 |
var adornerMembers = adnoerFinal.Members.Cast<Controls.AdornerMember>(); |
|
79 |
|
|
80 |
if (adornerMembers.Count() > 0) |
|
81 |
{ |
|
82 |
//UndoCommand.Instance.Push(adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList(), adnoerFinal.AngleValue); |
|
83 |
UndoCommand.Instance.Push(EventType.Operation, adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList()); |
|
84 |
} |
|
85 |
} |
|
86 |
|
|
87 | 70 |
//강인구 추가(Undo End) |
88 | 71 |
private void SetPaintEvent() |
89 | 72 |
{ |
... | ... | |
273 | 256 |
/// </summary> |
274 | 257 |
/// <param name="sender"></param> |
275 | 258 |
/// <param name="e"></param> |
276 |
public void SaveEventCallback(object sender, RoutedEventArgs e) |
|
259 |
public async void SaveEventCallback(object sender, RoutedEventArgs e)
|
|
277 | 260 |
{ |
278 | 261 |
var mianMenu = this.ParentOfType<MainWindow>().dzMainMenu; |
279 | 262 |
|
280 |
if (mianMenu.busyIndicator.IsBusy == true)
|
|
263 |
if (mianMenu.busyIndicator.IsBusy) |
|
281 | 264 |
{ |
282 | 265 |
return; |
283 | 266 |
} |
... | ... | |
286 | 269 |
//{ |
287 | 270 |
this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = true; |
288 | 271 |
|
289 |
_SaveEvent(sender, e);
|
|
272 |
await SaveEventAsync(sender, e);
|
|
290 | 273 |
|
291 | 274 |
mianMenu.busyIndicator.IsBusy = false; |
292 | 275 |
|
... | ... | |
307 | 290 |
/// - unselect and update my markup list |
308 | 291 |
/// <param name="sender"></param> |
309 | 292 |
/// <param name="e"></param> |
310 |
public async Task<bool> _SaveEvent(object sender, RoutedEventArgs e)
|
|
293 |
public async Task<bool> SaveEventAsync(object sender, RoutedEventArgs e)
|
|
311 | 294 |
{ |
312 | 295 |
bool result = false; |
313 | 296 |
|
... | ... | |
372 | 355 |
return result; |
373 | 356 |
} |
374 | 357 |
|
375 |
public async Task<bool> SaveEventAsync() |
|
376 |
{ |
|
377 |
bool result = false; |
|
378 |
|
|
379 |
var mainMenu = this.ParentOfType<MainWindow>().dzMainMenu; |
|
380 |
try |
|
381 |
{ |
|
382 |
mainMenu.ConvertInkControlToPolygon(); |
|
383 |
|
|
384 |
// update mylist and gridview |
|
385 |
mainMenu.UpdateMyMarkupList(); |
|
386 |
|
|
387 |
if (mainMenu.gridViewMarkup.SelectedItems.Count == 0 && mainMenu.gridViewMarkup.Items.Count > 0) |
|
388 |
{ |
|
389 |
this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert"); |
|
390 |
} |
|
391 |
else |
|
392 |
{ |
|
393 |
foreach (var item in mainMenu.gridViewMarkup.SelectedItems) |
|
394 |
{ |
|
395 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
|
396 |
{ |
|
397 |
/// 저장 서비스 호출 |
|
398 |
result = await this.ExecuteSaveCommandAsync(mainMenu); |
|
399 |
ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now; |
|
400 |
} |
|
401 |
} |
|
402 |
} |
|
403 |
|
|
404 |
mainMenu.SetCommentPages(null); |
|
405 |
|
|
406 |
ViewerDataModel.Instance.UndoDataList.Clear(); |
|
407 |
result = true; |
|
408 |
} |
|
409 |
catch (Exception ex) |
|
410 |
{ |
|
411 |
System.Diagnostics.Debug.WriteLine("_SaveEvent Error : " + ex.ToString()); |
|
412 |
} |
|
413 |
finally |
|
414 |
{ |
|
415 |
/* |
|
416 |
/// delete markup information when 코멘트가 없을 경우 |
|
417 |
if (ViewerDataModel.Instance.MyMarkupList.Count == 0) |
|
418 |
{ |
|
419 |
foreach (var item in menu.gridViewMarkup.SelectedItems) |
|
420 |
{ |
|
421 |
if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID) |
|
422 |
{ |
|
423 |
//this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem)); |
|
424 |
} |
|
425 |
} |
|
426 |
} |
|
427 |
*/ |
|
428 |
} |
|
429 |
|
|
430 |
return result; |
|
431 |
} |
|
432 |
|
|
433 | 358 |
/// <summary> |
434 | 359 |
/// 마크업 데이터를 저장한다. |
435 | 360 |
/// </summary> |
... | ... | |
1597 | 1522 |
instanceMain.dzMainMenu.rotate.Angle -= 90; |
1598 | 1523 |
} |
1599 | 1524 |
} |
1600 |
//double angle = (double)rotateValue.GetValue(rotateOffSet); |
|
1601 | 1525 |
//instanceMain.dzMainMenu.rotate.Angle = angle; |
1602 | 1526 |
//var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90)); |
1603 | 1527 |
|
... | ... | |
2539 | 2463 |
public double height { get; set; } |
2540 | 2464 |
} |
2541 | 2465 |
*/ |
2542 |
private async void CollapsedButton_Click() |
|
2543 |
{ |
|
2544 |
this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); // 저장하지 못한 데이터가 있다면 저장 |
|
2545 |
|
|
2546 |
string[] data = new string[0]; |
|
2547 |
|
|
2548 |
int cnt = 0; |
|
2549 |
var menu = this.ParentOfType<MainWindow>().dzMainMenu; |
|
2550 |
|
|
2551 |
List<MarkupInfoItem> gridSelectionItem = menu.gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
|
2552 |
|
|
2553 |
foreach (var item in gridSelectionItem) |
|
2554 |
{ |
|
2555 |
if ((item.UserID == App.ViewInfo.UserID) && (ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage != null)) |
|
2556 |
{ |
|
2557 |
var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber && |
|
2558 |
d.MarkupInfoID == item.MarkupInfoID).ToList(); |
|
2559 |
data = new string[instance.Count]; |
|
2560 |
foreach (var markup in instance) |
|
2561 |
{ |
|
2562 |
data[cnt++] = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(markup.Data,ViewerDataModel.Instance.NewMarkupCancelToken()); |
|
2563 |
} |
|
2564 |
} |
|
2565 |
} |
|
2566 |
|
|
2567 |
if (data != null && KCOM.Properties.Settings.Default.cad == 1) |
|
2568 |
{ |
|
2569 |
string FilePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Cad"); |
|
2570 |
string FileName = FilePath + "\\commentstring.json"; // Default file name |
|
2571 |
if (!File.Exists(FilePath)) |
|
2572 |
{ |
|
2573 |
Directory.CreateDirectory(FilePath); |
|
2574 |
} |
|
2575 |
|
|
2576 |
if (!string.IsNullOrEmpty(FileName)) |
|
2577 |
{ |
|
2578 |
// File.WriteAllText(SaveDig.FileName, data); |
|
2579 |
File.WriteAllLines(FileName, data); |
|
2580 |
} |
|
2581 |
} |
|
2582 |
} |
|
2583 | 2466 |
|
2584 | 2467 |
private double minHeight; |
2585 | 2468 |
private double minWidth; |
내보내기 Unified diff