프로젝트

일반

사용자정보

개정판 53880c83

ID53880c83defd8cc6468fd4130469156a289f4e62
상위 6472f348
하위 97e8ad04

이지연이(가) 5년 이상 전에 추가함

issue #886: Symbol legend 생성 작업 중....

차이점 보기:

KCOM/Events/Implementation/TopMenuEvent.cs
2 2
using KCOM.Common.Converter;
3 3
using KCOM.Controls;
4 4
using KCOM.Events;
5
using KCOMDataModel.DataModel;
5 6
using MarkupToPDF.Common;
7
using Svg2Xaml;
6 8
using System;
7 9
using System.Collections.Generic;
8 10
using System.Linq;
......
11 13
using System.Windows.Controls;
12 14
using System.Windows.Input;
13 15
using System.Windows.Media;
16
using System.Windows.Media.Imaging;
14 17
using Telerik.Windows.Controls;
15 18

  
16 19
namespace KCOM.Views
......
22 25
        public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; }
23 26
        public bool isClosed = true;
24 27
        public RadWindow CheckPop;
28
        public RadWindow OptionPop;
25 29
        public MarkupToPDF.Common.Undo_data UndoData;
26 30
        MarkupToPDF.Controls.Parsing.LayerControl.MarkupReturn markupReturn = new MarkupToPDF.Controls.Parsing.LayerControl.MarkupReturn();
27 31
        MarkupToPDF.Controls.Parsing.LayerControl layer = new MarkupToPDF.Controls.Parsing.LayerControl();
......
518 522
                save.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs);
519 523

  
520 524
            }
521
            catch (Exception ex)
525
            catch //(Exception ex)
522 526
            {
523 527
                this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("세이브 실패", "Alert");
524 528
            }
......
556 560
            }
557 561

  
558 562
            RadWindow PrintWindow = new RadWindow();
559
            IKCOM.MarkupInfoItem _result = null;
563
            //IKCOM.MarkupInfoItem _result = null;
560 564
            PrintWindow.Width = 850;
561 565
            PrintWindow.Height = 600;
562 566
            //PrintWindow.Width = 650;
......
1319 1323
        }
1320 1324
        
1321 1325

  
1322
        public event EventHandler<WindowClosedEventArgs> Closed;
1326
        //public event EventHandler<WindowClosedEventArgs> Closed;
1323 1327

  
1324 1328
        //private void CheckEvent(object sender, RoutedEventArgs e)
1325 1329
        //{
......
1419 1423
            }
1420 1424
        }
1421 1425

  
1426
        private void OptionPop_Closed(object sender, WindowClosedEventArgs e)
1427
        {
1428
            isClosed = true;
1429
            //this.ParentOfType<MainWindow>().dzMainMenu.PN_Navi.IsEnabled = true;
1430
            this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1431
            ViewerDataModel.Instance.Capture_Opacity = 0;
1432
        }
1433

  
1422 1434
        private void CheckPop_Closed(object sender, WindowClosedEventArgs e)
1423 1435
        {
1424 1436
            isClosed = true;
......
1690 1702
                    System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
1691 1703
                    byte[] data = br.ReadBytes((int)numByte);
1692 1704
                    br.Close();
1705
                    
1706
                    
1693 1707

  
1694 1708
                    instanceMain.dzMainMenu.filename = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data);
1695 1709
                    fStream.Close();
......
2148 2162
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2149 2163
                        break;
2150 2164
                    #endregion
2165
                    #region Grouping
2166
                    case "Group":
2167
                        var GrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2168
                        foreach (var togle in GrouptoggleList)
2169
                        {
2170
                            togle.IsChecked = false;
2171
                        }
2172

  
2173
                        if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2174
                        {
2175
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2176
                            this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2177
                        }
2178
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2179
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2180
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2181
                        if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면
2182
                        {
2183
                            this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert");
2184
                        }
2185
                        else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2186
                        {
2187
                            // string MarkupData = "";
2188
                            foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2189
                            {
2190
                                if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 2) // 얘가 2개 이상이여야 그룹가능 버튼도 막을거긴하지만 일단..
2191
                                {
2192
                                    //MARKUP_DATA_GROUP INSERT
2193
                                    MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP
2194
                                    {
2195
                                        SYMBOL_ID = null,//InnerItem.Symbol_ID
2196
                                        STATE = 0,
2197
                                    };
2198
                                    long group_id = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMarkupDataGroup(mARKUP_DATA_GROUP, App.ViewInfo.ProjectNO);
2199
                                    Logger.sendReqLog("AddMarkupDataGroup: ", "", 1);
2200
                                    if (group_id > 0)
2201
                                    {
2202
                                        foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2203
                                        {
2204
                                            if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2205
                                            {
2206
                                                //MARKUP_DATA UPDATE
2207
                                                //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, group_id, App.ViewInfo.ProjectNO);
2208
                                                //Logger.sendReqLog("UpdateMarkupData: ", "", 1);
2209
                                                ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = group_id;
2210
                                                ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2211
                                            }
2212
                                        }
2213
                                    }
2214
                                }
2215
                            }
2216
                        }
2217
                        break;
2218
                    case "UnGroup":
2219
                        var UnGrouptoggleList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2220
                        foreach (var togle in UnGrouptoggleList)
2221
                        {
2222
                            togle.IsChecked = false;
2223
                        }
2224
                        if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2225
                        {
2226
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2227
                            this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2228
                        }
2229
                        this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
2230
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
2231
                        instanceMain.dzMainMenu.isLeftMouseButtonDownOnWindow = false;
