개정판 24678e06
issue #000: Add Commons.cs file
Change-Id: I14ae2a26673890b4be08a1c989faf570629ad3d1
KCOM/Events/Implementation/TopMenuEvent.cs | ||
---|---|---|
2150 | 2150 |
#endregion |
2151 | 2151 |
#region Delete |
2152 | 2152 |
case "Delete": |
2153 |
Delete_Start(); |
|
2153 |
DeleteCommand.Instance.Execute(this.ParentOfType<MainWindow>().SelectedItems); |
|
2154 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear(); |
|
2155 |
|
|
2154 | 2156 |
instanceToggle.IsChecked = false; |
2155 | 2157 |
ViewerDataModel.Instance.SelectedControl = ""; |
2156 | 2158 |
ViewerDataModel.Instance.ControlTag = null; |
... | ... | |
2785 | 2787 |
if (parse != "") |
2786 | 2788 |
{ |
2787 | 2789 |
System.Windows.Controls.Control item = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty); |
2788 |
(item as MarkupToPDF.Common.CommentUserInfo).CommentID = Events.SaveCommand.shortGuid();
|
|
2790 |
(item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.shortGuid();
|
|
2789 | 2791 |
|
2790 | 2792 |
ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
2791 | 2793 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
... | ... | |
2847 | 2849 |
|
2848 | 2850 |
string temppath = System.IO.Path.GetTempPath(); |
2849 | 2851 |
//string filename = KCOM.Events.Save.shortCommentKey(); |
2850 |
string filename = KCOM.Events.SaveCommand.shortFileKey();
|
|
2852 |
string filename = Commons.shortFileKey();
|
|
2851 | 2853 |
|
2852 | 2854 |
System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage(); |
2853 | 2855 |
clipboardImage.Save(temppath + "\\" + filename); |
... | ... | |
2931 | 2933 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
2932 | 2934 |
|
2933 | 2935 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
2934 |
currentControl.CommentID = Events.SaveCommand.shortGuid();
|
|
2936 |
currentControl.CommentID = Commons.shortGuid();
|
|
2935 | 2937 |
|
2936 | 2938 |
currentControl.ApplyTemplate(); |
2937 | 2939 |
currentControl.SetImage(); |
... | ... | |
2950 | 2952 |
} |
2951 | 2953 |
} |
2952 | 2954 |
} |
2953 |
|
|
2954 |
public void Delete_Start() |
|
2955 |
{ |
|
2956 |
if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0) |
|
2957 |
{ |
|
2958 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
|
2959 |
|
|
2960 |
UndoData = new Undo_data() |
|
2961 |
{ |
|
2962 |
IsUndo = false, |
|
2963 |
Event = Event_Type.Delete, |
|
2964 |
EventTime = DateTime.Now, |
|
2965 |
Markup_List = new List<Multi_Undo_data>() |
|
2966 |
}; |
|
2967 |
|
|
2968 |
foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children) |
|
2969 |
{ |
|
2970 |
if (item.GetType().Name == "AdornerFinal") |
|
2971 |
{ |
|
2972 |
(item as Controls.AdornerFinal).unRegister(); |
|
2973 |
|
|
2974 |
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>()) |
|
2975 |
{ |
|
2976 |
//if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData)) |
|
2977 |
if (!ViewerDataModel.Instance.MarkupControls_USER.Contains(InnerItem.DrawingData)) |
|
2978 |
{ |
|
2979 |
|
|
2980 |
multi_Undo_Data.Markup = InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo; |
|
2981 |
UndoData.Markup_List.Add(multi_Undo_Data); |
|
2982 |
multi_Undo_Data = new Multi_Undo_data(); |
|
2983 |
|
|
2984 |
ViewerDataModel.Instance.MarkupControls.Remove(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo); |
|
2985 |
|
|
2986 |
var Item_ = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault(); |
|
2987 |
|
|
2988 |
ViewerDataModel.Instance.MarkupList_USER.Remove(Item_); |
|
2989 |
|
|
2990 |
//임시파일에서도 삭제한다. |
|
2991 |
TempFile.DelTemp((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber.ToString()); |
|
2992 |
|
|
2993 |
} |
|
2994 |
} |
|
2995 |
} |
|
2996 |
|
|
2997 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
2998 |
{ |
|
2999 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
3000 |
}); |
|
3001 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
|
3002 |
} |
|
3003 |
} |
|
3004 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear(); |
|
3005 |
} |
|
3006 |
|
|
3007 | 2955 |
} |
3008 | 2956 |
} |
내보내기 Unified diff