개정판 19d602e0
Fix: Undo/Redo 기능 개선
Change-Id: I788a6fe870ed5ee7096f3ee461227588cf758388
KCOM/Events/Implementation/TopMenuEvent.cs | ||
---|---|---|
71 | 71 |
Error, |
72 | 72 |
} |
73 | 73 | |
74 |
private void CheckShapeState() |
|
75 |
{ |
|
76 | ||
77 | ||
78 |
if (cbHatchShape.IsChecked == true) |
|
79 |
{ |
|
80 |
cbFillShape.IsChecked = false; |
|
81 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Hatch; |
|
82 |
} |
|
83 |
else if(cbFillShape.IsChecked == true) |
|
84 |
{ |
|
85 |
cbHatchShape.IsChecked = false; |
|
86 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.Fill; |
|
87 |
} |
|
88 |
else |
|
89 |
{ |
|
90 |
ViewerDataModel.Instance.paintSet = MarkupToPDF.Controls.Common.PaintSet.None; |
|
91 |
} |
|
92 |
} |
|
93 | ||
94 | 74 |
/// <summary> |
95 | 75 |
/// comment의 속성 변경시 저장여부 확인 하도록 undocommand에 추가 |
96 | 76 |
/// </summary> |
... | ... | |
109 | 89 |
//강인구 추가(Undo End) |
110 | 90 |
private void SetPaintEvent() |
111 | 91 |
{ |
112 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
|
92 |
List<AdornerMember> AdonerList = GetAdornerItems();
|
|
113 | 93 | |
114 | 94 |
if (AdonerList.Count > 0) |
115 | 95 |
{ |
116 |
UndoDataGroup UndoDataGrp = new UndoDataGroup() |
|
117 |
{ |
|
118 |
IsUndo = false, |
|
119 |
Event = EventType.Operation, |
|
120 |
paint = ViewerDataModel.Instance.paintSet |
|
121 |
}; |
|
122 |
UndoData multi_UndoData = new UndoData(); |
|
96 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
123 | 97 | |
98 |
#region 속성 변경 |
|
124 | 99 |
foreach (AdornerMember InnerItem in AdonerList) |
125 | 100 |
{ |
126 |
multi_UndoData.PointSet = new List<Point>(); |
|
127 | ||
128 | 101 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl) != null) |
129 | 102 |
{ |
130 | 103 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Common.IShapeControl).Paint = ViewerDataModel.Instance.paintSet; |
131 | 104 |
} |
132 | ||
133 |
multi_UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
|
134 |
UndoDataGrp.MarkupDataColl.Add(multi_UndoData); |
|
135 |
multi_UndoData = new UndoData(); |
|
136 | 105 |
} |
137 | ||
138 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
139 |
{ |
|
140 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
141 |
}); |
|
142 |
ViewerDataModel.Instance.UndoDataList.Add(UndoDataGrp); |
|
106 |
#endregion |
|
143 | 107 |
} |
144 | 108 |
} |
145 | 109 | |
146 | 110 |
private void SetHighlightEvent() |
147 | 111 |
{ |
148 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
|
112 |
List<AdornerMember> AdonerList = GetAdornerItems();
|
|
149 | 113 | |
150 | 114 |
if (AdonerList.Count > 0) |
151 | 115 |
{ |
... | ... | |
614 | 578 |
Print_Start(button.Content.ToString()); |
615 | 579 |
} |
616 | 580 | |
617 |
private List<AdornerMember> GetAdornerItem() |
|
581 |
/// <summary> |
|
582 |
/// 선택된 AdornerMember들을 리턴한다. |
|
583 |
/// </summary> |
|
584 |
/// <returns></returns> |
|
585 |
private List<AdornerMember> GetAdornerItems() |
|
618 | 586 |
{ |
619 | 587 |
List<AdornerMember> AdonerList = new List<AdornerMember>(); |
620 | 588 | |
621 |
if (this.ParentOfType<MainWindow>() != null) |
|
589 |
if (this.ParentOfType<MainWindow>() != null && this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
|
|
622 | 590 |
{ |
623 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
|
|
591 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
|
|
624 | 592 |
{ |
625 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
|
|
593 |
if (item.GetType().Name == "AdornerFinal")
|
|
626 | 594 |
{ |
627 |
if (item.GetType().Name == "AdornerFinal")
|
|
595 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members)
|
|
628 | 596 |
{ |
629 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
|
630 |
{ |
|
631 |
AdonerList.Add(InnerItem); |
|
632 |
} |
|
597 |
AdonerList.Add(InnerItem); |
|
633 | 598 |
} |
634 | 599 |
} |
635 | 600 |
} |
... | ... | |
637 | 602 | |
638 | 603 |
return AdonerList; |
639 | 604 |
} |
605 | ||
640 | 606 |
/// <summary> |
641 |
/// 투명도 |
|
607 |
/// 투명도 변경
|
|
642 | 608 |
/// </summary> |
643 | 609 |
/// <param name="sender"></param> |
644 | 610 |
/// <param name="e"></param> |
645 | 611 |
//강인구 추가(Undo End) |
646 | 612 |
private void sdOpacity_ValueChanged(object sender, RoutedEventArgs e) |
647 | 613 |
{ |
648 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
|
649 |
if(AdonerList.Count > 0) |
|
650 |
{ |
|
651 |
UndoDataGroup UndoDataGrp = new UndoDataGroup() |
|
652 |
{ |
|
653 |
IsUndo = false, |
|
654 |
Event = EventType.Operation, |
|
655 |
Opacity = ViewerDataModel.Instance.ControlOpacity |
|
656 |
}; |
|
614 |
List<AdornerMember> AdonerList = GetAdornerItems(); |
|
615 |
if (!AdonerList.Any()) return; |
|
657 | 616 | |
658 |
foreach (AdornerMember InnerItem in AdonerList) |
|
659 |
{ |
|
660 |
InnerItem.DrawingData.Opacity = ViewerDataModel.Instance.ControlOpacity; |
|
617 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
661 | 618 | |
662 |
UndoData UndoData = new UndoData(); |
|
663 |
UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
|
664 |
UndoDataGrp.MarkupDataColl.Add(UndoData); |
|
665 |
} |
|
666 | ||
667 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
668 |
{ |
|
669 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
670 |
}); |
|
671 |
ViewerDataModel.Instance.UndoDataList.Add(UndoDataGrp); |
|
619 |
#region 속성 변경 |
|
620 |
foreach (AdornerMember InnerItem in AdonerList) |
|
621 |
{ |
|
622 |
InnerItem.DrawingData.Opacity = ViewerDataModel.Instance.ControlOpacity; |
|
672 | 623 |
} |
624 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
625 |
#endregion |
|
673 | 626 |
} |
674 | 627 | |
675 |
//강인구 추가(Undo End) |
|
628 |
/// <summary> |
|
629 |
/// LineSize 변경 |
|
630 |
/// </summary> |
|
631 |
/// <param name="sender"></param> |
|
632 |
/// <param name="e"></param> |
|
676 | 633 |
private void cbLineSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
677 | 634 |
{ |
678 | 635 |
if (string.IsNullOrEmpty(cbLineSize.Value.ToString())) |
679 | 636 |
{ |
680 | 637 |
cbLineSize.Value = cbLineSize.Minimum; |
681 | 638 |
} |
682 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
|
683 |
if (AdonerList.Count > 0) |
|
684 |
{ |
|
685 |
UndoDataGroup UndoDataGrp = new UndoDataGroup() |
|
686 |
{ |
|
687 |
IsUndo = false, |
|
688 |
Event = EventType.Operation, |
|
689 |
LineSize = ViewerDataModel.Instance.LineSize |
|
690 |
}; |
|
691 |
UndoData multi_UndoData = new UndoData(); |
|
639 |
List<AdornerMember> AdonerList = GetAdornerItems(); |
|
640 |
if (!AdonerList.Any()) return; |
|
641 |
|
|
642 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
692 | 643 | |
693 |
foreach (AdornerMember InnerItem in AdonerList) |
|
644 |
#region 속성 변경 |
|
645 |
foreach (AdornerMember InnerItem in AdonerList) |
|
646 |
{ |
|
647 |
switch (InnerItem.DrawingData.GetType().Name) |
|
694 | 648 |
{ |
695 |
switch (InnerItem.DrawingData.GetType().Name) |
|
696 |
{ |
|
697 |
case ("LineControl"): |
|
698 |
{ |
|
699 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
700 |
} |
|
701 |
break; |
|
702 |
case ("ArcControl"): |
|
703 |
{ |
|
704 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
705 |
} |
|
706 |
break; |
|
707 |
case ("ArrowArcControl"): |
|
708 |
{ |
|
709 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
710 |
} |
|
711 |
break; |
|
712 |
case ("ArrowControl_Multi"): |
|
713 |
{ |
|
714 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize; |
|
715 |
} |
|
716 |
break; |
|
717 |
case ("CloudControl"): |
|
718 |
{ |
|
719 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
720 |
} |
|
721 |
break; |
|
722 |
case ("PolygonControl"): |
|
723 |
{ |
|
724 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
725 |
} |
|
726 |
break; |
|
727 |
case ("RectangleControl"): |
|
728 |
{ |
|
729 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
730 |
} |
|
731 |
break; |
|
732 |
case ("RectCloudControl"): |
|
733 |
{ |
|
734 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
735 |
} |
|
736 |
break; |
|
737 |
case ("TriControl"): |
|
738 |
{ |
|
739 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
740 |
} |
|
741 |
break; |
|
742 |
case ("CircleControl"): |
|
743 |
{ |
|
744 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
745 |
} |
|
746 |
break; |
|
747 |
case ("ArrowTextControl"): |
|
748 |
{ |
|
749 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
750 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).BorderSize = new Thickness(ViewerDataModel.Instance.LineSize); |
|
751 |
} |
|
752 |
break; |
|
753 |
case ("TextControl"): |
|
754 |
{ |
|
755 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).LineSize = new Thickness(ViewerDataModel.Instance.LineSize); |
|
756 |
} |
|
757 |
break; |
|
758 |
case ("InsideWhiteControl"): |
|
759 |
{ |
|
760 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
761 |
} |
|
762 |
break; |
|
763 |
case ("OverlapWhiteControl"): |
|
764 |
{ |
|
765 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
766 |
} |
|
767 |
break; |
|
768 |
case ("ClipWhiteControl"): |
|
769 |
{ |
|
770 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
771 |
} |
|
772 |
break; |
|
773 |
case ("CoordinateControl"): |
|
774 |
{ |
|
775 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).LineSize = 10; //ViewerDataModel.Instance.LineSize |
|
776 |
} |
|
777 |
break; |
|
778 |
} |
|
779 | ||
780 |
multi_UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
|
781 |
UndoDataGrp.MarkupDataColl.Add(multi_UndoData); |
|
782 |
multi_UndoData = new UndoData(); |
|
649 |
case ("LineControl"): |
|
650 |
{ |
|
651 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
652 |
} |
|
653 |
break; |
|
654 |
case ("ArcControl"): |
|
655 |
{ |
|
656 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
657 |
} |
|
658 |
break; |
|
659 |
case ("ArrowArcControl"): |
|
660 |
{ |
|
661 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
662 |
} |
|
663 |
break; |
|
664 |
case ("ArrowControl_Multi"): |
|
665 |
{ |
|
666 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).LineSize = ViewerDataModel.Instance.LineSize; |
|
667 |
} |
|
668 |
break; |
|
669 |
case ("CloudControl"): |
|
670 |
{ |
|
671 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
672 |
} |
|
673 |
break; |
|
674 |
case ("PolygonControl"): |
|
675 |
{ |
|
676 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
677 |
} |
|
678 |
break; |
|
679 |
case ("RectangleControl"): |
|
680 |
{ |
|
681 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
682 |
} |
|
683 |
break; |
|
684 |
case ("RectCloudControl"): |
|
685 |
{ |
|
686 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
687 |
} |
|
688 |
break; |
|
689 |
case ("TriControl"): |
|
690 |
{ |
|
691 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
692 |
} |
|
693 |
break; |
|
694 |
case ("CircleControl"): |
|
695 |
{ |
|
696 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
697 |
} |
|
698 |
break; |
|
699 |
case ("ArrowTextControl"): |
|
700 |
{ |
|
701 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
702 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).BorderSize = new Thickness(ViewerDataModel.Instance.LineSize); |
|
703 |
} |
|
704 |
break; |
|
705 |
case ("TextControl"): |
|
706 |
{ |
|
707 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).LineSize = new Thickness(ViewerDataModel.Instance.LineSize); |
|
708 |
} |
|
709 |
break; |
|
710 |
case ("InsideWhiteControl"): |
|
711 |
{ |
|
712 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
713 |
} |
|
714 |
break; |
|
715 |
case ("OverlapWhiteControl"): |
|
716 |
{ |
|
717 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
718 |
} |
|
719 |
break; |
|
720 |
case ("ClipWhiteControl"): |
|
721 |
{ |
|
722 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).LineSize = ViewerDataModel.Instance.LineSize; |
|
723 |
} |
|
724 |
break; |
|
725 |
case ("CoordinateControl"): |
|
726 |
{ |
|
727 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).LineSize = 10; //ViewerDataModel.Instance.LineSize |
|
728 |
} |
|
729 |
break; |
|
783 | 730 |
} |
784 | ||
785 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
786 |
{ |
|
787 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
788 |
}); |
|
789 |
ViewerDataModel.Instance.UndoDataList.Add(UndoDataGrp); |
|
790 | 731 |
} |
732 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
733 |
#endregion |
|
734 | ||
791 | 735 |
KCOM.Properties.Settings.Default.LineSize = (double)cbLineSize.Value; |
792 | 736 |
Properties.Settings.Default.Save(); |
793 | 737 |
} |
794 | 738 | |
795 | 739 | |
740 |
/// <summary> |
|
741 |
/// Interval Size 변경 |
|
742 |
/// </summary> |
|
743 |
/// <param name="sender"></param> |
|
744 |
/// <param name="e"></param> |
|
796 | 745 |
private void cbIntervalSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
797 | 746 |
{ |
798 | 747 |
if (string.IsNullOrEmpty(cbIntervalSize.Value.ToString())) |
799 | 748 |
{ |
800 | 749 |
cbIntervalSize.Value = cbIntervalSize.Minimum; |
801 | 750 |
} |
802 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
|
803 |
if (AdonerList.Count > 0) |
|
804 |
{ |
|
751 |
List<AdornerMember> AdonerList = GetAdornerItems(); |
|
752 |
if (!AdonerList.Any()) return; |
|
805 | 753 | |
806 |
UndoDataGroup UndoDataGrp = new UndoDataGroup() |
|
807 |
{ |
|
808 |
IsUndo = false, |
|
809 |
Event = EventType.Operation, |
|
810 |
Interval = ViewerDataModel.Instance.Interval |
|
811 |
}; |
|
812 |
UndoData multi_UndoData = new UndoData(); |
|
754 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
813 | 755 | |
814 |
foreach (AdornerMember InnerItem in AdonerList) |
|
756 |
#region 속성 변경 |
|
757 |
foreach (AdornerMember InnerItem in AdonerList) |
|
758 |
{ |
|
759 |
switch (InnerItem.DrawingData.GetType().Name) |
|
815 | 760 |
{ |
816 |
switch (InnerItem.DrawingData.GetType().Name) |
|
817 |
{ |
|
818 |
case ("LineControl"): |
|
819 |
{ |
|
820 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).Interval = ViewerDataModel.Instance.Interval; |
|
821 | ||
822 |
multi_UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
|
823 |
UndoDataGrp.MarkupDataColl.Add(multi_UndoData); |
|
824 |
multi_UndoData = new UndoData(); |
|
825 |
} |
|
826 |
break; |
|
827 |
} |
|
761 |
case ("LineControl"): |
|
762 |
{ |
|
763 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).Interval = ViewerDataModel.Instance.Interval; |
|
764 |
} |
|
765 |
break; |
|
828 | 766 |
} |
829 | ||
830 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
831 |
{ |
|
832 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
833 |
}); |
|
834 |
ViewerDataModel.Instance.UndoDataList.Add(UndoDataGrp); |
|
835 | 767 |
} |
768 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
769 |
#endregion |
|
770 | ||
836 | 771 |
KCOM.Properties.Settings.Default.Interval = (double)cbIntervalSize.Value; |
837 | 772 |
Properties.Settings.Default.Save(); |
838 | 773 |
} |
... | ... | |
849 | 784 |
cbArcLength.Value = cbArcLength.Minimum; |
850 | 785 |
} |
851 | 786 | |
852 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
|
853 |
if (AdonerList.Count > 0) |
|
854 |
{ |
|
855 |
var comments = (from drawing in AdonerList |
|
856 |
select drawing.DrawingData as CommentUserInfo) |
|
857 |
.Where(x => x is RectCloudControl || x is CloudControl || |
|
858 |
x is MarkupToPDF.Controls.Text.TextControl || x is MarkupToPDF.Controls.Text.ArrowTextControl) |
|
859 |
.ToList(); |
|
860 |
UndoCommand.Instance.Push(EventType.Operation, comments); |
|
787 |
List<AdornerMember> AdonerList = GetAdornerItems(); |
|
788 |
if (!AdonerList.Any()) return; |
|
861 | 789 | |
862 |
foreach (AdornerMember InnerItem in AdonerList) |
|
790 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
791 | ||
792 |
#region 속성 변경 |
|
793 |
foreach (AdornerMember InnerItem in AdonerList) |
|
794 |
{ |
|
795 |
switch (InnerItem.DrawingData.GetType().Name) |
|
863 | 796 |
{ |
864 |
switch (InnerItem.DrawingData.GetType().Name) |
|
865 |
{ |
|
866 |
case ("RectCloudControl"): |
|
867 |
{ |
|
868 |
var item = InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl; |
|
869 |
item.ArcLength = ViewerDataModel.Instance.ArcLength; |
|
870 |
} |
|
871 |
break; |
|
872 |
case ("CloudControl"): |
|
797 |
case ("RectCloudControl"): |
|
873 | 798 |
{ |
874 |
var item = InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl;
|
|
875 |
item.ArcLength = ViewerDataModel.Instance.ArcLength;
|
|
799 |
var item = InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl;
|
|
800 |
item.ArcLength = ViewerDataModel.Instance.ArcLength; |
|
876 | 801 |
} |
877 |
break; |
|
878 |
case ("TextControl"): |
|
879 |
{ |
|
880 |
var item = InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl; |
|
881 |
item.ArcLength = ViewerDataModel.Instance.ArcLength; |
|
882 |
} |
|
883 |
break; |
|
884 |
case ("ArrowTextControl"): |
|
885 |
{ |
|
886 |
var item = InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl; |
|
887 |
item.ArcLength = ViewerDataModel.Instance.ArcLength; |
|
888 |
} |
|
889 |
break; |
|
802 |
break; |
|
803 |
case ("CloudControl"): |
|
804 |
{ |
|
805 |
var item = InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl; |
|
806 |
item.ArcLength = ViewerDataModel.Instance.ArcLength; |
|
890 | 807 |
} |
808 |
break; |
|
809 |
case ("TextControl"): |
|
810 |
{ |
|
811 |
var item = InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl; |
|
812 |
item.ArcLength = ViewerDataModel.Instance.ArcLength; |
|
813 |
} |
|
814 |
break; |
|
815 |
case ("ArrowTextControl"): |
|
816 |
{ |
|
817 |
var item = InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl; |
|
818 |
item.ArcLength = ViewerDataModel.Instance.ArcLength; |
|
819 |
} |
|
820 |
break; |
|
891 | 821 |
} |
892 | 822 |
} |
823 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
824 |
#endregion |
|
893 | 825 | |
894 | 826 |
KCOM.Properties.Settings.Default.ArcLength = (double)cbArcLength.Value; |
895 | 827 |
Properties.Settings.Default.Save(); |
896 | 828 |
} |
897 | 829 | |
898 |
//강인구 추가(Undo End) |
|
830 |
/// <summary> |
|
831 |
/// Dash 스타일 변경 |
|
832 |
/// </summary> |
|
833 |
/// <param name="sender"></param> |
|
834 |
/// <param name="e"></param> |
|
899 | 835 |
private void cbDashStyle_SelectionChanged(object sender, SelectionChangedEventArgs e) |
900 | 836 |
{ |
901 |
//강인구 추가 |
|
902 |
if (this.ParentOfType<MainWindow>() != null) |
|
903 |
{ |
|
904 |
ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
905 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
|
906 |
{ |
|
907 |
//UndoDataGroup UndoData = new UndoDataGroup() |
|
908 |
//{ |
|
909 |
// IsUndo = false, |
|
910 |
// Event = EventType.Operation, |
|
911 |
// EventTime = DateTime.Now, |
|
912 |
// DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData, |
|
913 |
// MarkupDataColl = new List<UndoData>() |
|
914 |
//}; |
|
915 |
//UndoData multi_UndoData = new UndoData(); |
|
916 | ||
917 |
if (ViewerDataModel.Instance.UndoDataList == null) |
|
918 |
{ |
|
919 |
return; |
|
920 |
} |
|
921 | ||
922 |
List<AdornerMember> AdonerList = GetAdornerItem(); |
|
923 | ||
924 |
var comments = (from drawing in AdonerList |
|
925 |
select drawing.DrawingData as CommentUserInfo) |
|
926 |
.Where(x => x is LineControl || x is ArcControl || x is ArrowArcControl || x is ArrowControl_Multi |
|
927 |
|| x is CloudControl || x is PolygonControl || x is PolygonControl || x is RectangleControl || |
|
928 |
x is RectCloudControl || x is TriControl || x is CircleControl || x is InsideWhiteControl || |
|
929 |
x is OverlapWhiteControl || x is ClipWhiteControl || x is CoordinateControl || |
|
930 |
x is MarkupToPDF.Controls.Text.TextControl || x is MarkupToPDF.Controls.Text.ArrowTextControl) |
|
931 |
.ToList(); |
|
932 | ||
933 |
UndoCommand.Instance.Push(EventType.Operation, comments); |
|
837 |
ViewerDataModel.Instance.DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
838 |
List<AdornerMember> AdonerList = GetAdornerItems(); |
|
839 |
if (!AdonerList.Any()) return; |
|
934 | 840 | |
841 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
935 | 842 | |
936 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
|
937 |
{ |
|
938 |
if (item.GetType().Name == "AdornerFinal") |
|
843 |
#region 속성 변경 |
|
844 |
foreach (AdornerMember InnerItem in AdonerList) |
|
845 |
{ |
|
846 |
switch (InnerItem.DrawingData.GetType().Name) |
|
847 |
{ |
|
848 |
case ("LineControl"): |
|
939 | 849 |
{ |
940 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
|
941 |
{ |
|
942 |
switch (InnerItem.DrawingData.GetType().Name) |
|
943 |
{ |
|
944 |
case ("LineControl"): |
|
945 |
{ |
|
946 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
947 |
} |
|
948 |
break; |
|
949 |
case ("ArcControl"): |
|
950 |
{ |
|
951 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
952 |
} |
|
953 |
break; |
|
954 |
case ("ArrowArcControl"): |
|
955 |
{ |
|
956 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
957 |
} |
|
958 |
break; |
|
959 |
case ("ArrowControl_Multi"): |
|
960 |
{ |
|
961 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
962 |
} |
|
963 |
break; |
|
964 |
case ("CloudControl"): |
|
965 |
{ |
|
966 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
967 |
} |
|
968 |
break; |
|
969 |
case ("PolygonControl"): |
|
970 |
{ |
|
971 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
972 |
} |
|
973 |
break; |
|
974 |
case ("RectangleControl"): |
|
975 |
{ |
|
976 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
977 |
} |
|
978 |
break; |
|
979 |
case ("RectCloudControl"): |
|
980 |
{ |
|
981 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
982 |
} |
|
983 |
break; |
|
984 |
case ("TriControl"): |
|
985 |
{ |
|
986 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
987 |
} |
|
988 |
break; |
|
989 |
case ("CircleControl"): |
|
990 |
{ |
|
991 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
992 |
} |
|
993 |
break; |
|
994 |
case ("InsideWhiteControl"): |
|
995 |
{ |
|
996 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
997 |
} |
|
998 |
break; |
|
999 |
case ("OverlapWhiteControl"): |
|
1000 |
{ |
|
1001 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
1002 |
} |
|
1003 |
break; |
|
1004 |
case ("ClipWhiteControl"): |
|
1005 |
{ |
|
1006 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
1007 |
} |
|
1008 |
break; |
|
1009 |
case ("CoordinateControl"): |
|
1010 |
{ |
|
1011 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
1012 |
} |
|
1013 |
break; |
|
1014 |
} |
|
1015 | ||
1016 |
//multi_UndoData.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
|
1017 |
//UndoData.MarkupDataColl.Add(multi_UndoData); |
|
1018 |
//multi_UndoData = new UndoData(); |
|
1019 |
} |
|
1020 | ||
1021 |
//ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
1022 |
//{ |
|
1023 |
// ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
1024 |
//}); |
|
1025 |
//ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
|
1026 | ||
850 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.LineControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
1027 | 851 |
} |
1028 |
} |
|
852 |
break; |
|
853 |
case ("ArcControl"): |
|
854 |
{ |
|
855 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
856 |
} |
|
857 |
break; |
|
858 |
case ("ArrowArcControl"): |
|
859 |
{ |
|
860 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowArcControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
861 |
} |
|
862 |
break; |
|
863 |
case ("ArrowControl_Multi"): |
|
864 |
{ |
|
865 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Line.ArrowControl_Multi).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
866 |
} |
|
867 |
break; |
|
868 |
case ("CloudControl"): |
|
869 |
{ |
|
870 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.CloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
871 |
} |
|
872 |
break; |
|
873 |
case ("PolygonControl"): |
|
874 |
{ |
|
875 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Polygon.PolygonControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
876 |
} |
|
877 |
break; |
|
878 |
case ("RectangleControl"): |
|
879 |
{ |
|
880 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectangleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
881 |
} |
|
882 |
break; |
|
883 |
case ("RectCloudControl"): |
|
884 |
{ |
|
885 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.RectCloudControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
886 |
} |
|
887 |
break; |
|
888 |
case ("TriControl"): |
|
889 |
{ |
|
890 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.TriControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
891 |
} |
|
892 |
break; |
|
893 |
case ("CircleControl"): |
|
894 |
{ |
|
895 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Shape.CircleControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
896 |
} |
|
897 |
break; |
|
898 |
case ("InsideWhiteControl"): |
|
899 |
{ |
|
900 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.InsideWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
901 |
} |
|
902 |
break; |
|
903 |
case ("OverlapWhiteControl"): |
|
904 |
{ |
|
905 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.OverlapWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
906 |
} |
|
907 |
break; |
|
908 |
case ("ClipWhiteControl"): |
|
909 |
{ |
|
910 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.ClipWhiteControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
911 |
} |
|
912 |
break; |
|
913 |
case ("CoordinateControl"): |
|
914 |
{ |
|
915 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Cad.CoordinateControl).DashSize = (cbDashStyle.SelectedValue as DashStyle).dashData; |
|
916 |
} |
|
917 |
break; |
|
1029 | 918 |
} |
1030 | 919 |
} |
920 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
921 |
#endregion |
|
1031 | 922 |
} |
1032 | 923 | |
1033 |
//강인구 추가 |
|
1034 |
private void comboFontSize_SelectionChanged(object sender, SelectionChangedEventArgs e) |
|
1035 |
{ |
|
1036 |
//if (this.ParentOfType<MainWindow>() != null) |
|
1037 |
//{ |
|
1038 |
// if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
|
1039 |
// { |
|
1040 |
// foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
|
1041 |
// { |
|
1042 |
// if (item.GetType().Name == "AdornerFinal") |
|
1043 |
// { |
|
1044 |
// foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
|
1045 |
// { |
|
1046 |
// switch (InnerItem.DrawingData.GetType().Name) |
|
1047 |
// { |
|
1048 |
// case ("TextControl"): |
|
1049 |
// { |
|
1050 |
// (InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Text); |
|
1051 |
// } |
|
1052 |
// break; |
|
1053 |
// case ("ArrowTextControl"): |
|
1054 |
// { |
|
1055 |
// (InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Text); |
|
1056 |
// } |
|
1057 |
// break; |
|
1058 |
// } |
|
1059 |
// } |
|
1060 |
// } |
|
1061 |
// } |
|
1062 |
// } |
|
1063 |
//} |
|
1064 |
} |
|
1065 | ||
1066 |
//강인구 추가 |
|
924 |
/// <summary> |
|
925 |
/// 굵기 속성 변경 |
|
926 |
/// </summary> |
|
927 |
/// <param name="sender"></param> |
|
928 |
/// <param name="e"></param> |
|
1067 | 929 |
private void btnBold_Checked(object sender, RoutedEventArgs e) |
1068 | 930 |
{ |
1069 |
if (this.ParentOfType<MainWindow>() != null) |
|
931 |
var AdonerList = GetAdornerItems(); |
|
932 |
if (!AdonerList.Any()) return; |
|
933 | ||
934 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
935 | ||
936 |
#region 속성 변경 |
|
937 |
foreach (AdornerMember InnerItem in AdonerList) |
|
1070 | 938 |
{ |
1071 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
|
939 |
var element = InnerItem.DrawingData; |
|
940 |
if (element is MarkupToPDF.Controls.Text.ArrowTextControl ArrowTextCtrl) |
|
1072 | 941 |
{ |
1073 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
|
|
942 |
if (ArrowTextCtrl.TextWeight == FontWeights.Bold)
|
|
1074 | 943 |
{ |
1075 |
if (item.GetType().Name == "AdornerFinal") |
|
1076 |
{ |
|
1077 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
|
1078 |
{ |
|
1079 |
switch (InnerItem.DrawingData.GetType().Name) |
|
1080 |
{ |
|
1081 |
case ("TextControl"): |
|
1082 |
{ |
|
1083 |
if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight == FontWeights.Bold) |
|
1084 |
{ |
|
1085 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Normal; |
|
1086 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1087 |
} |
|
1088 |
else |
|
1089 |
{ |
|
1090 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextWeight = FontWeights.Bold; |
|
1091 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1092 |
} |
|
1093 | ||
1094 |
} |
|
1095 |
break; |
|
1096 |
case ("ArrowTextControl"): |
|
1097 |
{ |
|
1098 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight == FontWeights.Bold) |
|
1099 |
{ |
|
1100 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Normal; |
|
1101 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1102 |
} |
|
1103 |
else |
|
1104 |
{ |
|
1105 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextWeight = FontWeights.Bold; |
|
1106 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1107 |
} |
|
1108 |
} |
|
1109 |
break; |
|
1110 |
} |
|
1111 |
} |
|
1112 |
} |
|
944 |
ArrowTextCtrl.TextWeight = FontWeights.Normal; |
|
945 |
} |
|
946 |
else |
|
947 |
{ |
|
948 |
ArrowTextCtrl.TextWeight = FontWeights.Bold; |
|
949 |
} |
|
950 |
} |
|
951 |
else if (element is MarkupToPDF.Controls.Text.TextControl TextCtrl) |
|
952 |
{ |
|
953 |
if (TextCtrl.TextWeight == FontWeights.Bold) |
|
954 |
{ |
|
955 |
TextCtrl.TextWeight = FontWeights.Normal; |
|
956 |
} |
|
957 |
else |
|
958 |
{ |
|
959 |
TextCtrl.TextWeight = FontWeights.Bold; |
|
1113 | 960 |
} |
1114 | 961 |
} |
1115 | 962 |
} |
963 | ||
964 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
965 |
#endregion |
|
1116 | 966 |
} |
1117 | 967 | |
1118 |
//강인구 추가 |
|
968 |
/// <summary> |
|
969 |
/// 이탤릭 속성 변경 |
|
970 |
/// </summary> |
|
971 |
/// <param name="sender"></param> |
|
972 |
/// <param name="e"></param> |
|
1119 | 973 |
private void btnItalic_Checked(object sender, RoutedEventArgs e) |
1120 | 974 |
{ |
1121 |
if (this.ParentOfType<MainWindow>() != null) |
|
975 |
var AdonerList = GetAdornerItems(); |
|
976 |
if (!AdonerList.Any()) return; |
|
977 | ||
978 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
979 | ||
980 |
#region 속성 변경 |
|
981 |
foreach (AdornerMember InnerItem in AdonerList) |
|
1122 | 982 |
{ |
1123 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
|
983 |
var element = InnerItem.DrawingData; |
|
984 |
if (element is MarkupToPDF.Controls.Text.ArrowTextControl ArrowTextCtrl) |
|
1124 | 985 |
{ |
1125 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
|
|
986 |
if (ArrowTextCtrl.TextStyle == FontStyles.Italic)
|
|
1126 | 987 |
{ |
1127 |
if (item.GetType().Name == "AdornerFinal") |
|
1128 |
{ |
|
1129 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
|
1130 |
{ |
|
1131 |
switch (InnerItem.DrawingData.GetType().Name) |
|
1132 |
{ |
|
1133 |
case ("TextControl"): |
|
1134 |
{ |
|
1135 |
if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle == FontStyles.Italic) |
|
1136 |
{ |
|
1137 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = System.Windows.FontStyles.Normal; |
|
1138 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1139 |
} |
|
1140 |
else |
|
1141 |
{ |
|
1142 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextStyle = FontStyles.Italic; |
|
1143 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1144 |
} |
|
1145 | ||
1146 |
} |
|
1147 |
break; |
|
1148 |
case ("ArrowTextControl"): |
|
1149 |
{ |
|
1150 |
if((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle == FontStyles.Italic) |
|
1151 |
{ |
|
1152 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Normal; |
|
1153 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1154 |
} |
|
1155 |
else |
|
1156 |
{ |
|
1157 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextStyle = FontStyles.Italic; |
|
1158 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1159 |
} |
|
1160 |
} |
|
1161 |
break; |
|
1162 |
} |
|
1163 |
} |
|
1164 |
} |
|
988 |
ArrowTextCtrl.TextStyle = System.Windows.FontStyles.Normal; |
|
989 |
} |
|
990 |
else |
|
991 |
{ |
|
992 |
ArrowTextCtrl.TextStyle = FontStyles.Italic; |
|
993 |
} |
|
994 |
} |
|
995 |
else if (element is MarkupToPDF.Controls.Text.TextControl TextCtrl) |
|
996 |
{ |
|
997 |
if (TextCtrl.TextStyle == FontStyles.Italic) |
|
998 |
{ |
|
999 |
TextCtrl.TextStyle = System.Windows.FontStyles.Normal; |
|
1000 |
} |
|
1001 |
else |
|
1002 |
{ |
|
1003 |
TextCtrl.TextStyle = FontStyles.Italic; |
|
1165 | 1004 |
} |
1166 | 1005 |
} |
1167 | 1006 |
} |
1007 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1008 |
#endregion |
|
1168 | 1009 |
} |
1169 | 1010 | |
1170 |
//강인구 추가 |
|
1011 |
/// <summary> |
|
1012 |
/// 밑줄 변경 |
|
1013 |
/// </summary> |
|
1014 |
/// <param name="sender"></param> |
|
1015 |
/// <param name="e"></param> |
|
1171 | 1016 |
private void btnUnderLine_Checked(object sender, RoutedEventArgs e) |
1172 | 1017 |
{ |
1173 |
if (this.ParentOfType<MainWindow>() != null) |
|
1018 |
var AdonerList = GetAdornerItems(); |
|
1019 |
if (!AdonerList.Any()) return; |
|
1020 | ||
1021 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
1022 | ||
1023 |
#region 속성 변경 |
|
1024 |
foreach (AdornerMember InnerItem in AdonerList) |
|
1174 | 1025 |
{ |
1175 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
|
1026 |
var element = InnerItem.DrawingData; |
|
1027 |
if (element is MarkupToPDF.Controls.Text.ArrowTextControl ArrowTextCtrl) |
|
1176 | 1028 |
{ |
1177 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
|
|
1029 |
if (ArrowTextCtrl.UnderLine != null && ArrowTextCtrl.UnderLine == TextDecorations.Underline)
|
|
1178 | 1030 |
{ |
1179 |
if (item.GetType().Name == "AdornerFinal") |
|
1180 |
{ |
|
1181 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
|
1182 |
{ |
|
1183 |
switch (InnerItem.DrawingData.GetType().Name) |
|
1184 |
{ |
|
1185 |
case ("TextControl"): |
|
1186 |
{ |
|
1187 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine == TextDecorations.Underline) |
|
1188 |
{ |
|
1189 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = null; |
|
1190 |
} |
|
1191 |
else |
|
1192 |
{ |
|
1193 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).UnderLine = TextDecorations.Underline; |
|
1194 |
} |
|
1195 |
} |
|
1196 |
break; |
|
1197 |
case ("ArrowTextControl"): |
|
1198 |
{ |
|
1199 |
if ((InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine == TextDecorations.Underline) |
|
1200 |
{ |
|
1201 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = null; |
|
1202 |
} |
|
1203 |
else |
|
1204 |
{ |
|
1205 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).UnderLine = TextDecorations.Underline; |
|
1206 |
} |
|
1207 |
} |
|
1208 |
break; |
|
1209 |
} |
|
1210 | ||
1211 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1212 |
} |
|
1213 |
} |
|
1031 |
ArrowTextCtrl.UnderLine = null; |
|
1032 |
} |
|
1033 |
else |
|
1034 |
{ |
|
1035 |
ArrowTextCtrl.UnderLine = TextDecorations.Underline; |
|
1036 |
} |
|
1037 |
} |
|
1038 |
else if (element is MarkupToPDF.Controls.Text.TextControl TextCtrl) |
|
1039 |
{ |
|
1040 |
if (TextCtrl.UnderLine != null && TextCtrl.UnderLine == TextDecorations.Underline) |
|
1041 |
{ |
|
1042 |
TextCtrl.UnderLine = null; |
|
1043 |
} |
|
1044 |
else |
|
1045 |
{ |
|
1046 |
TextCtrl.UnderLine = TextDecorations.Underline; |
|
1214 | 1047 |
} |
1215 | 1048 |
} |
1216 | 1049 |
} |
1050 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1051 |
#endregion |
|
1217 | 1052 |
} |
1218 | 1053 | |
1219 | ||
1220 | 1054 |
private void cbLineSize_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) |
1221 | 1055 |
{ |
1222 | 1056 |
if (e.Key == Key.Space || e.Key == Key.ImeProcessed) |
... | ... | |
1287 | 1121 |
} |
1288 | 1122 |
} |
1289 | 1123 | |
1124 |
/// <summary> |
|
1125 |
/// 폰트 크기 변경 |
|
1126 |
/// </summary> |
|
1127 |
/// <param name="sender"></param> |
|
1128 |
/// <param name="e"></param> |
|
1290 | 1129 |
private void comboFontSize_ValueChanged(object sender, RadRangeBaseValueChangedEventArgs e) |
1291 | 1130 |
{ |
1292 | 1131 |
if (string.IsNullOrEmpty(comboFontSize.Value.ToString())) |
1293 | 1132 |
{ |
1294 | 1133 |
comboFontSize.Value = comboFontSize.Minimum; |
1295 | 1134 |
} |
1296 |
if (this.ParentOfType<MainWindow>() != null) |
|
1135 | ||
1136 |
var AdonerList = GetAdornerItems(); |
|
1137 |
if (!AdonerList.Any()) return; |
|
1138 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
1139 | ||
1140 |
#region 속성 변경 |
|
1141 |
foreach (AdornerMember InnerItem in AdonerList) |
|
1297 | 1142 |
{ |
1298 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
|
|
1143 |
switch (InnerItem.DrawingData.GetType().Name)
|
|
1299 | 1144 |
{ |
1300 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
|
1301 |
{ |
|
1302 |
if (item.GetType().Name == "AdornerFinal") |
|
1145 |
case ("TextControl"): |
|
1303 | 1146 |
{ |
1304 |
foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>()) |
|
1305 |
{ |
|
1306 |
switch (InnerItem.DrawingData.GetType().Name) |
|
1307 |
{ |
|
1308 |
case ("TextControl"): |
|
1309 |
{ |
|
1310 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Value.ToString()); |
|
1311 |
} |
|
1312 |
break; |
|
1313 |
case ("ArrowTextControl"): |
|
1314 |
{ |
|
1315 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Value.ToString()); |
|
1316 |
} |
|
1317 |
break; |
|
1318 |
} |
|
1319 |
} |
|
1320 | ||
1321 |
ChangeComment(item as Controls.AdornerFinal); |
|
1147 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.TextControl).TextSize = int.Parse(comboFontSize.Value.ToString()); |
|
1322 | 1148 |
} |
1323 |
} |
|
1149 |
break; |
|
1150 |
case ("ArrowTextControl"): |
|
1151 |
{ |
|
1152 |
(InnerItem.DrawingData as MarkupToPDF.Controls.Text.ArrowTextControl).TextSize = int.Parse(comboFontSize.Value.ToString()); |
|
1153 |
} |
|
1154 |
break; |
|
1324 | 1155 |
} |
1325 | 1156 |
} |
1157 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1158 |
#endregion |
|
1326 | 1159 | |
1327 | 1160 |
KCOM.Properties.Settings.Default.TextSize = (double)comboFontSize.Value; |
1328 | 1161 |
Properties.Settings.Default.Save(); |
1329 | 1162 |
} |
1330 | 1163 | |
1331 |
//강인구 추가 |
|
1164 |
/// <summary> |
|
1165 |
/// 폰트 패밀리 변경 |
|
1166 |
/// </summary> |
|
1167 |
/// <param name="sender"></param> |
|
1168 |
/// <param name="e"></param> |
|
1332 | 1169 |
private void comboFontFamily_SelectionChanged(object sender, SelectionChangedEventArgs e) |
1333 | 1170 |
{ |
1334 |
|
|
1335 | 1171 |
if (comboFontFamily.SelectedItem != null && !IsSuspendChange) |
1336 | 1172 |
{ |
1337 |
var main = this.ParentOfType<MainWindow>()?.dzMainMenu; |
|
1338 |
var font = comboFontFamily.SelectedItem as Markus.Fonts.MarkusFont; |
|
1339 |
var lstTextCtrl = SelectTextControl(); |
|
1173 |
var AdonerList = GetAdornerItems(); |
|
1174 |
if (!AdonerList.Any()) return; |
|
1175 | ||
1176 |
UndoCommand.Instance.Push(EventType.Operation, AdonerList.ConvertAll(x => x.DrawingData as CommentUserInfo)); |
|
1340 | 1177 | |
1341 |
foreach (var item in lstTextCtrl) |
|
1178 |
#region 속성 변경 |
|
1179 |
var font = comboFontFamily.SelectedItem as Markus.Fonts.MarkusFont; |
|
1180 |
foreach (AdornerMember InnerItem in AdonerList) |
|
1342 | 1181 |
{ |
1343 |
if (item is MarkupToPDF.Controls.Text.ArrowTextControl ctrl1) |
|
1182 |
var element = InnerItem.DrawingData; |
|
1183 |
if (element is MarkupToPDF.Controls.Text.ArrowTextControl ctrl1) |
|
1344 | 1184 |
{ |
1345 | 1185 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1346 | 1186 |
ctrl1.SetFontFamily(font.FontFamily); |
1347 | 1187 |
} |
1348 |
else if (item is MarkupToPDF.Controls.Text.TextControl ctrl2)
|
|
1188 |
else if (element is MarkupToPDF.Controls.Text.TextControl ctrl2)
|
|
1349 | 1189 |
{ |
1350 | 1190 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1351 | 1191 |
ctrl2.SetFontFamily(font.FontFamily); |
1352 | 1192 |
} |
1353 | 1193 |
} |
1194 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
|
1195 |
#endregion |
|
1354 | 1196 | |
1355 | 1197 |
KCOM.Properties.Settings.Default.FontFamily = font.FontFamily.FontName(); |
1356 | 1198 |
Properties.Settings.Default.Save(); |
1357 | 1199 |
} |
1358 | 1200 |
} |
1359 | 1201 | |
1360 |
private List<UIElement> SelectTextControl() |
|
1361 |
{ |
|
1362 |
List<UIElement> lstTextCtrl = new List<UIElement>(); |
|
1363 | ||
1364 |
var main = this.ParentOfType<MainWindow>()?.dzMainMenu; |
|
1365 |
var font = comboFontFamily.SelectedItem as Markus.Fonts.MarkusFont; |
|
1366 | ||
1367 | ||
1368 |
if (main.SelectLayer.FindChildByType<AdornerFinal>() != null) |
|
1369 |
{ |
|
1370 |
lstTextCtrl.AddRange(main.SelectLayer.FindChildByType<AdornerFinal>().Members.Where(x => x.DrawingData is MarkupToPDF.Controls.Common.ITextControl).Select(x => x.DrawingData)); |
|
1371 |
} |
|
1372 | ||
1373 |
lstTextCtrl.AddRange(main.zoomAndPanCanvas.FindAllChildren(x => x is MarkupToPDF.Controls.Common.ITextControl c && (c.IsSelected || c.IsEditingMode == true)).Select(x => (UIElement)x)); |
|
1374 | ||
1375 |
return lstTextCtrl; |
|
1376 |
} |
|
1377 | ||
1378 | ||
1379 | 1202 |
/// <summary> |
1380 | 1203 |
/// 텍스트 컨트롤 하일라이트 처리 |
1381 | 1204 |
/// </summary> |
... | ... | |
2703 | 2526 | |
2704 | 2527 |
} |
2705 | 2528 | |
2706 |
UndoData multi_UndoData = new UndoData(); |
|
2707 | 2529 |
CommentUserInfo currentControl { get; set; } |
2708 | 2530 |
private void Check_Closed(object sender, EventArgs e) |
2709 | 2531 |
{ |
내보내기 Unified diff