1 |
787a4489
|
KangIngu
|
using KCOM.Common;
|
2 |
|
|
using KCOM.Events;
|
3 |
5ce56a3a
|
KangIngu
|
using KCOMDataModel.Common;
|
4 |
|
|
using KCOMDataModel.DataModel;
|
5 |
787a4489
|
KangIngu
|
using System;
|
6 |
|
|
using System.Collections.Generic;
|
7 |
|
|
using System.Linq;
|
8 |
|
|
using System.Text;
|
9 |
|
|
using System.Windows;
|
10 |
|
|
using System.Windows.Controls;
|
11 |
|
|
using System.Windows.Data;
|
12 |
|
|
using System.Windows.Documents;
|
13 |
|
|
using System.Windows.Input;
|
14 |
|
|
using System.Windows.Media;
|
15 |
|
|
using System.Windows.Media.Imaging;
|
16 |
|
|
using System.Windows.Navigation;
|
17 |
|
|
using System.Windows.Shapes;
|
18 |
|
|
using Telerik.Windows.Controls;
|
19 |
5ce56a3a
|
KangIngu
|
using Telerik.Windows.Controls.DragDrop;
|
20 |
787a4489
|
KangIngu
|
|
21 |
|
|
namespace KCOM.Controls
|
22 |
|
|
{
|
23 |
|
|
public class Symbol_Custom
|
24 |
|
|
{
|
25 |
5ce56a3a
|
KangIngu
|
public string ID { get; set; }
|
26 |
787a4489
|
KangIngu
|
public string Name { get; set; }
|
27 |
|
|
public string ImageUri { get; set; }
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
/// <summary>
|
31 |
|
|
/// Symbol.xaml에 대한 상호 작용 논리
|
32 |
|
|
/// </summary>
|
33 |
|
|
public partial class Symbol : UserControl
|
34 |
|
|
{
|
35 |
|
|
AdornerFinal finalItem;
|
36 |
5ce56a3a
|
KangIngu
|
bool IsMouseDown = false;
|
37 |
|
|
string moveItem_id = "";
|
38 |
787a4489
|
KangIngu
|
public string filename { get; set; }
|
39 |
|
|
MarkupToPDF.Controls.Parsing.LayerControl layer = new MarkupToPDF.Controls.Parsing.LayerControl();
|
40 |
|
|
|
41 |
|
|
public Symbol()
|
42 |
|
|
{
|
43 |
|
|
InitializeComponent();
|
44 |
089566c0
|
humkyung
|
|
45 |
|
|
RadDragAndDropManager.AddDragInfoHandler(lstSymbolPrivate, OnDragPrivateInfo);
|
46 |
|
|
RadDragAndDropManager.AddDragQueryHandler(lstSymbolPrivate, OnDragPrivateQuery);
|
47 |
|
|
RadDragAndDropManager.SetAllowDrag(lstSymbolPrivate, true);
|
48 |
787a4489
|
KangIngu
|
|
49 |
|
|
DataBind();
|
50 |
|
|
}
|
51 |
|
|
|
52 |
5ce56a3a
|
KangIngu
|
private void OnDragPrivateInfo(object sender, DragDropEventArgs e)
|
53 |
|
|
{
|
54 |
|
|
}
|
55 |
|
|
|
56 |
|
|
private void OnDragPrivateQuery(object sender, DragDropQueryEventArgs e)
|
57 |
|
|
{
|
58 |
|
|
if (e.Options.Status == DragStatus.DragQuery)
|
59 |
|
|
{
|
60 |
|
|
//var draggedListBoxItem = (e.Options.Source as System.Windows.Controls.ListBox).SelectedItem;
|
61 |
|
|
//BitmapImage im = new BitmapImage(new Uri((draggedListBoxItem as DeepView.ServiceDeepView_Symbol.SymbolPrivate).ImageUri));
|
62 |
|
|
//ImageSource _source = im;
|
63 |
|
|
//Image img = new Image();
|
64 |
|
|
//img.Source = _source;
|
65 |
|
|
|
66 |
|
|
//e.Options.Payload = im;
|
67 |
|
|
//var dragCue = new Image();
|
68 |
|
|
//dragCue.Source = img.Source;
|
69 |
|
|
//dragCue.Width = 0;
|
70 |
|
|
//dragCue.Height = 0;
|
71 |
|
|
//e.Options.DragCue = dragCue;
|
72 |
|
|
|
73 |
|
|
|
74 |
|
|
//PayLoadAdorner = new AdornerFinal();
|
75 |
|
|
//DeepView.ServiceDeepView_Symbol.SymbolPrivate tempDragableControl = (e.Options.Source as System.Windows.Controls.ListBox).SelectedItem as DeepView.ServiceDeepView_Symbol.SymbolPrivate;
|
76 |
|
|
//var xamldata = tempDragableControl.Data;
|
77 |
|
|
////this.DeepLayer.markupParse(xamldata, this.DeepLayer._TempLayer, "복사된 데이터_이름으로 수정해야함");
|
78 |
|
|
//PayLoadAdorner = this.DeepLayer.markupParseToAdorner(xamldata, this.DeepLayer._SelectLayer, "");
|
79 |
|
|
//this.DeepLayer._SelectLayer.Children.Add(PayLoadAdorner);
|
80 |
|
|
}
|
81 |
|
|
|
82 |
|
|
e.QueryResult = true;
|
83 |
|
|
e.Handled = true;
|
84 |
|
|
}
|
85 |
|
|
|
86 |
787a4489
|
KangIngu
|
private void DataBind()
|
87 |
|
|
{
|
88 |
5ce56a3a
|
KangIngu
|
//lstSymbolPrivate.ItemsSource = null;
|
89 |
|
|
//lstSymbolPublic.ItemsSource = null;
|
90 |
787a4489
|
KangIngu
|
|
91 |
|
|
Symbol_Custom Custom = new Symbol_Custom();
|
92 |
|
|
List<Symbol_Custom> Custom_List = new List<Symbol_Custom>();
|
93 |
6c781c0c
|
djkim
|
ServiceDeepView.ServiceDeepViewClient client = new ServiceDeepView.ServiceDeepViewClient(App._binding, App._EndPoint);
|
94 |
|
|
var symbol_Private = client.GetSymbolList(App.ViewInfo.UserID);
|
95 |
|
|
foreach (var item in symbol_Private)
|
96 |
5ce56a3a
|
KangIngu
|
{
|
97 |
6c781c0c
|
djkim
|
Custom.Name = item.NAME;
|
98 |
|
|
Custom.ImageUri = item.IMAGE_URL;
|
99 |
|
|
Custom.ID = item.ID;
|
100 |
|
|
Custom_List.Add(Custom);
|
101 |
5ce56a3a
|
KangIngu
|
Custom = new Symbol_Custom();
|
102 |
6c781c0c
|
djkim
|
}
|
103 |
|
|
lstSymbolPrivate.ItemsSource = Custom_List;
|
104 |
5ce56a3a
|
KangIngu
|
|
105 |
6c781c0c
|
djkim
|
Custom = new Symbol_Custom();
|
106 |
|
|
Custom_List = new List<Symbol_Custom>();
|
107 |
5ce56a3a
|
KangIngu
|
|
108 |
6c781c0c
|
djkim
|
deptlist.ItemsSource = client.GetPublicSymbolDeptList();
|
109 |
5ce56a3a
|
KangIngu
|
|
110 |
6c781c0c
|
djkim
|
List<SYMBOL_PUBLIC> symbol_Public;
|
111 |
5ce56a3a
|
KangIngu
|
|
112 |
6c781c0c
|
djkim
|
|
113 |
|
|
if (deptlist.SelectedValue != null)
|
114 |
|
|
{
|
115 |
|
|
symbol_Public = client.GetPublicSymbolList(deptlist.SelectedValue.ToString());
|
116 |
|
|
}
|
117 |
|
|
else
|
118 |
|
|
{
|
119 |
|
|
symbol_Public = client.GetPublicSymbolList(null);
|
120 |
5ce56a3a
|
KangIngu
|
}
|
121 |
6c781c0c
|
djkim
|
foreach (var item in symbol_Public)
|
122 |
|
|
{
|
123 |
|
|
Custom.Name = item.NAME;
|
124 |
|
|
Custom.ImageUri = item.IMAGE_URL;
|
125 |
|
|
Custom.ID = item.ID;
|
126 |
|
|
Custom_List.Add(Custom);
|
127 |
|
|
Custom = new Symbol_Custom();
|
128 |
|
|
}
|
129 |
|
|
lstSymbolPublic.ItemsSource = Custom_List;
|
130 |
|
|
client.Close();
|
131 |
5ce56a3a
|
KangIngu
|
}
|
132 |
|
|
|
133 |
|
|
public PngBitmapEncoder symImage(string data)
|
134 |
|
|
{
|
135 |
|
|
|
136 |
|
|
Canvas _canvas = new Canvas();
|
137 |
|
|
_canvas.Background = Brushes.White;
|
138 |
|
|
_canvas.Width = finalItem.BorderSize.Width;
|
139 |
|
|
_canvas.Height = finalItem.BorderSize.Height;
|
140 |
|
|
layer.markupParse(data, _canvas, "#FFFF0000", "");
|
141 |
|
|
|
142 |
|
|
BitmapEncoder encoder = new PngBitmapEncoder();
|
143 |
|
|
|
144 |
|
|
|
145 |
|
|
RenderTargetBitmap renderBitmap = new RenderTargetBitmap((int)_canvas.Width + 50, (int)_canvas.Height + 50, 96d, 96d, PixelFormats.Pbgra32);
|
146 |
|
|
|
147 |
|
|
DrawingVisual dv = new DrawingVisual();
|
148 |
|
|
|
149 |
|
|
_canvas.Measure(new System.Windows.Size(finalItem.BorderSize.Width + 50, finalItem.BorderSize.Height + 50));
|
150 |
|
|
//_canvas.Arrange(new Rect(new System.Windows.Point { X = -finalItem.BorderSize.X - 50, Y = -finalItem.BorderSize.Y - 50 }, new Point(finalItem.BorderSize.Width + 20, finalItem.BorderSize.Height + 20)));
|
151 |
|
|
_canvas.Arrange(new Rect(new System.Windows.Point { X = -finalItem.BorderSize.X - 20, Y = -finalItem.BorderSize.Y - 20 }, new Point(finalItem.BorderSize.Width + 20, finalItem.BorderSize.Height + 20)));
|
152 |
|
|
|
153 |
|
|
using (DrawingContext ctx = dv.RenderOpen())
|
154 |
|
|
{
|
155 |
|
|
VisualBrush vb = new VisualBrush(_canvas);
|
156 |
|
|
//ctx.DrawRectangle(vb, null, new Rect(new System.Windows.Point { X = -finalItem.BorderSize.X - 20, Y = -finalItem.BorderSize.Y - 20 }, new Point(finalItem.BorderSize.Width + 20, finalItem.BorderSize.Height + 20)));
|
157 |
|
|
ctx.DrawRectangle(vb, null, new Rect(new System.Windows.Point { X = -finalItem.BorderSize.X, Y = -finalItem.BorderSize.Y }, new Point(finalItem.BorderSize.Width + 20, finalItem.BorderSize.Height + 20)));
|
158 |
|
|
}
|
159 |
|
|
|
160 |
|
|
try
|
161 |
|
|
{
|
162 |
|
|
renderBitmap.Render(dv);
|
163 |
|
|
|
164 |
|
|
GC.Collect();
|
165 |
|
|
GC.WaitForPendingFinalizers();
|
166 |
|
|
GC.Collect();
|
167 |
|
|
//bitmap.Render(controlToConvert);
|
168 |
|
|
// encode png data
|
169 |
|
|
PngBitmapEncoder pngEncoder = new PngBitmapEncoder();
|
170 |
|
|
// puch rendered bitmap into it
|
171 |
|
|
pngEncoder.Interlace = PngInterlaceOption.Off;
|
172 |
|
|
pngEncoder.Frames.Add(BitmapFrame.Create(renderBitmap));
|
173 |
|
|
return pngEncoder;
|
174 |
|
|
|
175 |
|
|
}
|
176 |
|
|
catch (Exception ex)
|
177 |
|
|
{
|
178 |
|
|
return null;
|
179 |
|
|
}
|
180 |
787a4489
|
KangIngu
|
|
181 |
|
|
}
|
182 |
|
|
|
183 |
5ce56a3a
|
KangIngu
|
public void DialogMessage_Alert(string content, string header)
|
184 |
|
|
{
|
185 |
|
|
var box = new TextBlock();
|
186 |
|
|
box.MinWidth = 400;
|
187 |
|
|
box.FontSize = 11;
|
188 |
|
|
//box.FontSize = 12;
|
189 |
|
|
box.Text = content;
|
190 |
|
|
box.TextWrapping = System.Windows.TextWrapping.Wrap;
|
191 |
|
|
|
192 |
|
|
DialogParameters parameters = new DialogParameters()
|
193 |
|
|
{
|
194 |
b9b01f8e
|
ljiyeon
|
Owner = Application.Current.MainWindow,
|
195 |
5ce56a3a
|
KangIngu
|
Content = box,
|
196 |
|
|
Header = header,
|
197 |
|
|
Theme = new VisualStudio2013Theme(),
|
198 |
|
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
199 |
|
|
};
|
200 |
|
|
RadWindow.Alert(parameters);
|
201 |
|
|
}
|
202 |
|
|
|
203 |
|
|
#region Event
|
204 |
|
|
|
205 |
498f0fc9
|
ljiyeon
|
#region Private Symbol Add Event
|
206 |
787a4489
|
KangIngu
|
private void Create_Symbol(object sender, RoutedEventArgs e)
|
207 |
|
|
{
|
208 |
|
|
MarkupToPDF.Controls.Parsing.LayerControl.MarkupReturn markupReturn = new MarkupToPDF.Controls.Parsing.LayerControl.MarkupReturn();
|
209 |
|
|
|
210 |
|
|
if (Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면
|
211 |
|
|
{
|
212 |
|
|
DialogMessage_Alert("Please Select Controls", "Alert");
|
213 |
|
|
}
|
214 |
|
|
else //선택된 것이 있으면
|
215 |
|
|
{
|
216 |
|
|
string MarkupData = "";
|
217 |
|
|
finalItem = new AdornerFinal();
|
218 |
|
|
|
219 |
|
|
foreach (var item in Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children)
|
220 |
|
|
{
|
221 |
|
|
if (item.GetType().Name == "AdornerFinal")
|
222 |
|
|
{
|
223 |
|
|
finalItem = (item as Controls.AdornerFinal);
|
224 |
|
|
foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
|
225 |
|
|
{
|
226 |
|
|
if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
|
227 |
|
|
{
|
228 |
|
|
markupReturn = layer.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID);
|
229 |
|
|
MarkupData += markupReturn.ConvertData;
|
230 |
|
|
}
|
231 |
|
|
}
|
232 |
|
|
}
|
233 |
|
|
}
|
234 |
|
|
DialogParameters parameters = new DialogParameters()
|
235 |
|
|
{
|
236 |
b9b01f8e
|
ljiyeon
|
Owner = Application.Current.MainWindow,
|
237 |
498f0fc9
|
ljiyeon
|
Closed = (obj, args) => this.MarkupNamePromptClose(MarkupData, args),
|
238 |
787a4489
|
KangIngu
|
DefaultPromptResultValue = "Custom State",
|
239 |
|
|
Content = "Name :",
|
240 |
|
|
Header = "Insert Custom Symbol Name",
|
241 |
|
|
Theme = new VisualStudio2013Theme(),
|
242 |
|
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
243 |
|
|
};
|
244 |
|
|
RadWindow.Prompt(parameters);
|
245 |
|
|
}
|
246 |
|
|
|
247 |
|
|
}
|
248 |
5ce56a3a
|
KangIngu
|
#endregion
|
249 |
787a4489
|
KangIngu
|
|
250 |
5ce56a3a
|
KangIngu
|
#region Symbol Add Close Event
|
251 |
787a4489
|
KangIngu
|
private void MarkupNamePromptClose(string data, WindowClosedEventArgs args)
|
252 |
|
|
{
|
253 |
|
|
Save save = new Save();
|
254 |
|
|
|
255 |
|
|
if (args.DialogResult.Value)
|
256 |
|
|
{
|
257 |
|
|
PngBitmapEncoder _Encoder = symImage(data);
|
258 |
|
|
|
259 |
|
|
System.IO.MemoryStream fs = new System.IO.MemoryStream();
|
260 |
|
|
_Encoder.Save(fs);
|
261 |
|
|
System.Drawing.Image ImgOut = System.Drawing.Image.FromStream(fs);
|
262 |
|
|
|
263 |
|
|
byte[] Img_byte = fs.ToArray();
|
264 |
|
|
|
265 |
|
|
kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
|
266 |
|
|
filename = fileUploader.Run(App.ViewInfo.ProjectNO, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, Save.shortGuid() + ".png", Img_byte);
|
267 |
498f0fc9
|
ljiyeon
|
|
268 |
|
|
if(RadTab.SelectedIndex == 0)
|
269 |
|
|
{
|
270 |
|
|
save.SymbolSave(args.PromptResult, filename, data);
|
271 |
|
|
}
|
272 |
|
|
else
|
273 |
|
|
{
|
274 |
|
|
save.SymbolSave_Public(args.PromptResult, filename, data, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.userData.DEPARTMENT);
|
275 |
|
|
}
|
276 |
5ce56a3a
|
KangIngu
|
|
277 |
|
|
DataBind();
|
278 |
787a4489
|
KangIngu
|
}
|
279 |
|
|
}
|
280 |
5ce56a3a
|
KangIngu
|
#endregion
|
281 |
787a4489
|
KangIngu
|
|
282 |
498f0fc9
|
ljiyeon
|
#region Private Symbol Delete Event
|
283 |
5ce56a3a
|
KangIngu
|
private void Remove_Symbol(object sender, RoutedEventArgs e)
|
284 |
787a4489
|
KangIngu
|
{
|
285 |
5ce56a3a
|
KangIngu
|
if (lstSymbolPrivate.SelectedItem == null)
|
286 |
|
|
{
|
287 |
|
|
DialogMessage_Alert("Please Select Symbol", "Alert");
|
288 |
|
|
return;
|
289 |
|
|
}
|
290 |
6c781c0c
|
djkim
|
string delItem_ID = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID;
|
291 |
0f065e57
|
ljiyeon
|
|
292 |
|
|
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolCompleted += BaseClient_DeleteSymbolCompleted;
|
293 |
|
|
Logger.sendReqLog("DeleteSymbolAsync: ", delItem_ID, 1);
|
294 |
498f0fc9
|
ljiyeon
|
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolAsync(delItem_ID, RadTab.SelectedIndex);
|
295 |
|
|
}
|
296 |
|
|
#endregion
|
297 |
|
|
#region Public Symbol Delete Event
|
298 |
|
|
private void Remove_Symbol_Public(object sender, RoutedEventArgs e)
|
299 |
|
|
{
|
300 |
|
|
if (lstSymbolPublic.SelectedItem == null)
|
301 |
|
|
{
|
302 |
|
|
DialogMessage_Alert("Please Select Symbol", "Alert");
|
303 |
|
|
return;
|
304 |
|
|
}
|
305 |
|
|
string delItem_ID = (lstSymbolPublic.SelectedItem as Symbol_Custom).ID;
|
306 |
|
|
|
307 |
|
|
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolCompleted += BaseClient_DeleteSymbolCompleted;
|
308 |
|
|
Logger.sendReqLog("DeleteSymbolAsync: ", delItem_ID, 1);
|
309 |
|
|
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolAsync(delItem_ID, RadTab.SelectedIndex);
|
310 |
6c781c0c
|
djkim
|
}
|
311 |
787a4489
|
KangIngu
|
|
312 |
6c781c0c
|
djkim
|
private void BaseClient_DeleteSymbolCompleted(object sender, ServiceDeepView.DeleteSymbolCompletedEventArgs e)
|
313 |
|
|
{
|
314 |
0f065e57
|
ljiyeon
|
Logger.sendResLog("DeleteSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1);
|
315 |
6c781c0c
|
djkim
|
DataBind();
|
316 |
5ce56a3a
|
KangIngu
|
}
|
317 |
|
|
#endregion
|
318 |
787a4489
|
KangIngu
|
|
319 |
702abd98
|
humkyung
|
/// <summary>
|
320 |
|
|
/// place symbol which has given id to original position which is created
|
321 |
|
|
/// </summary>
|
322 |
|
|
/// <date>2018.06.14</date>
|
323 |
|
|
/// <param name="id"></param>
|
324 |
|
|
private void PlaceSymbol(string id)
|
325 |
5ce56a3a
|
KangIngu
|
{
|
326 |
702abd98
|
humkyung
|
string Data_ = "";
|
327 |
787a4489
|
KangIngu
|
|
328 |
702abd98
|
humkyung
|
try
|
329 |
5ce56a3a
|
KangIngu
|
{
|
330 |
0f065e57
|
ljiyeon
|
Logger.sendReqLog("GetSymbolData: ", id + "," + RadTab.SelectedIndex, 1);
|
331 |
6c781c0c
|
djkim
|
Data_ = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetSymbolData(id, RadTab.SelectedIndex);
|
332 |
0f065e57
|
ljiyeon
|
if (Data_ != null || Data_ != "")
|
333 |
|
|
{
|
334 |
|
|
Logger.sendResLog("GetSymbolData", "TRUE", 1);
|
335 |
|
|
}
|
336 |
|
|
else
|
337 |
|
|
{
|
338 |
|
|
Logger.sendResLog("GetSymbolData", "FALSE", 1);
|
339 |
|
|
}
|
340 |
787a4489
|
KangIngu
|
|
341 |
5ce56a3a
|
KangIngu
|
if (Data_.Contains("|DZ|"))
|
342 |
|
|
{
|
343 |
|
|
List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
|
344 |
|
|
|
345 |
|
|
string[] delimiterChars = { "|DZ|" };
|
346 |
|
|
string[] data = Data_.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
|
347 |
|
|
|
348 |
c8e9b3e4
|
ljiyeon
|
foreach (string parse in data)
|
349 |
5ce56a3a
|
KangIngu
|
{
|
350 |
|
|
if (parse != "")
|
351 |
|
|
{
|
352 |
|
|
System.Windows.Controls.Control item = layer.markupParse_Paste(parse, ViewerDataModel.Instance.MarkupControls_USER);
|
353 |
|
|
(item as MarkupToPDF.Common.CommentUserInfo).CommentID = Events.Save.shortGuid();
|
354 |
c8e9b3e4
|
ljiyeon
|
(item as MarkupToPDF.Common.CommentUserInfo).SymbolID = id;
|
355 |
5ce56a3a
|
KangIngu
|
ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo);
|
356 |
|
|
ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo);
|
357 |
c8e9b3e4
|
ljiyeon
|
|
358 |
5ce56a3a
|
KangIngu
|
adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo);
|
359 |
|
|
}
|
360 |
|
|
}
|
361 |
|
|
Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet);
|
362 |
|
|
|
363 |
|
|
ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final);
|
364 |
|
|
}
|
365 |
|
|
}
|
366 |
702abd98
|
humkyung
|
catch(Exception ex)
|
367 |
|
|
{
|
368 |
|
|
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(ex.Message, "Error");
|
369 |
|
|
}
|
370 |
|
|
}
|
371 |
|
|
|
372 |
|
|
#region Symbol DoubleClick Event
|
373 |
|
|
private void Move_Symbol(object sender, MouseButtonEventArgs e)
|
374 |
|
|
{
|
375 |
16d13764
|
djkim
|
try
|
376 |
702abd98
|
humkyung
|
{
|
377 |
16d13764
|
djkim
|
Type type = e.OriginalSource.GetType();
|
378 |
|
|
string id = string.Empty;
|
379 |
|
|
if (type.Name == "Image")
|
380 |
|
|
{
|
381 |
|
|
id = ((e.OriginalSource as Image).DataContext as Symbol_Custom).ID;
|
382 |
|
|
}
|
383 |
|
|
else if (type.Name == "Border")
|
384 |
|
|
{
|
385 |
|
|
id = ((e.OriginalSource as Border).DataContext as Symbol_Custom).ID;
|
386 |
|
|
}
|
387 |
|
|
|
388 |
|
|
IsMouseDown = true;
|
389 |
|
|
if (e.ClickCount > 1)
|
390 |
|
|
{
|
391 |
|
|
this.PlaceSymbol(id);
|
392 |
|
|
}
|
393 |
702abd98
|
humkyung
|
}
|
394 |
16d13764
|
djkim
|
catch(Exception ex)
|
395 |
|
|
{
|
396 |
|
|
Logger.sendResLog("Move_Symbol", ex.Message, 0);
|
397 |
|
|
}
|
398 |
5ce56a3a
|
KangIngu
|
}
|
399 |
|
|
#endregion
|
400 |
|
|
|
401 |
498f0fc9
|
ljiyeon
|
#region Private Symbol Rename Event
|
402 |
5ce56a3a
|
KangIngu
|
private void Rename_Symbol(object sender, RoutedEventArgs e)
|
403 |
|
|
{
|
404 |
|
|
if (lstSymbolPrivate.SelectedItem == null)
|
405 |
787a4489
|
KangIngu
|
{
|
406 |
5ce56a3a
|
KangIngu
|
DialogMessage_Alert("Please Select Symbol", "Alert");
|
407 |
|
|
return;
|
408 |
787a4489
|
KangIngu
|
}
|
409 |
|
|
|
410 |
5ce56a3a
|
KangIngu
|
DialogParameters parameters = new DialogParameters()
|
411 |
787a4489
|
KangIngu
|
{
|
412 |
b9b01f8e
|
ljiyeon
|
Owner = Application.Current.MainWindow,
|
413 |
5ce56a3a
|
KangIngu
|
Closed = (obj, args) => this.MarkupReNamePromptClose("", args),
|
414 |
|
|
//DefaultPromptResultValue = "Custom State",
|
415 |
|
|
DefaultPromptResultValue = (lstSymbolPrivate.SelectedItem as Symbol_Custom).Name,
|
416 |
|
|
Content = "Name :",
|
417 |
|
|
Header = "Update Custom Symbol Name",
|
418 |
|
|
Theme = new VisualStudio2013Theme(),
|
419 |
|
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
420 |
|
|
};
|
421 |
|
|
RadWindow.Prompt(parameters);
|
422 |
787a4489
|
KangIngu
|
|
423 |
5ce56a3a
|
KangIngu
|
}
|
424 |
|
|
#endregion
|
425 |
787a4489
|
KangIngu
|
|
426 |
498f0fc9
|
ljiyeon
|
#region Public Symbol Rename Event
|
427 |
|
|
private void Rename_Symbol_Public(object sender, RoutedEventArgs e)
|
428 |
|
|
{
|
429 |
|
|
if (lstSymbolPublic.SelectedItem == null)
|
430 |
|
|
{
|
431 |
|
|
DialogMessage_Alert("Please Select Symbol", "Alert");
|
432 |
|
|
return;
|
433 |
|
|
}
|
434 |
|
|
|
435 |
|
|
DialogParameters parameters = new DialogParameters()
|
436 |
|
|
{
|
437 |
b9b01f8e
|
ljiyeon
|
Owner = Application.Current.MainWindow,
|
438 |
498f0fc9
|
ljiyeon
|
Closed = (obj, args) => this.MarkupReNamePromptClose("", args),
|
439 |
|
|
//DefaultPromptResultValue = "Custom State",
|
440 |
|
|
DefaultPromptResultValue = (lstSymbolPublic.SelectedItem as Symbol_Custom).Name,
|
441 |
|
|
Content = "Name :",
|
442 |
|
|
Header = "Update Custom Symbol Name",
|
443 |
|
|
Theme = new VisualStudio2013Theme(),
|
444 |
|
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
445 |
|
|
};
|
446 |
|
|
RadWindow.Prompt(parameters);
|
447 |
|
|
|
448 |
|
|
}
|
449 |
|
|
#endregion
|
450 |
5ce56a3a
|
KangIngu
|
#region Symbol Rename Close Event
|
451 |
|
|
private void MarkupReNamePromptClose(string data, WindowClosedEventArgs args)
|
452 |
|
|
{
|
453 |
|
|
if (args.DialogResult != null && args.DialogResult.Value)
|
454 |
|
|
{
|
455 |
498f0fc9
|
ljiyeon
|
if(RadTab.SelectedIndex == 0)
|
456 |
|
|
{
|
457 |
|
|
string _id = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID;
|
458 |
|
|
string _name = args.PromptResult;
|
459 |
|
|
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolCompleted += BaseClient_RenameSymbolCompleted;
|
460 |
|
|
Logger.sendReqLog("RenameSymbolAsync: ", _id + "," + _name, 1);
|
461 |
|
|
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolAsync(_id, _name, RadTab.SelectedIndex);
|
462 |
|
|
}
|
463 |
|
|
else
|
464 |
|
|
{
|
465 |
|
|
string _id = (lstSymbolPublic.SelectedItem as Symbol_Custom).ID;
|
466 |
|
|
string _name = args.PromptResult;
|
467 |
|
|
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolCompleted += BaseClient_RenameSymbolCompleted;
|
468 |
|
|
Logger.sendReqLog("RenameSymbolAsync: ", _id + "," + _name, 1);
|
469 |
|
|
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolAsync(_id, _name, RadTab.SelectedIndex);
|
470 |
|
|
}
|
471 |
787a4489
|
KangIngu
|
}
|
472 |
5ce56a3a
|
KangIngu
|
}
|
473 |
6c781c0c
|
djkim
|
|
474 |
|
|
private void BaseClient_RenameSymbolCompleted(object sender, ServiceDeepView.RenameSymbolCompletedEventArgs e)
|
475 |
|
|
{
|
476 |
0f065e57
|
ljiyeon
|
Logger.sendResLog("RenameSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1);
|
477 |
6c781c0c
|
djkim
|
DataBind();
|
478 |
|
|
}
|
479 |
5ce56a3a
|
KangIngu
|
#endregion
|
480 |
|
|
|
481 |
|
|
#region Wheel Event
|
482 |
|
|
private void lstSymbolPrivate_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
483 |
|
|
{
|
484 |
|
|
ScView.ScrollToVerticalOffset(ScView.ContentVerticalOffset - (e.Delta / 2));
|
485 |
|
|
}
|
486 |
|
|
private void lstSymbolPublic_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
487 |
|
|
{
|
488 |
|
|
ScView_Public.ScrollToVerticalOffset(ScView_Public.ContentVerticalOffset - (e.Delta / 2));
|
489 |
|
|
}
|
490 |
|
|
#endregion
|
491 |
|
|
|
492 |
|
|
#region Tab Selection Event
|
493 |
|
|
private void RadTabControl_PreviewSelectionChanged(object sender, RadSelectionChangedEventArgs e)
|
494 |
|
|
{
|
495 |
|
|
foreach (var item in (e.OriginalSource as RadTabControl).Items)
|
496 |
787a4489
|
KangIngu
|
{
|
497 |
5ce56a3a
|
KangIngu
|
(item as RadTabItem).FontWeight = FontWeights.Normal;
|
498 |
787a4489
|
KangIngu
|
}
|
499 |
5ce56a3a
|
KangIngu
|
((e.OriginalSource as RadTabControl).SelectedItem as RadTabItem).FontWeight = FontWeights.Bold;
|
500 |
|
|
}
|
501 |
|
|
#endregion
|
502 |
787a4489
|
KangIngu
|
|
503 |
5ce56a3a
|
KangIngu
|
#region Department Selection Event
|
504 |
|
|
private void deptlist_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
505 |
|
|
{
|
506 |
|
|
DataBind();
|
507 |
787a4489
|
KangIngu
|
}
|
508 |
5ce56a3a
|
KangIngu
|
#endregion
|
509 |
787a4489
|
KangIngu
|
|
510 |
5ce56a3a
|
KangIngu
|
#endregion
|
511 |
787a4489
|
KangIngu
|
|
512 |
5ce56a3a
|
KangIngu
|
private void lstSymbolPrivate_PreviewMouseUp(object sender, MouseButtonEventArgs e)
|
513 |
|
|
{
|
514 |
|
|
|
515 |
|
|
}
|
516 |
|
|
|
517 |
|
|
private void lstSymbolPrivate_MouseLeave(object sender, MouseEventArgs e)
|
518 |
|
|
{
|
519 |
|
|
|
520 |
|
|
}
|
521 |
|
|
|
522 |
|
|
private void lstSymbolPrivate_MouseDown(object sender, MouseButtonEventArgs e)
|
523 |
787a4489
|
KangIngu
|
{
|
524 |
|
|
|
525 |
|
|
}
|
526 |
|
|
|
527 |
5ce56a3a
|
KangIngu
|
private void StackPanel_MouseLeave(object sender, MouseEventArgs e)
|
528 |
787a4489
|
KangIngu
|
{
|
529 |
5ce56a3a
|
KangIngu
|
if(IsMouseDown && e.LeftButton == MouseButtonState.Pressed)
|
530 |
|
|
{
|
531 |
|
|
ViewerDataModel.Instance.SystemMain.dzMainMenu.Symbol_ID = moveItem_id;
|
532 |
|
|
}
|
533 |
|
|
else
|
534 |
|
|
{
|
535 |
|
|
IsMouseDown = false;
|
536 |
|
|
}
|
537 |
|
|
}
|
538 |
787a4489
|
KangIngu
|
|
539 |
5ce56a3a
|
KangIngu
|
private void StackPanel_MouseUp(object sender, MouseButtonEventArgs e)
|
540 |
|
|
{
|
541 |
|
|
IsMouseDown = false;
|
542 |
787a4489
|
KangIngu
|
}
|
543 |
702abd98
|
humkyung
|
|
544 |
|
|
/// <summary>
|
545 |
|
|
/// place symbol which user select
|
546 |
|
|
/// </summary>
|
547 |
|
|
/// <author>humkyung</author>
|
548 |
|
|
/// <date>2018.06.14</date>
|
549 |
|
|
/// <param name="sender"></param>
|
550 |
|
|
/// <param name="e"></param>
|
551 |
|
|
private void Place_Symbol(object sender, RoutedEventArgs e)
|
552 |
|
|
{
|
553 |
|
|
if (lstSymbolPrivate.SelectedItem == null)
|
554 |
|
|
{
|
555 |
|
|
DialogMessage_Alert("Please Select Symbol", "Alert");
|
556 |
|
|
return;
|
557 |
|
|
}
|
558 |
|
|
|
559 |
|
|
string id = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID;
|
560 |
|
|
this.PlaceSymbol(id);
|
561 |
|
|
}
|
562 |
ffcc8124
|
ljiyeon
|
|
563 |
|
|
private void Place_Symbol_Public(object sender, RoutedEventArgs e)
|
564 |
|
|
{
|
565 |
|
|
if (lstSymbolPublic.SelectedItem == null)
|
566 |
|
|
{
|
567 |
|
|
DialogMessage_Alert("Please Select Symbol", "Alert");
|
568 |
|
|
return;
|
569 |
|
|
}
|
570 |
|
|
|
571 |
|
|
string id = (lstSymbolPublic.SelectedItem as Symbol_Custom).ID;
|
572 |
|
|
this.PlaceSymbol(id);
|
573 |
|
|
}
|
574 |
787a4489
|
KangIngu
|
}
|
575 |
|
|
} |