개정판 53880c83
issue #886: Symbol legend 생성 작업 중....
KCOM/Controls/Symbol.xaml.cs | ||
---|---|---|
1 |
using KCOM.Common; |
|
1 |
using IKCOM; |
|
2 |
using KCOM.Common; |
|
2 | 3 |
using KCOM.Events; |
3 | 4 |
using KCOMDataModel.Common; |
4 | 5 |
using KCOMDataModel.DataModel; |
5 | 6 |
using MarkupToPDF.Common; |
7 |
using Svg2Xaml; |
|
6 | 8 |
using System; |
7 | 9 |
using System.Collections.Generic; |
10 |
using System.ComponentModel; |
|
8 | 11 |
using System.Linq; |
9 | 12 |
using System.Text; |
10 | 13 |
using System.Windows; |
... | ... | |
42 | 45 |
public Symbol() |
43 | 46 |
{ |
44 | 47 |
InitializeComponent(); |
45 |
|
|
46 |
RadDragAndDropManager.AddDragInfoHandler(lstSymbolPrivate, OnDragPrivateInfo); |
|
47 |
RadDragAndDropManager.AddDragQueryHandler(lstSymbolPrivate, OnDragPrivateQuery); |
|
48 |
RadDragAndDropManager.SetAllowDrag(lstSymbolPrivate, true); |
|
48 | ||
49 |
//RadDragAndDropManager.AddDragInfoHandler(lstSymbolPrivate, OnDragPrivateInfo);
|
|
50 |
//RadDragAndDropManager.AddDragQueryHandler(lstSymbolPrivate, OnDragPrivateQuery);
|
|
51 |
//RadDragAndDropManager.SetAllowDrag(lstSymbolPrivate, true);
|
|
49 | 52 | |
50 | 53 |
DataBind(); |
54 |
|
|
51 | 55 |
} |
52 | 56 | |
53 | 57 |
private void OnDragPrivateInfo(object sender, DragDropEventArgs e) |
... | ... | |
110 | 114 | |
111 | 115 |
List<SYMBOL_PUBLIC> symbol_Public; |
112 | 116 | |
113 |
|
|
117 | ||
114 | 118 |
if (deptlist.SelectedValue != null) |
115 | 119 |
{ |
116 | 120 |
symbol_Public = client.GetPublicSymbolList(deptlist.SelectedValue.ToString()); |
... | ... | |
174 | 178 |
return pngEncoder; |
175 | 179 | |
176 | 180 |
} |
177 |
catch (Exception ex) |
|
181 |
catch //(Exception ex)
|
|
178 | 182 |
{ |
179 | 183 |
return null; |
180 | 184 |
} |
... | ... | |
235 | 239 |
DialogParameters parameters = new DialogParameters() |
236 | 240 |
{ |
237 | 241 |
Owner = Application.Current.MainWindow, |
238 |
Closed = (obj, args) => this.MarkupNamePromptClose(MarkupData, args),
|
|
242 |
Closed = (obj, args) => this.MarkupNamePromptClose(MarkupData, args), |
|
239 | 243 |
DefaultPromptResultValue = "Custom State", |
240 | 244 |
Content = "Name :", |
241 | 245 |
Header = "Insert Custom Symbol Name", |
... | ... | |
251 | 255 |
#region Symbol Add Close Event |
252 | 256 |
private void MarkupNamePromptClose(string data, WindowClosedEventArgs args) |
253 | 257 |
{ |
254 |
Save save = new Save(); |
|
255 | ||
256 |
if (args.DialogResult.Value) |
|
258 |
if (args.PromptResult != null) |
|
257 | 259 |
{ |
258 |
PngBitmapEncoder _Encoder = symImage(data); |
|
260 |
if (args.DialogResult.Value) |
|
261 |
{ |
|
262 |
PngBitmapEncoder _Encoder = symImage(data); |
|
259 | 263 | |
260 |
System.IO.MemoryStream fs = new System.IO.MemoryStream(); |
|
261 |
_Encoder.Save(fs); |
|
262 |
System.Drawing.Image ImgOut = System.Drawing.Image.FromStream(fs); |
|
264 |
System.IO.MemoryStream fs = new System.IO.MemoryStream();
|
|
265 |
_Encoder.Save(fs);
|
|
266 |
System.Drawing.Image ImgOut = System.Drawing.Image.FromStream(fs);
|
|
263 | 267 | |
264 |
byte[] Img_byte = fs.ToArray(); |
|
268 |
byte[] Img_byte = fs.ToArray();
|
|
265 | 269 | |
266 |
kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload(); |
|
267 |
filename = fileUploader.Run(App.ViewInfo.ProjectNO, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, Save.shortGuid() + ".png", Img_byte); |
|
268 |
|
|
269 |
if(RadTab.SelectedIndex == 0) |
|
270 |
{ |
|
271 |
save.SymbolSave(args.PromptResult, filename, data); |
|
270 |
kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload(); |
|
271 |
filename = fileUploader.Run(App.ViewInfo.ProjectNO, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, Save.shortGuid() + ".png", Img_byte); |
|
272 | ||
273 |
if (RadTab.SelectedIndex == 0) |
|
274 |
{ |
|
275 |
SymbolSave(args.PromptResult, filename, data); |
|
276 |
} |
|
277 |
else |
|
278 |
{ |
|
279 |
SymbolSave_Public(args.PromptResult, filename, data, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.userData.DEPARTMENT); |
|
280 |
} |
|
281 | ||
282 |
DataBind(); |
|
272 | 283 |
} |
273 |
else |
|
284 |
} |
|
285 |
} |
|
286 |
#endregion |
|
287 | ||
288 |
public void SymbolSave(string Name, string Url, string Data) |
|
289 |
{ |
|
290 |
try |
|
291 |
{ |
|
292 |
SYMBOL_PRIVATE symbol_private = new SYMBOL_PRIVATE |
|
274 | 293 |
{ |
275 |
save.SymbolSave_Public(args.PromptResult, filename, data, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.userData.DEPARTMENT); |
|
276 |
} |
|
294 |
ID = Events.Save.shortGuid(), |
|
295 |
MEMBER_USER_ID = App.ViewInfo.UserID, |
|
296 |
NAME = Name, |
|
297 |
IMAGE_URL = Url, |
|
298 |
DATA = Data |
|
299 |
}; |
|
277 | 300 | |
278 |
DataBind(); |
|
301 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveSymbolCompleted += BaseClient_SaveSymbolCompleted; |
|
302 |
Logger.sendReqLog("SaveSymbolAsync: ", symbol_private.ID + "," + symbol_private.MEMBER_USER_ID + "," + symbol_private.NAME + "," + symbol_private.IMAGE_URL + "," + symbol_private.DATA, 1); |
|
303 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveSymbolAsync(symbol_private); |
|
304 |
} |
|
305 |
catch (Exception) |
|
306 |
{ |
|
307 |
throw; |
|
279 | 308 |
} |
280 | 309 |
} |
281 |
#endregion |
|
310 | ||
311 |
public void SymbolSave_Public(string Name, string Url, string Data, string Department) |
|
312 |
{ |
|
313 |
try |
|
314 |
{ |
|
315 |
SYMBOL_PUBLIC symbol_public = new SYMBOL_PUBLIC |
|
316 |
{ |
|
317 |
ID = Events.Save.shortGuid(), |
|
318 |
DEPARTMENT = Department, |
|
319 |
NAME = Name, |
|
320 |
IMAGE_URL = Url, |
|
321 |
DATA = Data |
|
322 |
}; |
|
323 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddPublicSymbolCompleted += BaseClient_AddPublicSymbolCompleted; |
|
324 |
Logger.sendReqLog("AddPublicSymbol: ", symbol_public.ID + "," + symbol_public.DEPARTMENT + "," + symbol_public.NAME + "," + symbol_public.IMAGE_URL + "," + symbol_public.DATA, 1); |
|
325 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddPublicSymbol(symbol_public); |
|
326 |
} |
|
327 |
catch (Exception) |
|
328 |
{ |
|
329 |
throw; |
|
330 |
} |
|
331 |
} |
|
332 | ||
333 |
private void BaseClient_AddPublicSymbolCompleted(object sender, ServiceDeepView.AddPublicSymbolCompletedEventArgs e) |
|
334 |
{ |
|
335 |
Logger.sendResLog("AddPublicSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
|
336 |
DataBind(); |
|
337 |
} |
|
338 | ||
339 |
private void BaseClient_SaveSymbolCompleted(object sender, ServiceDeepView.SaveSymbolCompletedEventArgs e) |
|
340 |
{ |
|
341 |
Logger.sendResLog("RenameSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
|
342 |
DataBind(); |
|
343 |
} |
|
282 | 344 | |
283 | 345 |
#region Private Symbol Delete Event |
284 | 346 |
private void Remove_Symbol(object sender, RoutedEventArgs e) |
... | ... | |
290 | 352 |
} |
291 | 353 |
string delItem_ID = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID; |
292 | 354 | |
293 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolCompleted += BaseClient_DeleteSymbolCompleted;
|
|
355 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolCompleted += BaseClient_DeleteSymbolCompleted; |
|
294 | 356 |
Logger.sendReqLog("DeleteSymbolAsync: ", delItem_ID, 1); |
295 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolAsync(delItem_ID, RadTab.SelectedIndex);
|
|
357 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolAsync(delItem_ID, RadTab.SelectedIndex); |
|
296 | 358 |
} |
297 | 359 |
#endregion |
298 | 360 |
#region Public Symbol Delete Event |
... | ... | |
340 | 402 |
Logger.sendResLog("GetSymbolData", "FALSE", 1); |
341 | 403 |
} |
342 | 404 | |
405 |
//MARKUP_DATA_GROUP INSERT |
|
406 |
MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP |
|
407 |
{ |
|
408 |
SYMBOL_ID = id,//InnerItem.Symbol_ID |
|
409 |
STATE = 0, |
|
410 |
}; |
|
411 |
long group_id = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMarkupDataGroup(mARKUP_DATA_GROUP, App.ViewInfo.ProjectNO); |
|
412 |
Logger.sendReqLog("AddMarkupDataGroup: ", "", 1); |
|
413 | ||
343 | 414 |
if (Data_.Contains("|DZ|")) |
344 | 415 |
{ |
345 | 416 |
List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
... | ... | |
367 | 438 |
System.Windows.Controls.Control item = layer.markupParse_Paste(parse, ViewerDataModel.Instance.MarkupControls_USER); |
368 | 439 |
(item as MarkupToPDF.Common.CommentUserInfo).CommentID = Events.Save.shortGuid(); |
369 | 440 |
(item as MarkupToPDF.Common.CommentUserInfo).SymbolID = id; |
441 |
(item as MarkupToPDF.Common.CommentUserInfo).GroupID = group_id; |
|
370 | 442 |
ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
371 | 443 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
372 |
|
|
444 | ||
373 | 445 |
adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo); |
374 | 446 | |
375 | 447 |
multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo); |
... | ... | |
382 | 454 | |
383 | 455 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
384 | 456 |
} |
457 |
else |
|
458 |
{ |
|
459 |
PlaceImageSymbol(id, group_id); |
|
460 |
} |
|
461 |
} |
|
462 |
catch (Exception ex) |
|
463 |
{ |
|
464 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(ex.Message, "Error"); |
|
465 |
} |
|
466 |
} |
|
467 | ||
468 |
private void PlaceImageSymbol(string id, long group_id) |
|
469 |
{ |
|
470 |
|
|
471 |
//canvasZoommovingMouseDownPoint |
|
472 |
string Data_ = ""; |
|
473 | ||
474 |
try |
|
475 |
{ |
|
476 |
Logger.sendReqLog("GetSymbolImageURL: ", id + "," + RadTab.SelectedIndex, 1); |
|
477 |
Data_ = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetSymbolImageURL(id, RadTab.SelectedIndex); |
|
478 |
if (Data_ != null || Data_ != "") |
|
479 |
{ |
|
480 |
Logger.sendResLog("GetSymbolImageURL", "TRUE", 1); |
|
481 |
} |
|
482 |
else |
|
483 |
{ |
|
484 |
Logger.sendResLog("GetSymbolImageURL", "FALSE", 1); |
|
485 |
} |
|
486 | ||
487 |
//MARKUP_DATA_GROUP INSERT |
|
488 |
MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP |
|
489 |
{ |
|
490 |
SYMBOL_ID = id,//InnerItem.Symbol_ID |
|
491 |
STATE = 0, |
|
492 |
}; |
|
493 |
//long group_id = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMarkupDataGroup(mARKUP_DATA_GROUP, App.ViewInfo.ProjectNO); |
|
494 |
//Logger.sendReqLog("AddMarkupDataGroup: ", "", 1); |
|
495 | ||
496 |
if (Data_ != null) |
|
497 |
{ |
|
498 |
Image img = new Image(); |
|
499 |
//img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(Data_)); |
|
500 |
if (Data_.Contains(".svg")) |
|
501 |
{ |
|
502 |
byte[] imageData = null; |
|
503 |
DrawingImage image = null; |
|
504 |
using (System.Net.WebClient web = new System.Net.WebClient()) |
|
505 |
{ |
|
506 |
imageData = web.DownloadData(new Uri(Data_)); |
|
507 |
System.IO.Stream stream = new System.IO.MemoryStream(imageData); |
|
508 |
image = SvgReader.Load(stream); |
|
509 |
} |
|
510 |
img.Source = image; |
|
511 |
} |
|
512 |
else |
|
513 |
{ |
|
514 |
img.Source = new BitmapImage(new Uri(Data_)); |
|
515 |
} |
|
516 | ||
517 |
var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
|
518 |
{ |
|
519 |
PointSet = new List<Point>(), |
|
520 |
FilePath = Data_, |
|
521 |
ImageData = img.Source, |
|
522 |
StartPoint = new Point(0, 0), |
|
523 |
EndPoint = new Point(img.Source.Width, img.Source.Height), |
|
524 |
TopRightPoint = new Point(img.Source.Width, 0), |
|
525 |
LeftBottomPoint = new Point(0, img.Source.Height) |
|
526 |
}; |
|
527 | ||
528 |
currentControl.PointSet = new List<Point> |
|
529 |
{ |
|
530 |
currentControl.StartPoint, |
|
531 |
currentControl.LeftBottomPoint, |
|
532 |
currentControl.EndPoint, |
|
533 |
currentControl.TopRightPoint, |
|
534 |
}; |
|
535 |
Multi_Undo_data multi_Undo_Data = new Multi_Undo_data(); |
|
536 |
UndoData = new Undo_data() |
|
537 |
{ |
|
538 |
IsUndo = false, |
|
539 |
Event = Event_Type.Create, |
|
540 |
EventTime = DateTime.Now, |
|
541 |
Markup_List = new List<Multi_Undo_data>() |
|
542 |
}; |
|
543 |
ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i => |
|
544 |
{ |
|
545 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
546 |
}); |
|
547 | ||
548 |
//multi_Undo_Data = dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
549 |
multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
550 |
UndoData.Markup_List.Add(multi_Undo_Data); |
|
551 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
|
552 | ||
553 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
554 |
currentControl.CommentID = Events.Save.shortGuid(); |
|
555 |
currentControl.SymbolID = id; |
|
556 |
currentControl.GroupID = group_id; |
|
557 |
currentControl.ApplyTemplate(); |
|
558 |
currentControl.SetImage(); |
|
559 | ||
560 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
561 |
Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
|
562 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final); |
|
563 | ||
564 |
// this.ParentOfType<MainWindow>().dzMainMenu.isLeftMouseButtonDownOnWindow = true; |
|
565 |
// final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY)); |
|
566 |
double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
|
567 |
double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
|
568 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY)); |
|
569 |
// move.control_Select(item, dragRect); |
|
570 |
ApplyDragSelectionRect(); |
|
571 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = MouseHandlingMode.DragSymbol; |
|
572 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseButtonDown = MouseButton.Left; |
|
573 |
this.ParentOfType<MainWindow>().dzMainMenu.symboldata(id, group_id, RadTab.SelectedIndex, Data_, img.Source); |
|
574 |
|
|
575 |
} |
|
385 | 576 |
} |
386 | 577 |
catch(Exception ex) |
387 | 578 |
{ |
388 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(ex.Message, "Error"); |
|
579 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(ex.Message, "Error"); |
|
580 |
} |
|
581 |
} |
|
582 | ||
583 |
public Multi_Undo_data multi_Undo_Data; |
|
584 |
private void ApplyDragSelectionRect() |
|
585 |
{ |
|
586 |
move = new Move(); |
|
587 |
multi_Undo_Data = new Multi_Undo_data(); |
|
588 | ||
589 |
UndoData = new Undo_data() |
|
590 |
{ |
|
591 |
IsUndo = false, |
|
592 |
Event = Event_Type.Select, |
|
593 |
EventTime = DateTime.Now, |
|
594 |
Markup_List = new List<Multi_Undo_data>() |
|
595 |
}; |
|
596 | ||
597 |
this.ParentOfType<MainWindow>().dzMainMenu.dragSelectionBorder.Visibility = Visibility.Collapsed; |
|
598 | ||
599 |
double x = Canvas.GetLeft(this.ParentOfType<MainWindow>().dzMainMenu.dragSelectionBorder); |
|
600 |
double y = Canvas.GetTop(this.ParentOfType<MainWindow>().dzMainMenu.dragSelectionBorder); |
|
601 |
double width = this.ParentOfType<MainWindow>().dzMainMenu.dragSelectionBorder.Width; |
|
602 |
double height = this.ParentOfType<MainWindow>().dzMainMenu.dragSelectionBorder.Height; |
|
603 |
Rect dragRect = new Rect(x, y, width, height); |
|
604 |
Boolean Flag = false; |
|
605 |
dragRect.Inflate(width / 10, height / 10); |
|
606 |
List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
|
607 |
var Items = ViewerDataModel.Instance.MarkupControls_USER.ToList(); |
|
608 | ||
609 |
dragRect = new Rect(x, y, width, height); |
|
610 |
dragRect.Inflate(width / 10, height / 10); |
|
611 | ||
612 |
//move.mousemode = MarkupToPDF.Controls.Common.MouseMode.Selecting; |
|
613 |
//move. |
|
614 |
foreach (var item in Items) |
|
615 |
{ |
|
616 |
Flag = move.control_Select(item, dragRect); |
|
617 | ||
618 |
if (Flag) |
|
619 |
{ |
|
620 |
adornerSet.Add(item); |
|
621 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(item); |
|
622 | ||
623 |
this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item); |
|
624 |
UndoData.Markup_List.Add(multi_Undo_Data); |
|
625 |
multi_Undo_Data = new Multi_Undo_data(); |
|
626 |
if (item.GroupID > 0) |
|
627 |
{ |
|
628 | ||
629 |
} |
|
630 |
} |
|
631 |
} |
|
632 |
if (adornerSet.Count > 0) |
|
633 |
{ |
|
634 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
635 |
{ |
|
636 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
637 |
}); |
|
638 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
|
639 | ||
640 |
Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet); |
|
641 |
this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Add(final); |
|
389 | 642 |
} |
390 | 643 |
} |
391 | 644 | |
645 |
private Move move; |
|
392 | 646 |
#region Symbol DoubleClick Event |
393 | 647 |
private void Move_Symbol(object sender, MouseButtonEventArgs e) |
394 | 648 |
{ |
... | ... | |
405 | 659 |
{ |
406 | 660 |
id = ((e.OriginalSource as Border).DataContext as Symbol_Custom).ID; |
407 | 661 |
} |
408 |
else if (type.Name == "TextBlock")
|
|
662 |
else if (type.Name == "TextBox")
|
|
409 | 663 |
{ |
410 |
id = ((e.OriginalSource as TextBlock).DataContext as Symbol_Custom).ID;
|
|
664 |
id = ((e.OriginalSource as TextBox).DataContext as Symbol_Custom).ID;
|
|
411 | 665 |
} |
412 | 666 | |
413 | 667 |
IsMouseDown = true; |
668 | ||
414 | 669 |
if (e.ClickCount > 1) |
415 | 670 |
{ |
416 | 671 |
this.PlaceSymbol(id); |
... | ... | |
419 | 674 |
catch(Exception ex) |
420 | 675 |
{ |
421 | 676 |
Logger.sendResLog("Move_Symbol", ex.Message, 0); |
422 |
}
|
|
677 |
} |
|
423 | 678 |
} |
424 | 679 |
#endregion |
425 | 680 | |
... | ... | |
492 | 747 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolCompleted += BaseClient_RenameSymbolCompleted; |
493 | 748 |
Logger.sendReqLog("RenameSymbolAsync: ", _id + "," + _name, 1); |
494 | 749 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolAsync(_id, _name, RadTab.SelectedIndex); |
495 |
}
|
|
750 |
} |
|
496 | 751 |
} |
497 | 752 |
} |
498 | 753 | |
... | ... | |
533 | 788 |
#endregion |
534 | 789 | |
535 | 790 |
#endregion |
536 | ||
791 |
|
|
537 | 792 |
private void lstSymbolPrivate_PreviewMouseUp(object sender, MouseButtonEventArgs e) |
538 | 793 |
{ |
539 | 794 | |
... | ... | |
548 | 803 |
{ |
549 | 804 | |
550 | 805 |
} |
551 | ||
806 |
|
|
552 | 807 |
private void StackPanel_MouseLeave(object sender, MouseEventArgs e) |
553 | 808 |
{ |
554 | 809 |
if(IsMouseDown && e.LeftButton == MouseButtonState.Pressed) |
... | ... | |
583 | 838 | |
584 | 839 |
string id = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID; |
585 | 840 |
this.PlaceSymbol(id); |
841 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
|
586 | 842 |
} |
587 | 843 | |
588 | 844 |
private void Place_Symbol_Public(object sender, RoutedEventArgs e) |
... | ... | |
595 | 851 | |
596 | 852 |
string id = (lstSymbolPublic.SelectedItem as Symbol_Custom).ID; |
597 | 853 |
this.PlaceSymbol(id); |
854 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None; |
|
855 |
} |
|
856 | ||
857 |
private void Image_Place_Register(object sender, RoutedEventArgs e) |
|
858 |
{ |
|
859 |
SyncInit(); |
|
860 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl; |
|
861 |
//캡쳐 하기 전에 코멘트 저장 |
|
862 |
if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (Application.Current.MainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0) |
|
863 |
{ |
|
864 |
var menu = (Application.Current.MainWindow as MainWindow).dzMainMenu; |
|
865 |
menu.ReleaseAdorner(); |
|
866 |
if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true) |
|
867 |
{ |
|
868 |
(Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
|
869 |
} |
|
870 |
else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID) |
|
871 |
{ |
|
872 | ||
873 |
} |
|
874 |
else |
|
875 |
{ |
|
876 |
(Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu); |
|
877 |
} |
|
878 |
} |
|
879 |
Application.Current.MainWindow.Focus(); |
|
880 |
Common.ViewerDataModel.Instance.Capture_Opacity = 0.49; |
|
881 |
(Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture; |
|
882 |
} |
|
883 | ||
884 | ||
885 |
private void SyncInit() |
|
886 |
{ |
|
887 |
try |
|
888 |
{ |
|
889 |
if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden) |
|
890 |
{ |
|
891 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden = true; |
|
892 |
ViewerDataModel.Instance.PageBalanceMode = false; |
|
893 |
ViewerDataModel.Instance.PageBalanceNumber = 0; |
|
894 |
ViewerDataModel.Instance.PageNumber = 0; |
|
895 |
ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
|
896 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewRevMarkup.Visibility = Visibility.Collapsed; |
|
897 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.UserList.IsChecked = false; |
|
898 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.BalanceMode.IsChecked = false; |
|
899 |
} |
|
900 |
} |
|
901 |
catch (Exception ex) |
|
902 |
{ |
|
903 |
Logger.sendResLog("SyncInit", ex.Message, 0); |
|
904 |
} |
|
905 |
} |
|
906 | ||
907 |
private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) |
|
908 |
{ |
|
909 |
var block = sender as TextBox; |
|
910 |
block.Focusable = true; |
|
911 |
|
|
912 |
} |
|
913 | ||
914 |
private void TextBlock_MouseEnter(object sender, MouseEventArgs e) |
|
915 |
{ |
|
916 |
var block = sender as TextBox; |
|
917 |
if (block != null) |
|
918 |
{ |
|
919 |
//block.Text = "Enter"; |
|
920 | ||
921 |
} |
|
922 |
} |
|
923 | ||
924 |
private void OnKeyDownHandler(object sender, KeyEventArgs e) |
|
925 |
{ |
|
926 |
if (e.Key == Key.Return) |
|
927 |
{ |
|
928 |
Type type = e.OriginalSource.GetType(); |
|
929 |
string id = string.Empty; |
|
930 |
Logger.sendResLog("Move_Symbol", type.Name, 0); |
|
931 |
if (type.Name == "Image") |
|
932 |
{ |
|
933 |
id = ((e.OriginalSource as Image).DataContext as Symbol_Custom).ID; |
|
934 |
} |
|
935 |
else if (type.Name == "Border") |
|
936 |
{ |
|
937 |
id = ((e.OriginalSource as Border).DataContext as Symbol_Custom).ID; |
|
938 |
} |
|
939 |
else if (type.Name == "TextBox") |
|
940 |
{ |
|
941 |
id = ((e.OriginalSource as TextBox).DataContext as Symbol_Custom).ID; |
|
942 |
} |
|
943 | ||
944 |
//((System.Windows.Controls.TextBox)sender).Text; |
|
945 | ||
946 |
if (RadTab.SelectedIndex == 0) |
|
947 |
{ |
|
948 |
//string _id = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID; |
|
949 |
string _name = ((System.Windows.Controls.TextBox)sender).Text; |
|
950 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolCompleted += BaseClient_RenameSymbolCompleted; |
|
951 |
Logger.sendReqLog("RenameSymbolAsync: ", id + "," + _name, 1); |
|
952 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolAsync(id, _name, RadTab.SelectedIndex); |
|
953 |
} |
|
954 |
else |
|
955 |
{ |
|
956 |
//string _id = (lstSymbolPublic.SelectedItem as Symbol_Custom).ID; |
|
957 |
string _name = ((System.Windows.Controls.TextBox)sender).Text; |
|
958 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolCompleted += BaseClient_RenameSymbolCompleted; |
|
959 |
Logger.sendReqLog("RenameSymbolAsync: ", id + "," + _name, 1); |
|
960 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolAsync(id, _name, RadTab.SelectedIndex); |
|
961 |
} |
|
962 |
|
|
963 |
} |
|
598 | 964 |
} |
599 | 965 |
} |
600 | 966 |
} |
내보내기 Unified diff