프로젝트

일반

사용자정보

개정판 cdfb57ff

IDcdfb57ff4780f16447f02fb0203c397a3732c3cd
상위 dbc1e5b6
하위 96c13fad

김태성이(가) 5년 이상 전에 추가함

zoom control 이벤트 추가
mainmenu 수정
app 수정

Change-Id: I0d007c3a3c412b7fbe6e2a52bafb932e1a7b9f03

차이점 보기:

CommonLib/DNSHelper.cs
29 29
            }
30 30
            return null;
31 31
        }
32

  
33
        public static async Task<IPHostEntry> GetHostEntryAsync()
34
        {
35
            IPHostEntry result = null;
36

  
37
            try
38
            {
39
                var ipaddress = CommonLib.DNSHelper.GetDnsAdress();
40

  
41
                await Task.Factory.StartNew(() =>
42
                {
43
                    result = Dns.GetHostEntry(ipaddress);
44
                });
45
            }
46
            catch (Exception ex)
47
            {
48
                System.Diagnostics.Debug.WriteLine(ex.ToString());
49
            }
50

  
51
            return result;
52
        }
53

  
54
        public static IPHostEntry GetHostEntryTask()
55
        {
56
            IPHostEntry result = null;
57

  
58
            try
59
            {
60
                var ipaddress = CommonLib.DNSHelper.GetDnsAdress();
61

  
62
                var task = Task.Factory.StartNew(() =>
63
                {
64
                    result = Dns.GetHostEntry(ipaddress);
65
                });
66

  
67
                task.Wait();
68
            }
69
            catch (Exception ex)
70
            {
71
                System.Diagnostics.Debug.WriteLine(ex.ToString());
72
            }
73

  
74
            return result;
75
        }
32 76
    }
33 77
}
ConvertService/ServiceBase/ConvertionWebService/Conversion.asmx.cs
76 76
            string _result = null;
77 77
            try
78 78
            {
79
                logger.Info($"Conversion Web Service ConvertRun call rev_No :{rev_No} document_No : {document_No}  document_Name : {document_Name}  group_No : {group_No}  prj_No : {prj_No}  document_Id : {document_Id}  document_Url : {document_Url}");
80

  
79 81
                using (DeepView_Entity deepViewEntity = new DeepView_Entity(ConnectStringBuilder.DeepViewConnectionString().ToString()))
80 82
                {
81 83
                    //_result = ConnectStringBuilder.DeepViewConnectionString().ToString();
......
95 97
            }
96 98
            catch (Exception ex)
97 99
            {
98
                logger.Error("Conversion Web Service ConvertRun Error", ex);
100
                logger.Error($"Conversion Web Service ConvertRun Error rev_No :{rev_No} document_No : {document_No}  document_Name : {document_Name}  group_No : {group_No}  prj_No : {prj_No}  document_Id : {document_Id}  document_Url : {document_Url}", ex);
99 101
                _result = ex.Message.ToString();
100 102
                SendNotice("Project NO : " + prj_No + "\r\n  DocumentUrl : " + document_Url + "\r\n Error" + ex.ToString());
101 103
            }
......
217 219
            }
218 220
            catch (Exception ex)
219 221
            {
220
                logger.Error("Conversion Web Service UpdateSlip Error", ex);
222
                logger.Error($"Conversion Web Service UpdateSlip Error EnsembleId : {EnsembleId} SlipNo : {SlipNo}   slipLink: {slipLink}", ex);
221 223
                _result = ex.Message.ToString();                
222 224
            }
223 225
            return _result;
ConvertService/ServiceBase/ConvertionWebService/ConvertionWebService.csproj
97 97
  </ItemGroup>
98 98
  <ItemGroup>
99 99
    <Content Include="Conversion.asmx" />
100
    <Content Include="..\Markus.Service.Station\Log.config">
100
    <None Include="..\Markus.Service.Station\Log.config">
101 101
      <Link>Log.config</Link>
102
    </Content>
102
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
103
    </None>
103 104
    <None Include="DeepViewDataModel.dll.config">