2232

  
2233
                        if (ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면
2234
                        {
2235
                            this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert("Please Select Controls", "Alert");
2236
                        }
2237
                        else//if (this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Count > 0)
2238
                        {
2239
                            // string MarkupData = "";
2240
                            foreach (var item in this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children)
2241
                            {
2242
                                if (item.GetType().Name == "AdornerFinal" && (item as AdornerFinal).MemberSet.Count >= 1) // 1개 이상 
2243
                                {
2244
                                    //MARKUP_DATA UPDATE
2245
                                    foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
2246
                                    {
2247
                                        if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2248
                                        {
2249
                                            long group_id = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault().Group_ID;
2250
                                            //MARKUP_DATA UPDATE
2251
                                            //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, 0, App.ViewInfo.ProjectNO);
2252
                                            //Logger.sendReqLog("UpdateMarkupData: ", "", 1);
2253
                                            ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = 0;
2254
                                            ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2255

  
2151 2256

  
2257
                                            //MARKUP_DATA_GROUP UPDATE
2258
                                            bool value = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupDataGroup(group_id, App.ViewInfo.ProjectNO);
2259
                                            Logger.sendReqLog("AddMarkupDataGroup: ", value.ToString(), 1);
2260
                                        }
2261
                                    }
2262
                                }
2263
                            }
2264
                        }
2265
                        break;
2266
                    #endregion
2267
                    #region Capture
2268
                    case "Capture":
2269
                        SyncInit();
2270
                        //   instanceToggle.IsChecked = false;
2271
                        var CaptureList = this.Parent.ChildrenOfType<RadRibbonToggleButton>();
2272
                        foreach (var togle in CaptureList)
2273
                        {
2274
                            togle.IsChecked = false;
2275
                        }
2276

  
2277
                        if (this.ParentOfType<MainWindow>().dzMainMenu.currentControl != null)
2278
                        {
2279
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(this.ParentOfType<MainWindow>().dzMainMenu.currentControl);
2280
                            this.ParentOfType<MainWindow>().dzMainMenu.currentControl = null;
2281
                        }
2282

  
2283
                        ViewerDataModel.Instance.SelectedControl = "ImgControl";
2284
                   //     ViewerDataModel.Instance.ControlTag = null;
2285
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
2286

  
2287
                        /*
2288
                        //캡쳐 하기 전에 코멘트 저장
2289
                        if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (Application.Current.MainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0)
2290
                        {
2291
                            var menu = (Application.Current.MainWindow as MainWindow).dzMainMenu;
2292
                            menu.ReleaseAdorner();
2293
                            if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
2294
                            {
2295
                                (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu);
2296
                            }
2297
                            else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
2298
                            {
2299

  
2300
                            }
2301
                            else
2302
                            {
2303
                                (Application.Current.MainWindow as MainWindow).dzTopMenu.RefactoryCommentReact(menu);
2304
                            }
2305
                        }*/
2306

  
2307
                        //Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).ID;
2308
                        //Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Image).DataContext as Customer).ID;
2309
                        //Common.ViewerDataModel.Instance.PageNumber = ((e.Source as Image).DataContext as Customer).PAGENUMBER;
2310
                        Application.Current.MainWindow.Focus();
2311
                        Common.ViewerDataModel.Instance.Capture_Opacity = 0.49;
2312
                        (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture;
2313
                        break;
2314
                    #endregion
2152 2315
                    default:
2153 2316
                        break;
2154 2317
                }
......
2168 2331
            }
2169 2332
        }
2170 2333

  
2334
        private void SyncInit()
2335
        {
2336
            try
2337
            {
2338
                if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden)
2339
                {
2340
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.testPanel2.IsHidden = true;
2341
                    ViewerDataModel.Instance.PageBalanceMode = false;
2342
                    ViewerDataModel.Instance.PageBalanceNumber = 0;
2343
                    ViewerDataModel.Instance.PageNumber = 0;
2344
                    ViewerDataModel.Instance.MarkupControls_Sync.Clear();
2345
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewRevMarkup.Visibility = Visibility.Collapsed;
2346
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.UserList.IsChecked = false;
2347
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.BalanceMode.IsChecked = false;
2348
                }
2349
            }
2350
            catch (Exception ex)
2351
            {
2352
                Logger.sendResLog("SyncInit", ex.Message, 0);
2353
            }
2354

  
2355
        }
2356

  
2171 2357
        private void cbAutoSave_Checked(object sender, RoutedEventArgs e)
2172 2358
        {            
2173 2359
            if (cbAutoSave.IsChecked == true)
......
2389 2575
                IntPtr hBitmap = bmp.GetHbitmap();
2390 2576
                System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
2391 2577
                Image img = new Image();
2392
                img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(filename));
2393

  
2394

  
2395

  
2396

  
2578
                //img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(filename));
2579
                if (filename.Contains(".svg"))
2580
                {
2581
                    byte[] imageData = null;
2582
                    DrawingImage image = null;
2583
                    using (System.Net.WebClient web = new System.Net.WebClient())
2584
                    {
2585
                        imageData = web.DownloadData(new Uri(filename));
2586
                        System.IO.Stream stream = new System.IO.MemoryStream(imageData);
2587
                        image = SvgReader.Load(stream);
2588
                    }
2589
                    img.Source = image;
2590
                }
2591
                else
2592
                {
2593
                    img.Source = new BitmapImage(new Uri(filename));
2594
                }
2397 2595

  
2398 2596
                var currentControl = new MarkupToPDF.Controls.Etc.ImgControl
2399 2597
                {
2400 2598
                    PointSet = new List<Point>(),
2401
                    FilePath = img.Source.ToString(),
2599
                    //FilePath = img.Source.ToString(),
2600
                    FilePath = filename,
2402 2601
                    ImageData = img.Source,
2403 2602
                    StartPoint = new Point(100, 100),
2404 2603
                    EndPoint = new Point(200, 200),

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)