개정판 129ca191
issue #923: fixed save changed controls logic
Change-Id: I434adb979a8adcf0407d75504e0ecfc48085f988
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
297 | 297 |
return false; |
298 | 298 |
} |
299 | 299 |
|
300 |
|
|
301 | 300 |
public void DeleteItem(MarkupInfoItem item) |
302 | 301 |
{ |
303 | 302 |
if (PreviewUserMarkupInfoItem != null && item.Consolidate == 1 && item.AvoidConsolidate == 0) |
... | ... | |
319 | 318 |
|
320 | 319 |
ViewerDataModel.Instance.MyMarkupList.Where(data => data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(a => |
321 | 320 |
{ |
322 |
ComingNewBieEnd = false; |
|
323 | 321 |
ViewerDataModel.Instance.MyMarkupList.Remove(a); |
324 | 322 |
//임시파일에서도 삭제 |
325 | 323 |
TempFile.DelTemp(a.ID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber.ToString()); |
... | ... | |
435 | 433 |
public void UpdateMyMarkupList() |
436 | 434 |
{ |
437 | 435 |
Logger.sendCheckLog("pageNavigator_PageChanging_ChangeCommentReact", 1); |
438 |
bool isComingNewBie = false; |
|
439 | 436 |
|
440 | 437 |
/// add or update markup list |
441 | 438 |
foreach (var control in ViewerDataModel.Instance.MarkupControls_USER) |
... | ... | |
449 | 446 |
{ |
450 | 447 |
exist.Data = root.ConvertData; |
451 | 448 |
exist.IsUpdate = true; |
452 |
ComingNewBieEnd = false; |
|
453 | 449 |
} |
454 | 450 |
} |
455 | 451 |
else if (root.CommentID != null) |
456 | 452 |
{ |
457 |
isComingNewBie = true; |
|
458 | 453 |
ViewerDataModel.Instance.MyMarkupList.Add(new MarkupItemEx |
459 | 454 |
{ |
460 | 455 |
ID = control.CommentID, |
... | ... | |
465 | 460 |
Symbol_ID = control.SymbolID, |
466 | 461 |
//Group_ID = control.GroupID, |
467 | 462 |
}); |
468 |
ComingNewBieEnd = false; |
|
469 | 463 |
} |
470 | 464 |
} |
471 | 465 |
|
472 | 466 |
/// delete markup list |
473 |
int iPageNo = Convert.ToInt32(this.ParentOfType<MainWindow>().dzTopMenu.tlcurrentPage.Text);
|
|
467 |
int iPageNo = this.pageNavigator.CurrentPage.PageNumber;
|
|
474 | 468 |
var deleted = (from markup in ViewerDataModel.Instance.MyMarkupList |
475 | 469 |
where (markup.PageNumber == iPageNo) && (null == ViewerDataModel.Instance.MarkupControls_USER.Where(control => control.CommentID == markup.ID).FirstOrDefault()) |
476 | 470 |
select markup).ToList(); |
477 | 471 |
foreach(var markup in deleted) ViewerDataModel.Instance.MyMarkupList.Remove(markup); |
478 | 472 |
/// up to here |
479 | 473 |
|
480 |
if (isComingNewBie && !ComingNewBieEnd)
|
|
481 |
{ |
|
482 |
if (ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == PreviewUserMarkupInfoItem.UserID).FirstOrDefault() == null) |
|
483 |
{ |
|
484 |
ComingNewBieEnd = true; |
|
485 |
ViewerDataModel.Instance._markupInfoList.Insert(0, PreviewUserMarkupInfoItem); |
|
486 |
PreviewUserMarkupInfoItem.IsPreviewUser = false; |
|
487 |
gridViewMarkup.ItemsSource = null; |
|
488 |
gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList; |
|
489 |
gridViewMarkup.SelectedItem = PreviewUserMarkupInfoItem; |
|
490 |
|
|
491 |
GroupDescriptor descriptor = new GroupDescriptor(); |
|
492 |
descriptor.Member = "Depatment"; |
|
493 |
descriptor.DisplayContent = "DEPT"; |
|
494 |
descriptor.SortDirection = ListSortDirection.Ascending; |
|
495 |
gridViewMarkup.GroupDescriptors.Add(descriptor); |
|
496 |
} |
|
497 |
} |
|
474 |
//if (modified)
|
|
475 |
//{
|
|
476 |
// if (ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == PreviewUserMarkupInfoItem.UserID).FirstOrDefault() == null)
|
|
477 |
// {
|
|
478 |
// ComingNewBieEnd = true;
|
|
479 |
// ViewerDataModel.Instance._markupInfoList.Insert(0, PreviewUserMarkupInfoItem);
|
|
480 |
// PreviewUserMarkupInfoItem.IsPreviewUser = false;
|
|
481 |
// gridViewMarkup.ItemsSource = null;
|
|
482 |
// gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList;
|
|
483 |
// gridViewMarkup.SelectedItem = PreviewUserMarkupInfoItem;
|
|
484 |
|
|
485 |
// GroupDescriptor descriptor = new GroupDescriptor();
|
|
486 |
// descriptor.Member = "Depatment";
|
|
487 |
// descriptor.DisplayContent = "DEPT";
|
|
488 |
// descriptor.SortDirection = ListSortDirection.Ascending;
|
|
489 |
// gridViewMarkup.GroupDescriptors.Add(descriptor);
|
|
490 |
// }
|
|
491 |
//}
|
|
498 | 492 |
} |
499 | 493 |
|
500 |
bool ComingNewBieEnd = false; |
|
501 |
|
|
502 | 494 |
/// <summary> |
503 | 495 |
/// start page changing |
504 | 496 |
/// - save controls if page is modified |
... | ... | |
508 | 500 |
/// <param name="e"></param> |
509 | 501 |
private void pageNavigator_PageChanging(object sender, Controls.Sample.PageChangeEventArgs e) |
510 | 502 |
{ |
511 |
this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); |
|
512 |
|
|
513 | 503 |
CompareMode.IsChecked = false; |
514 | 504 |
var BalancePoint = ViewerDataModel.Instance.PageBalanceMode == true ? e.PageNumber + ViewerDataModel.Instance.PageBalanceNumber : e.PageNumber; |
515 | 505 |
|
내보내기 Unified diff