104 105
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
105 106
    </None>
ConvertService/ServiceBase/Markus.Service.DataBase/MarkusEntities.cs
15 15
        public MarkusEntities(string ConnectionString)
16 16
            : base(ConnectionStringBuilder(ConnectionString).ToString())
17 17
        {
18
            this.Database.CommandTimeout = 300;
18 19
        }
20

  
19 21
        private static EntityConnectionStringBuilder ConnectionStringBuilder(string ConnectionString)
20 22
        {
21 23
            //SqlConnectionStringBuilder _bl = new SqlConnectionStringBuilder(string.Format(Properties.Settings.Default.ProjectCIConnectionString, "DeepView"));
ConvertService/ServiceBase/Markus.Service.Station/StationService/ServiceStationWCF.cs
140 140
                {
141 141
                    try
142 142
                    {
143
                        if (ServiceStation.AliveConvertQueue.Count() < MultiProcessCount)
143
                        if (AliveConvertQueue.Count(c => c.UniqueKey == convertItem.UniqueKey) == 0)
144
                        {
145
                            if (ServiceStation.AliveConvertQueue.Count() < MultiProcessCount)
146
                            {
147
                                ConvertProcessStart(convertItem);
148
                                result = true.ToString();
149
                            }
150
                        }
151
                        else
144 152
                        {
145
                            ConvertProcessStart(convertItem);
146 153
                            result = true.ToString();
147 154
                        }
148 155
                    }
KCOM.sln
29 29
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonLib", "CommonLib\CommonLib.csproj", "{DEF47FC2-B898-4C92-AD8D-D7B9E994495E}"
30 30
EndProject
31 31
Global
32
	GlobalSection(Performance) = preSolution
33
		HasPerformanceSessions = true
34
	EndGlobalSection
32 35
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
33 36
		Debug|Any CPU = Debug|Any CPU
34 37
		Debug|x64 = Debug|x64
KCOM/App.xaml.cs
92 92
        private string versionPath = null;
93 93
        //public SplashScreen splash = new SplashScreen("splash.png");
94 94
        public static SplashScreenWindow splashScreen = new SplashScreenWindow();
95
        protected override void OnStartup(StartupEventArgs e)
96
        {          
95

  
96
        public App()
97
        {
98
           
99
        }
100

  
101
        protected override async void OnStartup(StartupEventArgs e)
102
        {
103
          
97 104
            try
98 105
            {
99 106
                splashScreen.Show();
......
172 179

  
173 180
                string sBaseServiceURL = string.Empty;//CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "");
174 181
                string localdomain = CommonLib.Common.GetConfigString("HOST_DOMAIN", "DOMAIN", "");
175
                var ipaddress = CommonLib.DNSHelper.GetDnsAdress();
176 182

  
177
                try
178
                {
179
                    var hostName = Dns.GetHostEntry(ipaddress).HostName;
183
                var hostEntry = CommonLib.DNSHelper.GetHostEntryTask();
180 184

  
181
                    if (!hostName.EndsWith(localdomain))
182
                    {
183
                        // 외부 사용자
184
                        isExternal = true;                        
185
                    }
186
                }
187
                catch (Exception ex)
185
                if (hostEntry == null || !hostEntry.HostName.EndsWith(localdomain))
188 186
                {
189
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
187
                    // 외부 사용자
188
                    isExternal = true;
190 189
                }
191 190
#if DEBUG
192 191
                //sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
193
                sBaseServiceURL = CommonLib.Common.GetConfigString("Debug_BaseClientAddress", "URL", "",isExternal);
192
                sBaseServiceURL = CommonLib.Common.GetConfigString("Debug_BaseClientAddress", "URL", "", isExternal);
194 193
#else
195
                sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
194
                sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", IsExternal);
196 195
#endif
197
                                
196

  
198 197
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL));
199
               
200
                Task.Factory.StartNew(() =>
201
                {
202
                    int value = 100 / ISplashMessage.SplashMessageCnt;
203
                    for (int i = 1; i <= ISplashMessage.SplashMessageCnt; i++)
204
                    {
205
                        System.Threading.Thread.Sleep(3);
206
                        splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i * value);
207
                    }
208 198

  
209
                    this.Dispatcher.Invoke(() =>
210
                    {
211
                        base.OnStartup(e);
212
                        splashScreen.Close();
213
                    });
214
                });                
199
                await SplashScreenAsnyc();
200
                base.OnStartup(e);
201

  
202
                //this.MainWindow = new MainWindow();
203

  
215 204
            }
216 205
            catch (Exception ex)
217 206
            {
......
219 208
            }
220 209
            finally
221 210
            {
222
                Task.Factory.StartNew(() =>
223
                {
224
                    int value = 100 / ISplashMessage.SplashMessageCnt;
225
                    for (int i = 1; i < ISplashMessage.SplashMessageCnt; i++)
226
                    {
227
                        System.Threading.Thread.Sleep(3);                        
228
                        splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i * value);                   
229
                    }
230
                    this.Dispatcher.Invoke(() =>
231
                    {
232
                        //base.OnStartup(e);
233
                        splashScreen.Close();
234
                    });
235
                });
211
                await SplashScreenAsnyc();
236 212
            }        
