개정판 7fa95b67
Fix: 이미지 심볼 배치 오류 수정
Change-Id: Ice2ccb7ab56cedc7adc7c535d95c410d01001cd3
KCOM/Controls/Symbol.xaml.cs | ||
---|---|---|
420 | 420 |
}; |
421 | 421 |
|
422 | 422 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveSymbolCompleted += BaseClient_SaveSymbolCompleted; |
423 |
//Logger.sendReqLog("SaveSymbolAsync: ", symbol_private.ID + "," + symbol_private.MEMBER_USER_ID + "," + symbol_private.NAME + "," + symbol_private.IMAGE_URL + "," + symbol_private.DATA, 1); |
|
424 | 423 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveSymbolAsync(symbol_private); |
425 | 424 |
} |
426 | 425 |
catch (Exception) |
... | ... | |
453 | 452 |
|
454 | 453 |
private async void BaseClient_AddPublicSymbolCompleted(object sender, ServiceDeepView.AddPublicSymbolCompletedEventArgs e) |
455 | 454 |
{ |
456 |
//Logger.sendResLog("AddPublicSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
|
457 | 455 |
await DataBindAsync(); |
458 | 456 |
} |
459 | 457 |
|
460 | 458 |
private async void BaseClient_SaveSymbolCompleted(object sender, ServiceDeepView.SaveSymbolCompletedEventArgs e) |
461 | 459 |
{ |
462 |
//Logger.sendResLog("RenameSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
|
463 | 460 |
await DataBindAsync(); |
464 | 461 |
} |
465 | 462 |
|
... | ... | |
509 | 506 |
/// <param name="id"></param> |
510 | 507 |
private async Task PlaceSymbol(string id, Point CurrentMousePoint) |
511 | 508 |
{ |
512 |
string Data_ = ""; |
|
513 |
|
|
514 | 509 |
var systemMain = Common.ViewerDataModel.Instance.SystemMain; |
515 | 510 |
var mainMenu = systemMain.dzMainMenu; |
516 | 511 |
|
... | ... | |
518 | 513 |
|
519 | 514 |
try |
520 | 515 |
{ |
521 |
Data_ = mainMenu.BaseClient.GetSymbolData(id, RadTab.SelectedIndex); |
|
522 |
if (string.IsNullOrEmpty(Data_)) return; |
|
523 |
|
|
524 |
if (Data_.Contains("|DZ|")) |
|
516 |
string Data_ = mainMenu.BaseClient.GetSymbolData(id, RadTab.SelectedIndex); |
|
517 |
if (!string.IsNullOrEmpty(Data_) && Data_.Contains("|DZ|")) |
|
525 | 518 |
{ |
526 | 519 |
List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
527 | 520 |
|
528 | 521 |
string[] delimiterChars = { "|DZ|" }; |
529 | 522 |
string[] data = Data_.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries); |
530 | 523 |
|
531 |
UndoData multi_UndoData = new UndoData(); |
|
532 | 524 |
UndoDataGroup = new UndoDataGroup() |
533 | 525 |
{ |
534 | 526 |
IsUndo = false, |
... | ... | |
552 | 544 |
|
553 | 545 |
adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo); |
554 | 546 |
|
555 |
multi_UndoData = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo); |
|
556 |
|
|
547 |
var multi_UndoData = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo); |
|
557 | 548 |
UndoDataGroup.MarkupDataColl.Add(multi_UndoData); |
558 | 549 |
ViewerDataModel.Instance.UndoDataList.Add(UndoDataGroup); |
559 | 550 |
} |
... | ... | |
576 | 567 |
|
577 | 568 |
mainMenu.SelectLayer.Children.Add(final); |
578 | 569 |
|
579 |
|
|
580 | 570 |
//var finalPosition = new Point(Canvas.GetLeft(final), Canvas.GetTop(final)); |
581 | 571 |
//Rect rect = new Rect(finalPosition, Point.Add(finalPosition,new Vector(final.Width,final.Height))); |
582 | 572 |
|
... | ... | |
585 | 575 |
} |
586 | 576 |
else |
587 | 577 |
{ |
588 |
PlaceImageSymbol(id, 0); |
|
578 |
await PlaceImageSymbol(id, 0);
|
|
589 | 579 |
} |
590 | 580 |
} |
591 | 581 |
catch (Exception ex) |
... | ... | |
608 | 598 |
return targetPoint; |
609 | 599 |
} |
610 | 600 |
|
611 |
|
|
612 |
|
|
613 |
private void PlaceImageSymbol(string id, long group_id) |
|
601 |
/// <summary> |
|
602 |
/// 이미지 심볼을 배치한다. |
|
603 |
/// </summary> |
|
604 |
/// <param name="id"></param> |
|
605 |
/// <param name="group_id"></param> |
|
606 |
private async Task PlaceImageSymbol(string id, long group_id) |
|
614 | 607 |
{ |
615 |
|
|
616 |
//canvasZoommovingMouseDownPoint |
|
617 |
string Data_ = ""; |
|
618 |
|
|
619 | 608 |
try |
620 | 609 |
{ |
621 |
//Logger.sendReqLog("GetSymbolImageURL: ", id + "," + RadTab.SelectedIndex, 1); |
|
622 |
Data_ = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetSymbolImageURL(id, RadTab.SelectedIndex); |
|
623 |
if (Data_ != null || Data_ != "") |
|
610 |
string FilePath = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetSymbolImageURL(id, RadTab.SelectedIndex); |
|
611 |
if (!string.IsNullOrEmpty(FilePath)) |
|
624 | 612 |
{ |
625 |
//Logger.sendResLog("GetSymbolImageURL", "TRUE", 1); |
|
626 |
} |
|
627 |
else |
|
628 |
{ |
|
629 |
//Logger.sendResLog("GetSymbolImageURL", "FALSE", 1); |
|
630 |
} |
|
631 |
|
|
632 |
//MARKUP_DATA_GROUP INSERT |
|
633 |
//MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP |
|
634 |
//{ |
|
635 |
// SYMBOL_ID = id,//InnerItem.Symbol_ID |
|
636 |
// STATE = 0, |
|
637 |
//}; |
|
638 |
//long group_id = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMarkupDataGroup(mARKUP_DATA_GROUP, App.ViewInfo.ProjectNO); |
|
639 |
////Logger.sendReqLog("AddMarkupDataGroup: ", "", 1); |
|
613 |
bool exists = await Commons.DoesFileExist(FilePath); |
|
614 |
if (!exists) |
|
615 |
{ |
|
616 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert($"{FilePath} doesn't exist", "Warning"); |
|
617 |
return; |
|
618 |
} |
|
640 | 619 |
|
641 |
if (Data_ != null) |
|
642 |
{ |
|
643 | 620 |
Image img = new Image(); |
644 |
//img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(Data_)); |
|
645 |
if (Data_.Contains(".svg")) |
|
621 |
if (FilePath.Contains(".svg")) |
|
646 | 622 |
{ |
647 |
SharpVectors.Converters.SvgImageExtension svgImage = new SharpVectors.Converters.SvgImageExtension(Data_);
|
|
623 |
SharpVectors.Converters.SvgImageExtension svgImage = new SharpVectors.Converters.SvgImageExtension(FilePath);
|
|
648 | 624 |
img.Source = (DrawingImage)svgImage.ProvideValue(null); |
649 | 625 |
} |
650 | 626 |
else |
651 | 627 |
{ |
652 |
img.Source = new BitmapImage(new Uri(Data_));
|
|
628 |
img.Source = new BitmapImage(new Uri(FilePath));
|
|
653 | 629 |
} |
654 | 630 |
|
655 | 631 |
var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
656 | 632 |
{ |
657 | 633 |
PointSet = new List<Point>(), |
658 |
FilePath = Data_,
|
|
634 |
FilePath = FilePath,
|
|
659 | 635 |
ImageData = img.Source, |
660 | 636 |
StartPoint = new Point(0, 0), |
661 | 637 |
EndPoint = new Point(img.Source.Width, img.Source.Height), |
... | ... | |
670 | 646 |
currentControl.EndPoint, |
671 | 647 |
currentControl.TopRightPoint, |
672 | 648 |
}; |
673 |
UndoData multi_UndoData = new UndoData(); |
|
674 | 649 |
UndoDataGroup = new UndoDataGroup() |
675 | 650 |
{ |
676 | 651 |
IsUndo = false, |
... | ... | |
678 | 653 |
EventTime = DateTime.Now, |
679 | 654 |
MarkupDataColl = new List<UndoData>() |
680 | 655 |
}; |
681 |
ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i =>
|
|
656 |
ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo).ToList().ForEach(i => |
|
682 | 657 |
{ |
683 | 658 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
684 | 659 |
}); |
685 | 660 |
|
686 |
//multi_UndoData = dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
687 |
multi_UndoData = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
661 |
var multi_UndoData = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
688 | 662 |
UndoDataGroup.MarkupDataColl.Add(multi_UndoData); |
689 | 663 |
ViewerDataModel.Instance.UndoDataList.Add(UndoDataGroup); |
690 | 664 |
|
... | ... | |
695 | 669 |
currentControl.ApplyTemplate(); |
696 | 670 |
currentControl.SetImage(); |
697 | 671 |
|
698 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
672 |
///ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo);
|
|
699 | 673 |
Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
700 | 674 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final); |
701 | 675 |
|
676 |
#region 마우스 위치에 배치 |
|
702 | 677 |
/* |
703 | 678 |
// this.ParentOfType<MainWindow>().dzMainMenu.isLeftMouseButtonDownOnWindow = true; |
704 | 679 |
// final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY)); |
... | ... | |
710 | 685 |
//this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = MouseHandlingMode.DragSymbol; |
711 | 686 |
///this.ParentOfType<MainWindow>().dzMainMenu.mouseButtonDown = MouseButton.Left; |
712 | 687 |
//this.ParentOfType<MainWindow>().dzMainMenu.symboldata(id, group_id, RadTab.SelectedIndex, Data_, img.Source);*/ |
713 |
|
|
688 |
#endregion |
|
714 | 689 |
} |
715 | 690 |
} |
716 | 691 |
catch(Exception ex) |
... | ... | |
719 | 694 |
} |
720 | 695 |
} |
721 | 696 |
|
722 |
public UndoData multi_UndoData; |
|
697 |
/// <summary> |
|
698 |
/// |
|
699 |
/// </summary> |
|
723 | 700 |
private void ApplyDragSelectionRect() |
724 | 701 |
{ |
725 |
multi_UndoData = new UndoData(); |
|
702 |
var multi_UndoData = new UndoData();
|
|
726 | 703 |
|
727 | 704 |
UndoDataGroup = new UndoDataGroup() |
728 | 705 |
{ |
내보내기 Unified diff