개정판 ccf944bb
fixed issue #664
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
345 | 345 |
private void MainMenu_Loaded(object sender, RoutedEventArgs e) |
346 | 346 |
{ |
347 | 347 |
if (App.ParameterMode) |
348 |
{ |
|
349 |
if (System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory + "ControlLog.xml")) //임시파일이 있는가? |
|
350 |
{ |
|
351 |
//this.pageNavigator.PageChanging += pageNavigator_PageChanging; |
|
352 |
this.pageNavigator.PageChanging += TempLoad; |
|
353 |
|
|
354 |
} |
|
355 |
else |
|
356 |
{ |
|
357 |
this.pageNavigator.PageChanging += pageNavigator_PageChanging; |
|
358 |
imageViewer_Compare = new Image(); |
|
359 |
|
|
360 |
layerControl.ProjectNo = App.ViewInfo.ProjectNO; |
|
361 |
ViewerDataModel.Instance.Capture_Opacity = 0; |
|
362 |
|
|
363 |
da.From = 0.8; |
|
364 |
da.To = 0; |
|
365 |
da.Duration = new Duration(TimeSpan.FromSeconds(1)); |
|
366 |
da.AutoReverse = true; |
|
367 |
da.RepeatBehavior = System.Windows.Media.Animation.RepeatBehavior.Forever; |
|
368 |
} |
|
369 |
} |
|
370 |
} |
|
371 |
|
|
372 |
//private void pageNavigator_PageChanging(object sender, Controls.Sample.PageChangeEventArgs e) |
|
373 |
private void TempLoad(object sender, Controls.Sample.PageChangeEventArgs e) |
|
374 |
{ |
|
375 |
MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl(); |
|
376 |
XmlDocument xdoc = new XmlDocument(); |
|
377 |
xdoc.Load(AppDomain.CurrentDomain.BaseDirectory + "ControlLog.xml"); // XML 데이타를 파일에서 로드 |
|
378 |
XmlNodeList nodes = xdoc.SelectNodes("/Root/CommentID"); // 특정 노드들을 필터링 |
|
379 |
|
|
380 |
int PageNumber = 0; |
|
381 |
|
|
382 |
foreach (XmlNode node in nodes) //파일안에 데이터가 있는가? |
|
383 |
{ |
|
384 |
string sCommentID = node.Attributes["Value"].Value; |
|
385 |
string ConvertData = node.SelectSingleNode("ConvertData").InnerText; |
|
386 |
string DATA_TYPE = node.SelectSingleNode("DATA_TYPE").InnerText; |
|
387 |
PageNumber = Convert.ToInt32(node.SelectSingleNode("PageNumber").InnerText); |
|
388 |
string MarkupInfoID = node.SelectSingleNode("MarkupInfoID").InnerText; |
|
389 |
|
|
390 |
layerControl.markupParseEx(ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", MarkupInfoID, sCommentID); |
|
391 |
} |
|
392 |
|
|
393 |
|
|
394 |
// ViewerDataModel.Instance.PageBalanceNumber = PageNumber; |
|
395 |
ViewerDataModel.Instance.PageNumber = ViewerDataModel.Instance.PageBalanceNumber = PageNumber; |
|
396 |
// BalancePoint = |
|
397 |
// BalancePoint = 2 |
|
398 |
var BalancePoint = pageNavigator.PageCount; |
|
399 |
|
|
400 |
/* |
|
401 |
if (BalancePoint < 1) |
|
402 |
{ |
|
403 |
BalancePoint = 1; |
|
404 |
ViewerDataModel.Instance.PageBalanceNumber = 0; |
|
405 |
} |
|
406 |
|
|
407 |
if (pageNavigator.PageCount < BalancePoint) |
|
348 | 408 |
{ |
349 |
this.pageNavigator.PageChanging += pageNavigator_PageChanging; |
|
350 |
imageViewer_Compare = new Image(); |
|
409 |
BalancePoint = pageNavigator.PageCount; |
|
410 |
ViewerDataModel.Instance.PageBalanceNumber = 0; |
|
411 |
} |
|
412 |
*/ |
|
413 |
|
|
414 |
string uri = ""; |
|
415 |
if (userData.COMPANY != "EXT") |
|
416 |
{ |
|
417 |
uri = String.Format(Properties.Settings.Default.mainServerImageWebPath, _ViewInfo.ProjectNO, (Convert.ToInt32(_ViewInfo.DocumentItemID) / 100).ToString(), _ViewInfo.DocumentItemID, PageNumber); |
|
418 |
} |
|
419 |
else |
|
420 |
{ |
|
421 |
uri = String.Format(Properties.Settings.Default.subServerImageWebPath, _ViewInfo.ProjectNO, _ViewInfo.DocumentItemID, PageNumber); |
|
422 |
} |
|
351 | 423 |
|
352 |
layerControl.ProjectNo = App.ViewInfo.ProjectNO; |
|
353 |
ViewerDataModel.Instance.Capture_Opacity = 0; |
|
424 |
var defaultBitmapImage = new BitmapImage(new Uri(uri)); |
|
425 |
|
|
426 |
ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage; |
|
427 |
ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth; |
|
428 |
ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight; |
|
354 | 429 |
|
355 |
da.From = 0.8; |
|
356 |
da.To = 0; |
|
357 |
da.Duration = new Duration(TimeSpan.FromSeconds(1)); |
|
358 |
da.AutoReverse = true; |
|
359 |
da.RepeatBehavior = System.Windows.Media.Animation.RepeatBehavior.Forever; |
|
430 |
if (defaultBitmapImage.IsDownloading) |
|
431 |
{ |
|
432 |
defaultBitmapImage.DownloadCompleted += (ex, arg) => |
|
433 |
{ |
|
434 |
ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage; |
|
435 |
ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth; |
|
436 |
ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight; |
|
437 |
}; |
|
360 | 438 |
} |
361 |
} |
|
439 |
|
|
440 |
zoomAndPanCanvas.Width = Convert.ToDouble(e.CurrentPage.PAGE_WIDTH); |
|
441 |
zoomAndPanCanvas.Height = Convert.ToDouble(e.CurrentPage.PAGE_HEIGHT); |
|
442 |
|
|
443 |
|
|
444 |
Common.ViewerDataModel.Instance.ContentWidth = zoomAndPanCanvas.Width; |
|
445 |
Common.ViewerDataModel.Instance.ContentHeight = zoomAndPanCanvas.Height; |
|
446 |
inkBoard.Width = zoomAndPanCanvas.Width; |
|
447 |
inkBoard.Height = zoomAndPanCanvas.Height; |
|
448 |
|
|
449 |
|
|
450 |
if (!testPanel2.IsHidden) |
|
451 |
{ |
|
452 |
//PDF모드일때 잠시 대기(강인구) |
|
453 |
if (IsSyncPDFMode) |
|
454 |
{ |
|
455 |
Get_FinalImage.Get_PdfImage get_PdfImage = new Get_FinalImage.Get_PdfImage(); |
|
456 |
var pdfpath = new BitmapImage(new Uri(get_PdfImage.Run(CurrentRev.TO_VENDOR, App.ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.PageNumber))); |
|
457 |
|
|
458 |
if (pdfpath.IsDownloading) |
|
459 |
{ |
|
460 |
pdfpath.DownloadCompleted += (ex, arg) => |
|
461 |
{ |
|
462 |
ViewerDataModel.Instance.ImageViewPath_C = pdfpath; |
|
463 |
ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth; |
|
464 |
ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight; |
|
465 |
zoomAndPanCanvas2.Width = pdfpath.PixelWidth; |
|
466 |
zoomAndPanCanvas2.Height = pdfpath.PixelHeight; |
|
467 |
}; |
|
468 |
} |
|
469 |
else |
|
470 |
{ |
|
471 |
ViewerDataModel.Instance.ImageViewPath_C = pdfpath; |
|
472 |
ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth; |
|
473 |
ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight; |
|
474 |
|
|
475 |
zoomAndPanCanvas2.Width = pdfpath.PixelWidth; |
|
476 |
zoomAndPanCanvas2.Height = pdfpath.PixelHeight; |
|
477 |
} |
|
478 |
} |
|
479 |
else |
|
480 |
{ |
|
481 |
string uri2 = ""; |
|
482 |
if (userData.COMPANY != "EXT") |
|
483 |
{ |
|
484 |
uri2 = String.Format(Properties.Settings.Default.mainServerImageWebPath, _ViewInfo.ProjectNO, (Convert.ToInt32(CurrentRev.DOCUMENT_ID) / 100).ToString(), CurrentRev.DOCUMENT_ID, BalancePoint); |
|
485 |
} |
|
486 |
else |
|
487 |
{ |
|
488 |
uri2 = String.Format(Properties.Settings.Default.subServerImageWebPath, _ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, BalancePoint); |
|
489 |
} |
|
490 |
|
|
491 |
|
|
492 |
var defaultBitmapImage_Compare = new BitmapImage(new Uri(uri2)); |
|
493 |
|
|
494 |
ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
|
495 |
ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
|
496 |
ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
|
497 |
zoomAndPanCanvas2.Width = defaultBitmapImage_Compare.PixelWidth; |
|
498 |
zoomAndPanCanvas2.Height = defaultBitmapImage_Compare.PixelHeight; |
|
499 |
|
|
500 |
zoomAndPanControl.ZoomTo(new Rect |
|
501 |
{ |
|
502 |
X = 0, |
|
503 |
Y = 0, |
|
504 |
Width = Math.Max(zoomAndPanCanvas.Width, zoomAndPanCanvas2.Width), |
|
505 |
Height = Math.Max(zoomAndPanCanvas.Height, zoomAndPanCanvas2.Height), |
|
506 |
}); |
|
507 |
|
|
508 |
if (defaultBitmapImage_Compare.IsDownloading) |
|
509 |
{ |
|
510 |
defaultBitmapImage_Compare.DownloadCompleted += (ex, arg) => |
|
511 |
{ |
|
512 |
|
|
513 |
ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare; |
|
514 |
ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth; |
|
515 |
ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight; |
|
516 |
|
|
517 |
zoomAndPanCanvas2.Width = defaultBitmapImage_Compare.PixelWidth; |
|
518 |
zoomAndPanCanvas2.Height = defaultBitmapImage_Compare.PixelHeight; |
|
519 |
|
|
520 |
zoomAndPanControl.ZoomTo(new Rect |
|
521 |
{ |
|
522 |
X = 0, |
|
523 |
Y = 0, |
|
524 |
Width = Math.Max(zoomAndPanCanvas.Width, zoomAndPanCanvas2.Width), |
|
525 |
Height = Math.Max(zoomAndPanCanvas.Height, zoomAndPanCanvas2.Height), |
|
526 |
}); |
|
527 |
}; |
|
528 |
} |
|
529 |
} |
|
530 |
tlSyncPageNum.Text = String.Format("Current Page : {0}", BalancePoint); |
|
531 |
} |
|
532 |
|
|
533 |
this.pageNavigator.SetNextPage(); |
|
534 |
|
|
535 |
|
|
536 |
|
|
537 |
} |
|
538 |
|
|
362 | 539 |
|
363 | 540 |
public void ReleaseAdorner() |
364 | 541 |
{ |
... | ... | |
4469 | 4646 |
} |
4470 | 4647 |
IsDrawing = true; |
4471 | 4648 |
|
4472 |
temp.AddTemp(currentControl); |
|
4649 |
temp.AddTemp(currentControl, pageNavigator.CurrentPage.PageNumber);
|
|
4473 | 4650 |
return; |
4474 | 4651 |
} |
4475 | 4652 |
default: |
... | ... | |
5399 | 5576 |
|
5400 | 5577 |
//List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); |
5401 | 5578 |
|
5402 |
temp.AddTemp(currentControl); |
|
5579 |
temp.AddTemp(currentControl, pageNavigator.CurrentPage.PageNumber);
|
|
5403 | 5580 |
} |
5404 | 5581 |
|
5405 | 5582 |
|
... | ... | |
5590 | 5767 |
foreach (var item in redo.Markup_List) |
5591 | 5768 |
{ |
5592 | 5769 |
ViewerDataModel.Instance.MarkupControls_USER.Add(item.Markup); |
5593 |
temp.AddTemp(item.Markup); |
|
5770 |
temp.AddTemp(item.Markup, pageNavigator.CurrentPage.PageNumber);
|
|
5594 | 5771 |
} |
5595 | 5772 |
} |
5596 | 5773 |
break; |
내보내기 Unified diff