237 213
        }
238 214

  
215
        private async Task<bool> SplashScreenAsnyc()
216
        {
217
            int value = 100 / ISplashMessage.SplashMessageCnt;
218

  
219
            for (int i = 1; i < ISplashMessage.SplashMessageCnt; i++)
220
            {
221
                System.Threading.Thread.Sleep(3);
222
                await splashScreen.Dispatcher.InvokeAsync(() => splashScreen.Progress = i * value);
223
            }
224

  
225
            splashScreen.Close();
226

  
227
            return true;
228
        }
229

  
239 230
        public static void splashString(string text)
240 231
        {
241 232
            Task.Factory.StartNew(() =>
KCOM/Common/ImageSourceHelper.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Windows.Media;
7
using System.Windows.Media.Imaging;
8

  
9
namespace KCOM.Common
10
{
11
    public static class ImageSourceHelper
12
    {
13
        public static async System.Threading.Tasks.Task<BitmapImage> GetDownloadImageAsync( Uri uri, double pageWidth, double pageHeight)
14
        {
15
            System.Net.Http.HttpClient httpClient = null;
16
            System.IO.Stream responseStream = null;
17
            System.IO.MemoryStream memoryStream = null;
18
            BitmapImage image = null;
19

  
20
            try
21
            {
22
                using (httpClient = new System.Net.Http.HttpClient())
23
                {
24
                    using (responseStream = await httpClient.GetStreamAsync(uri))
25
                    {
26
                        using (memoryStream = new System.IO.MemoryStream())
27
                        {
28
                            System.Diagnostics.Debug.WriteLine("이미지 다운로드");
29

  
30
                            await responseStream.CopyToAsync(memoryStream);
31

  
32
                            image = new BitmapImage();
33
                            image.BeginInit();
34
                            image.CacheOption = BitmapCacheOption.OnLoad;
35
                            image.StreamSource = memoryStream;
36
                            image.DecodePixelWidth = (int)pageWidth;
37
                            image.DecodePixelHeight = (int)pageHeight;
38
                            image.EndInit();
39
                            image.Freeze();
40
                            return image;
41
                        }
42
                    }
43
                }
44
            }
45
            catch (Exception ex)
46
            {
47
                throw new Exception("Image Load Error ", ex);
48
            }
49
            finally
50
            {
51
                httpClient?.Dispose();
52
                responseStream?.Dispose();
53
                memoryStream?.Dispose();
54
                image = null;
55
            }
56
        }
57
    }
58
}
KCOM/Common/ThumbnailItem.cs
12 12
        {
13 13
            DisplayColorItems = new List<SetColorMarkupItem>();
14 14
        }
15

  
15 16
        public Uri ImageUri { get; set; }
17

  
16 18
        public List<SetColorMarkupItem> DisplayColorItems { get; set; }
17 19
        public int PageNumber { get; set; }
18 20
        public int Angle { get; set; }
......
20 22
        //강인구 추가
21 23
        public double Width { get; set; }
22 24
        public double Height { get; set; }
25

  
26
        /// <summary>
27
        /// 페이지 경로
28
        /// 2019.07.03 김태성 추가
29
        /// </summary>
30
        public Uri PageUri { get; set; }
23 31
    }
24 32

  
25 33
    //public class SetColorMarkupItem
KCOM/Common/ViewerDataModel.cs
1021 1021
            }
1022 1022
        }
1023 1023

  
1024
        private System.Windows.Media.Imaging.BitmapImage _ImageViewPath { get; set; }
1025
        public System.Windows.Media.Imaging.BitmapImage ImageViewPath
1024
        private System.Windows.Media.ImageSource _ImageViewPath { get; set; }
1025
        public System.Windows.Media.ImageSource ImageViewPath
1026 1026
        {
1027 1027
            get
1028 1028
            {
KCOM/Controls/PageNavigator.xaml.cs
162 162
                var _pageNo = page.PAGE_NUMBER;
163 163
                bool _addFlag = false;
164 164

  
165

  
165 166
                this._thumbnailItems.Add(new ThumbnailItem
166 167
                {
167 168
                    ImageUri = new Uri(uri.Replace("{PageNo}", _pageNo.ToString())),
KCOM/Controls/Sample.xaml.cs
542 542
                    this._thumbnailItems.Add(new ThumbnailItem
543 543
                    {
544 544
                        ImageUri = new Uri(uri.Replace("{PageNo}", _pageNo.ToString())),
545
                        PageUri = new Uri(uri.Replace("{PageNo}", _pageNo.ToString()).Replace("jpg","png")),
545 546
                        PageNumber = _pageNo,
546 547
                        Angle = page.PAGE_ANGLE,
547 548
                    });
KCOM/KCOM.csproj
15 15
    <NuGetPackageImportStamp>
16 16
    </NuGetPackageImportStamp>
17 17
    <TargetFrameworkProfile />
18
    <PublishUrl>publish\</PublishUrl>
19
    <Install>true</Install>
20
    <InstallFrom>Disk</InstallFrom>
21
    <UpdateEnabled>false</UpdateEnabled>
22
    <UpdateMode>Foreground</UpdateMode>
23
    <UpdateInterval>7</UpdateInterval>
24
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
25
    <UpdatePeriodically>false</UpdatePeriodically>
26
    <UpdateRequired>false</UpdateRequired>
27
    <MapFileExtensions>true</MapFileExtensions>
28
    <ApplicationRevision>0</ApplicationRevision>
29
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
30
    <IsWebBootstrapper>false</IsWebBootstrapper>
31
    <UseApplicationTrust>false</UseApplicationTrust>
32
    <BootstrapperEnabled>true</BootstrapperEnabled>
18 33
  </PropertyGroup>
19 34
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20 35
    <PlatformTarget>AnyCPU</PlatformTarget>
......
47 62
    <ErrorReport>prompt</ErrorReport>
48 63
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
49 64
    <Prefer32Bit>false</Prefer32Bit>
65
    <WarningLevel>3</WarningLevel>
50 66
  </PropertyGroup>
51 67
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
52 68
    <OutputPath>..\Setup\</OutputPath>
......
257 273
    <Compile Include="Common\Converter\SvgConverter.cs" />
258 274
    <Compile Include="Common\Converter\SvgImageConverter.cs" />
259 275
    <Compile Include="Common\FileStreamToBase64.cs" />
276
    <Compile Include="Common\ImageSourceHelper.cs" />
260 277
    <Compile Include="Common\ISplashMessage.cs" />
261 278
    <Compile Include="Common\SelectionSet.cs" />
262 279
    <Compile Include="Common\TempFile.cs" />
......
1299 1316
      <Name>ZoomAndPan</Name>
1300 1317
    </ProjectReference>
1301 1318
  </ItemGroup>
1319
  <ItemGroup>
1320
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
1321
      <Visible>False</Visible>
1322
      <ProductName>.NET Framework 3.5 SP1</ProductName>
1323
      <Install>false</Install>
1324
    </BootstrapperPackage>
1325
  </ItemGroup>
1302 1326
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1303 1327
  <Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
1304 1328
  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
KCOM/KCOM.csproj.user
3 3
  <PropertyGroup>
4 4
    <ReferencePath>C:\Users\Admin\Downloads\KCOM 2018-02-04(통합)\KCOM\x64\;C:\Users\Admin\Downloads\KCOM 2018-02-04(통합)\KCOM\x86\</ReferencePath>
5 5
    <ProjectView>ProjectFiles</ProjectView>
6
    <PublishUrlHistory>publish\</PublishUrlHistory>
7
    <InstallUrlHistory />
8
    <SupportUrlHistory />
9
    <UpdateUrlHistory />
10
    <BootstrapperUrlHistory />
11
    <ErrorReportUrlHistory />
12
    <FallbackCulture>ko-KR</FallbackCulture>
13
    <VerifyUploadedFiles>false</VerifyUploadedFiles>
6 14
  </PropertyGroup>
7 15
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
8 16
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMTQyIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOmZhbHNlLCJOZXdDb21tZW50UGVybWlzc2lvbiI6dHJ1ZSwiUHJvamVjdE5PIjoiMDAwMDAwIiwiVXNlcklEIjoiZG9mdGVjaCIsIk1vZGUiOjB9</StartArguments>
KCOM/Views/MainMenu.xaml
115 115
                                                              MouseMove="zoomAndPanControl_MouseMove"
116 116
                                                              MouseUp="zoomAndPanControl_MouseUp"
117 117
                                                              MouseLeave="zoomAndPanControl_MouseLeave"
118
                                                              ScaleChanged="ZoomAndPanControl_ScaleChanged"
118 119
                                                              MouseDoubleClick="zoomAndPanControl_MouseDoubleClick"
119 120
                                                              ContentScale="{Binding ContentScale, Mode=TwoWay, Source={x:Static common:ViewerDataModel.Instance}}"
120 121
                                                              ContentOffsetX="{Binding ContentOffsetX, Mode=TwoWay, Source={x:Static common:ViewerDataModel.Instance}}"
......
162 163
                                                <!--<MarkupToPDF:RectangleControl Height="200" HorizontalAlignment="Center" Name="rectangle2" StrokeColor="Black" VerticalAlignment="Top" Width="00" FillColor="Red"/>-->
163 164
                                            </InkCanvas>
164 165
                                            <!--강인구 추가-->
165
                                                <Image Panel.ZIndex="0" x:Name="mainPanel"
166
                                                   Source="{Binding ImageViewPath, Source={x:Static common:ViewerDataModel.Instance}}" 
167
                                                   Width="{Binding ImageViewWidth, Source={x:Static common:ViewerDataModel.Instance}}" 
168
                                                   Height="{Binding ImageViewHeight, Source={x:Static common:ViewerDataModel.Instance}}" >
169
                                            </Image>
170

  
171
                                            <Canvas x:Name="SelectLayer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="32766"/>
166
                                                    <Image Panel.ZIndex="0" x:Name="mainPanel" RenderOptions.BitmapScalingMode="HighQuality" RenderOptions.EdgeMode="Unspecified" RenderOptions.ClearTypeHint="Enabled"
167
                                                        Source="{Binding ImageViewPath,Mode=TwoWay,IsAsync=True, Source={x:Static common:ViewerDataModel.Instance}}" 
168
                                                           Width="{Binding ImageViewWidth,Mode=TwoWay, Source={x:Static common:ViewerDataModel.Instance}}"
169
                                                        Height="{Binding ImageViewHeight,Mode=TwoWay, Source={x:Static common:ViewerDataModel.Instance}}">
170
                                                    </Image>
171
                                                <Canvas x:Name="SelectLayer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="32766"/>
172 172
                                                <Border x:Name="dragSelectionBorder" Visibility="Collapsed"
173 173
                                                    BorderBrush="Blue"
174 174
                                                    BorderThickness="1"
KCOM/Views/MainMenu.xaml.cs
494 494
            //}
495 495
        }
496 496

  
497
        DispatcherTimer renderTesttimer;
498

  
497 499
        /// <summary>
498 500
        /// start page changing
499 501
        ///  - save controls if page is modified
......
501 503
        /// </summary>
502 504
        /// <param name="sender"></param>
503 505
        /// <param name="e"></param>
504
        private void pageNavigator_PageChanging(object sender, Controls.Sample.PageChangeEventArgs e)
506
        private async void pageNavigator_PageChanging(object sender, Controls.Sample.PageChangeEventArgs e)
505 507
        {
506 508
            CompareMode.IsChecked = false;
507 509
            var BalancePoint = ViewerDataModel.Instance.PageBalanceMode == true ? e.PageNumber + ViewerDataModel.Instance.PageBalanceNumber : e.PageNumber;
......
524 526

  
525 527
            ViewerDataModel.Instance.PageNumber = BalancePoint;
526 528

  
527
            string uri = "";
528
            if (userData.COMPANY != "EXT")
529
            {
530
                uri = String.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, (Convert.ToUInt32(_ViewInfo.DocumentItemID) / 100).ToString(), _ViewInfo.DocumentItemID, e.PageNumber);
531
            }
532
            else
533
            {
534
                uri = String.Format(CommonLib.Common.GetConfigString("subServerImageWebPath", "URL", "", App.isExternal), _ViewInfo.ProjectNO, _ViewInfo.DocumentItemID, e.PageNumber);
535
            }
536

  
537 529
            var pageWidth = Convert.ToDouble(e.CurrentPage.PAGE_WIDTH);
538 530
            var pageHeight = Convert.ToDouble(e.CurrentPage.PAGE_HEIGHT);
531
            var pageUri = pageNavigator.CurrentPage.PageUri;
532
            var contentScale = zoomAndPanControl.ContentScale;
539 533

  
540
            var defaultBitmapImage = new BitmapImage();
541
            defaultBitmapImage.BeginInit();
542
            defaultBitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
543
            defaultBitmapImage.CacheOption = BitmapCacheOption.OnLoad;
544
            defaultBitmapImage.UriSource = new Uri(uri);
545
            defaultBitmapImage.DecodePixelWidth = Convert.ToInt32(pageWidth );
546
            defaultBitmapImage.DecodePixelHeight = Convert.ToInt32(pageHeight);// * zoomAndPanControl.ContentScale
547
            defaultBitmapImage.EndInit();
534
            #region 이미지 로딩 수정
548 535

  
549
            ViewerDataModel.Instance.ImageViewPath = null;
550
            Logger.sendCheckLog("pageNavigator_PageChanging_BitmapImage Downloading", 1);
551
            if (defaultBitmapImage.IsDownloading)
552
            {
553
                Logger.sendCheckLog("pageNavigator_PageChanging_BitmapImage IsDownloading", 1);
554
                defaultBitmapImage.DownloadCompleted += (ex, arg) =>
555
                {                   
556
                    defaultBitmapImage.Freeze();                                        
557
                    ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage;
558
                    ViewerDataModel.Instance.ImageViewWidth = pageWidth;
559
                    ViewerDataModel.Instance.ImageViewHeight = pageHeight;
560
                    mainPanel.UpdateLayout();
561
                    this.pageNavigator.ChangePage(e.PageNumber); 
562
                    
563
                    //image dispose
564
                    defaultBitmapImage = null;
565
                    GC.Collect();
566
                };
567
            }
536
            ViewerDataModel.Instance.ImageViewPath = await ImageSourceHelper.GetDownloadImageAsync(pageUri, pageWidth * contentScale, pageHeight * contentScale);
568 537

  
569
            zoomAndPanCanvas.Width = Convert.ToDouble(e.CurrentPage.PAGE_WIDTH);
570
            zoomAndPanCanvas.Height = Convert.ToDouble(e.CurrentPage.PAGE_HEIGHT);
538
            ViewerDataModel.Instance.ImageViewWidth = pageWidth;
539
            ViewerDataModel.Instance.ImageViewHeight = pageHeight;
571 540

  
541
            zoomAndPanCanvas.Width = pageWidth;
542
            zoomAndPanCanvas.Height = pageHeight;
572 543

  
573
            Common.ViewerDataModel.Instance.ContentWidth = zoomAndPanCanvas.Width;
574
            Common.ViewerDataModel.Instance.ContentHeight = zoomAndPanCanvas.Height;
575
            inkBoard.Width = zoomAndPanCanvas.Width;
576
            inkBoard.Height = zoomAndPanCanvas.Height;
544
            Common.ViewerDataModel.Instance.ContentWidth = pageWidth;
545
            Common.ViewerDataModel.Instance.ContentHeight = pageHeight;
577 546

  
547
            inkBoard.Width = pageWidth;
548
            inkBoard.Height = pageHeight;
549

  
550
            #endregion
578 551

  
579 552
            if (!testPanel2.IsHidden)
580 553
            {
......
673 646
                tlSyncPageNum.Text = String.Format("Current Page : {0}", BalancePoint);
674 647
            }
675 648

  
649
            this.pageNavigator.ChangePage(e.PageNumber);
650
        }
651

  
652
        public async System.Threading.Tasks.Task<BitmapImage> GetDownloadImageAsync2(Uri uri,double pageWidth,double pageHeight)
653
        {
654
            BitmapImage defaultBitmapImage = new BitmapImage();
655

  
656
            using (System.Net.Http.HttpClient httpClient = new System.Net.Http.HttpClient())
657
            {
658
                using (var responseStream = await httpClient.GetStreamAsync(uri))
659
                {
660
                    using (var memoryStream = new System.IO.MemoryStream())
661
                    {
662
                        await responseStream.CopyToAsync(memoryStream);
663

  
664
                        defaultBitmapImage.BeginInit();
665
                        defaultBitmapImage.CacheOption = BitmapCacheOption.OnLoad;
666
                        defaultBitmapImage.StreamSource = memoryStream;
667
                        defaultBitmapImage.DecodePixelWidth = (int)(pageWidth * (zoomAndPanControl.ContentScale * 10));
668
                        defaultBitmapImage.DecodePixelHeight = (int)(pageHeight * (zoomAndPanControl.ContentScale * 10));
669
                        defaultBitmapImage.EndInit();
670
                        defaultBitmapImage.Freeze();
671
                    }
672
                }
673
            }
674
            //defaultBitmapImage.Dispatcher.Invoke(() => { 
675
            //    defaultBitmapImage.BeginInit();
676
            //    defaultBitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
677
            //    defaultBitmapImage.CacheOption = BitmapCacheOption.OnLoad;
678
            //    defaultBitmapImage.UriSource = uri;
679
            //    defaultBitmapImage.DecodePixelWidth = Convert.ToInt32(pageWidth);
680
            //    defaultBitmapImage.DecodePixelHeight = Convert.ToInt32(pageHeight);// * zoomAndPanControl.ContentScale
681
            //    defaultBitmapImage.EndInit();
682

  
683
            //    ViewerDataModel.Instance.ImageViewPath = null;
684
            //    Logger.sendCheckLog("pageNavigator_PageChanging_BitmapImage Downloading", 1);
685
            //    if (defaultBitmapImage.IsDownloading)
686
            //    {
687
            //        Logger.sendCheckLog("pageNavigator_PageChanging_BitmapImage IsDownloading", 1);
688
            //        defaultBitmapImage.DownloadCompleted += (ex, arg) =>
689
            //        {
690
            //            defaultBitmapImage.Freeze();
691
            //            ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage;
692
            //            ViewerDataModel.Instance.ImageViewWidth = pageWidth;
693
            //            ViewerDataModel.Instance.ImageViewHeight = pageHeight;
694

  
695
            //            //image dispose
696
            //            defaultBitmapImage = null;
697

  
698
            //            GC.Collect();
699
            //        };
700
            //    }
701
            //});
702

  
703
            System.Diagnostics.Debug.WriteLine("이미지 다운로드");
704
            return defaultBitmapImage;
676 705
        }
677 706

  
678 707
        /// <summary>
......
3623 3652
                            {
3624 3653
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3625 3654
                                //{
3626
                                    var _sign = GetUserSign.GetSign(App.ViewInfo.UserID, App.ViewInfo.ProjectNO);
3655
                                    var _sign = GetUserSign.GetSign(App.ViewInfo.UserID, App.ViewInfo.ProjectNO,App.isExternal);
3627 3656

  
3628 3657
                                    if (_sign == null)
3629 3658
                                    {
......
5242 5271
            e.Effects = DragDropEffects.None;
5243 5272
        }
5244 5273

  
5274
        private async void ZoomAndPanControl_ScaleChanged(object sender, RoutedEventArgs e)
5275
        {
5276
            var pageWidth = ViewerDataModel.Instance.ImageViewWidth;
5277
            var pageHeight = ViewerDataModel.Instance.ImageViewHeight;
5278
            var pageUri = pageNavigator.CurrentPage.PageUri;
5279
            var contentScale = zoomAndPanControl.ContentScale;
5280

  
5281
            ViewerDataModel.Instance.ImageViewPath = await ImageSourceHelper.GetDownloadImageAsync(pageUri, pageWidth * contentScale, pageHeight * contentScale);
5282
        }
5283

  
5245 5284
        private void thumbnailPanel_SizeChanged(object sender, SizeChangedEventArgs e)
5246 5285
        {
5247 5286
            CommonLib.Common.WriteConfigString("SetThumbnail", "WIDTH", thumbnailPanel.Width.ToString());
5248 5287
        }
5249 5288

  
5289

  
5250 5290
        /*
5251 5291
        private void zoomAndPanControl_Drop(object sender, DragEventArgs e)
5252 5292
        {
MarkupToPDF/Common/GetUserSign.cs
33 33
        /// <param name="UserID"></param>
34 34
        /// <param name="ProjectNo"></param>
35 35
        /// <returns></returns>
36
        public static string GetSign(string UserID, string ProjectNo)
36
        public static string GetSign(string UserID, string ProjectNo,bool isExternal= false)
37 37
        {
38 38
            BasicHttpBinding _binding;
39 39
            EndpointAddress _EndPoint;
......
48 48
            _binding.TextEncoding = System.Text.Encoding.UTF8;
49 49
            _binding.TransferMode = TransferMode.Buffered;
50 50

  
51
            string localdomain = CommonLib.Common.GetConfigString("HOST_DOMAIN", "DOMAIN", "");
52
            var ipaddress = CommonLib.DNSHelper.GetDnsAdress();
53
            bool isExternal = false;
54
            try
55
            {
56
                var hostName = Dns.GetHostEntry(ipaddress).HostName;
57

  
58
                if (!hostName.EndsWith(localdomain))
59
                {
60
                    // 외부 사용자
61
                    isExternal = true;
62
                }
63
            }
64
            catch (Exception ex)
65
            {
66
                System.Diagnostics.Debug.WriteLine(ex.ToString());
67
            }
68 51
            string sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
69 52
            //CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "");
70 53

  
ZoomAndPan/ZoomAndPanControl.cs
17 17
        /// </summary>
18 18
        private FrameworkElement content;
19 19

  
20
        public event RoutedEventHandler ScaleChanged;
20 21
        /// <summary>
21 22
        /// The transform that is applied to the content to scale it by 'ContentScale'
22 23
        /// </summary>
......
666 667
                c.scrollOwner.InvalidateScrollInfo();
667 668
            }
668 669

  
670
            if(c.ScaleChanged != null)
671
            {
672
                c.ScaleChanged(c, new RoutedEventArgs());
673
            }
674

  
669 675
        } 
670 676
        #endregion
671 677

  

내보내기 Unified diff

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