프로젝트

일반

사용자정보

개정판 264c9309

ID264c93096300b548f9242d2bf83788e7f038b4d9
상위 dcf3c985
하위 f4698e26, cbaa3c91

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

issue #660: Smart Updater 수정중

Change-Id: I573a5f58b4f34a4fddb68dc670aaf5c770cf5d07

차이점 보기:

IKCOM/Interface.cs
8 8

  
9 9
namespace IKCOM
10 10
{
11
    //강인구 추가
12 11
    public class Square
13 12
    {
14 13
        //0 = x, 1 = y
KCOM/App.xaml.cs
75 75
        
76 76
        public static RestSharp.RestClient BaseClient { get; set; }
77 77
        public static IKCOM.KCOM_SystemInfo SystemInfo { get; set; }
78
        
79

  
78 80
        private static OpenProperties ParamDecoding(string DecodingText, System.Text.Encoding oEncoding = null)
79 81
        {
80 82
            if (oEncoding == null)
......
156 158

  
157 159
                //App.ViewInfo.CreateFinalPDFPermission = false;
158 160
                //App.ViewInfo.NewCommentPermission = false;
159

  
160 161
                //GetQueryStringParameters();
161 162
                _binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
162 163
                _binding.MaxBufferSize = 2147483647;
......
187 188
                {
188 189
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
189 190
                }
190

  
191 191
#if DEBUG
192 192
                //sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
193 193
                sBaseServiceURL = CommonLib.Common.GetConfigString("Debug_BaseClientAddress", "URL", "",isExternal);
......
196 196
#endif
197 197
                                
198 198
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL));
199

  
200
                if (Environment.Is64BitProcess == true) //64 bit machine
201
                {
202
                    versionPath = CommonLib.Common.GetConfigString("UpdateVer64", "URL", "", isExternal);
203
                }
204
                else //32 bit machine
205
                {
206
                    versionPath = CommonLib.Common.GetConfigString("UpdateVer86", "URL", "", isExternal);
207
                }
208

  
209
                if (File.Exists(versionPath))
199
               
200
                Task.Factory.StartNew(() =>
210 201
                {
211
                    // 20180921 version.xml check로 변경
212
                    var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
213
                    try
202
                    int value = 100 / ISplashMessage.SplashMessageCnt;
203
                    for (int i = 1; i <= ISplashMessage.SplashMessageCnt; i++)
214 204
                    {
215
                        XmlDocument xdoc = new XmlDocument();
216
                        xdoc.Load(versionPath);
217
                        XmlNode node = xdoc.SelectSingleNode("/RootElement/version");
218

  
219
                        if (assemblyVersion != node.InnerText) // node.InnerText 가 null이면 catch로 빠짐
220
                        {
221
                            //if(MessageBox.Show("Ver. " + node.InnerText + " 업데이트가 있습니다.\r\nSmartUpdate를 실행합니다.", "MARKUS", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
222
                            //{
223
                            if (MessageBox.Show("Ver. " + node.InnerText, "MARKUS", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
224
                            {
225
                                UpdateCheck(e);
226
                            }
227
                            else
228
                            {
229
                                base.Shutdown();
230
                                //현재 실행되고 있는 자기 자신 프로세스의 정보 // 위에꺼랑 두개 다 써줄필요가 있는..가?
231
                                Process proc = Process.GetCurrentProcess();
232
                                proc.Kill();
233
                            }
234
                        }
235
                        else
236
                        {                           
237
                            // splash.Close(new TimeSpan(0, 0, 2));
238
                            Task.Factory.StartNew(() =>
239
                            {
240
                                int value = 100 / ISplashMessage.SplashMessageCnt;
241
                                for (int i = 1; i <= ISplashMessage.SplashMessageCnt ; i++)
242
                                {
243
                                    System.Threading.Thread.Sleep(3);
244
                                    splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i * value);
245
                                }
246
                                this.Dispatcher.Invoke(() =>
247
                                {
248
                                    base.OnStartup(e);
249
                                    splashScreen.Close();
250
                                });
251
                                
252
                            });
253
                        }
205
                        System.Threading.Thread.Sleep(3);
206
                        splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i * value);
254 207
                    }
255
                    catch (Exception ex) //2. 파일이 없거나 파일내에 version의 값이 없다면 KCOM 실행하기
208

  
209
                    this.Dispatcher.Invoke(() =>
256 210
                    {
257
                        ErrorLogFileWrite("KCOM//UpdateCheck ERR : " + ex);
258
                        
259
                        Task.Factory.StartNew(() =>
260
                        {
261
                            int value = 100 / ISplashMessage.SplashMessageCnt;
262
                            for (int i = 1; i <= ISplashMessage.SplashMessageCnt; i++)
263
                            {
264
                                System.Threading.Thread.Sleep(3);
265
                                splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i * value);                                
266
                            }
267
                            
268
                            this.Dispatcher.Invoke(() =>
269
                            {
270
                                base.OnStartup(e);
271
                                splashScreen.Close();
272
                            });
273
                        });
274
                    }                
275
                }
211
                        base.OnStartup(e);
212
                        splashScreen.Close();
213
                    });
214
                });                
276 215
            }
277 216
            catch (Exception ex)
278 217
            {
......
285 224
                    int value = 100 / ISplashMessage.SplashMessageCnt;
286 225
                    for (int i = 1; i < ISplashMessage.SplashMessageCnt; i++)
287 226
                    {
288
                        System.Threading.Thread.Sleep(3);
289
                        
290
                        splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i * value);
291

  
292
                        //App.                      
227
                        System.Threading.Thread.Sleep(3);                        
228
                        splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i * value);                   
293 229
                    }
294 230
                    this.Dispatcher.Invoke(() =>
295 231
                    {
......
297 233
                        splashScreen.Close();
298 234
                    });
299 235
                });
300
            }
301
        
236
            }        
302 237
        }
303 238

  
304 239
        public static void splashString(string text)
......
310 245
        }
311 246

  
312 247

  
313

  
314 248
        /// <summary>
315 249
        /// log unhandled exception
316 250
        /// </summary>
......
334 268
            }
335 269
        }
336 270

  
337
        protected void UpdateCheck(StartupEventArgs e)
338
        {          
339
            try
340
            {
341
                if (e.Args.Count() > 0)
342
                {
343
                    ProcessStartInfo proInfo = new ProcessStartInfo();
344
                    var FileName = AppDomain.CurrentDomain.BaseDirectory + "SmartUpdate.exe";
345
                    
346
                    Process.Start(FileName, e.Args[0]);
347

  
348
                    base.Shutdown();
349
                    //현재 실행되고 있는 자기 자신 프로세스의 정보 
350
                    Process proc = Process.GetCurrentProcess();
351
                    proc.Kill();
352
                }                    
353
            }
354
            catch(Exception ee)
355
            {
356
                ErrorLogFileWrite("KCOM//UpdateCheck ERR : " + ee);
357
            }            
358
        }
359

  
360 271
        private void ErrorLogFileWrite(string Err)
361 272
        {
362 273
            App.FileLogger.Debug(Err);
363
            /*
364
            try
365
            {
366
                string pathString = AppDataFolder + "\\Err";
367

  
368
                if (!File.Exists(pathString))
369
                {
370
                    Directory.CreateDirectory(pathString);
371
                }
372

  
373
                Err = Err + "   " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "\r\n";
374
                string path = pathString + "\\" + "Log_" + DateTime.Now.ToString("yyyy-MM-dd hh-mm") + ".txt";
375
                File.AppendAllText(path, Err);
376
            }
377
            catch (Exception er)
378
            {
379
                string strError = er.ToString();
380
            }
381
            */
382 274
        }
383 275
    }
384 276
}
KCOM/Connected Services/ServiceDeepView/Reference.cs
510 510
    [System.ServiceModel.ServiceContractAttribute(Namespace="", ConfigurationName="ServiceDeepView.ServiceDeepView")]
511 511
    public interface ServiceDeepView {
512 512
        
513
        [System.ServiceModel.OperationContractAttribute(Action="urn:ServiceDeepView/GetVersionData", ReplyAction="urn:ServiceDeepView/GetVersionDataResponse")]
514
        string GetVersionData(bool is64BitProcess, string markusVer);
515
        
516
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="urn:ServiceDeepView/GetVersionData", ReplyAction="urn:ServiceDeepView/GetVersionDataResponse")]
517
        System.IAsyncResult BeginGetVersionData(bool is64BitProcess, string markusVer, System.AsyncCallback callback, object asyncState);
518
        
519
        string EndGetVersionData(System.IAsyncResult result);
520
        
513 521
        [System.ServiceModel.OperationContractAttribute(Action="urn:ServiceDeepView/GetSystemData", ReplyAction="urn:ServiceDeepView/GetSystemDataResponse")]
514 522
        IKCOM.KCOM_SystemInfo GetSystemData();
515 523
        
......
1077 1085
    
1078 1086
    [System.Diagnostics.DebuggerStepThroughAttribute()]
1079 1087
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
1088
    public partial class GetVersionDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
1089
        
1090
        private object[] results;
1091
        
1092
        public GetVersionDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
1093
                base(exception, cancelled, userState) {
1094
            this.results = results;
1095
        }
1096
        
1097
        public string Result {
1098
            get {
1099
                base.RaiseExceptionIfNecessary();
1100
                return ((string)(this.results[0]));
1101
            }
1102
        }
1103
    }
1104
    
1105
    [System.Diagnostics.DebuggerStepThroughAttribute()]
1106
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
1080 1107
    public partial class GetSystemDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
1081 1108
        
1082 1109
        private object[] results;
......
2409 2436
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
2410 2437
    public partial class ServiceDeepViewClient : System.ServiceModel.ClientBase<KCOM.ServiceDeepView.ServiceDeepView>, KCOM.ServiceDeepView.ServiceDeepView {
2411 2438
        
2439
        private BeginOperationDelegate onBeginGetVersionDataDelegate;
2440
        
2441
        private EndOperationDelegate onEndGetVersionDataDelegate;
2442
        
2443
        private System.Threading.SendOrPostCallback onGetVersionDataCompletedDelegate;
2444
        
2412 2445
        private BeginOperationDelegate onBeginGetSystemDataDelegate;
2413 2446
        
2414 2447
        private EndOperationDelegate onEndGetSystemDataDelegate;
......
2848 2881
                base(binding, remoteAddress) {
2849 2882
        }
2850 2883
        
2884
        public event System.EventHandler<GetVersionDataCompletedEventArgs> GetVersionDataCompleted;
2885
        
2851 2886
        public event System.EventHandler<GetSystemDataCompletedEventArgs> GetSystemDataCompleted;
2852 2887
        
2853 2888
        public event System.EventHandler<GetFavoriteVPCompletedEventArgs> GetFavoriteVPCompleted;
......
2988 3023
        
2989 3024
        public event System.EventHandler<FinalPDF_GetPropertiesCompletedEventArgs> FinalPDF_GetPropertiesCompleted;
2990 3025
        
3026
        public string GetVersionData(bool is64BitProcess, string markusVer) {
3027
            return base.Channel.GetVersionData(is64BitProcess, markusVer);
3028
        }
3029
        
3030
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
3031
        public System.IAsyncResult BeginGetVersionData(bool is64BitProcess, string markusVer, System.AsyncCallback callback, object asyncState) {
3032
            return base.Channel.BeginGetVersionData(is64BitProcess, markusVer, callback, asyncState);
3033
        }
3034
        
3035
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
3036
        public string EndGetVersionData(System.IAsyncResult result) {
3037
            return base.Channel.EndGetVersionData(result);
3038
        }
3039
        
3040
        private System.IAsyncResult OnBeginGetVersionData(object[] inValues, System.AsyncCallback callback, object asyncState) {
3041
            bool is64BitProcess = ((bool)(inValues[0]));
3042
            string markusVer = ((string)(inValues[1]));
3043
            return this.BeginGetVersionData(is64BitProcess, markusVer, callback, asyncState);
3044
        }
3045
        
3046
        private object[] OnEndGetVersionData(System.IAsyncResult result) {
3047
            string retVal = this.EndGetVersionData(result);
3048
            return new object[] {
3049
                    retVal};
3050
        }
3051
        
3052
        private void OnGetVersionDataCompleted(object state) {
3053
            if ((this.GetVersionDataCompleted != null)) {
3054
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
3055
                this.GetVersionDataCompleted(this, new GetVersionDataCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
3056
            }
3057
        }
3058
        
3059
        public void GetVersionDataAsync(bool is64BitProcess, string markusVer) {
3060
            this.GetVersionDataAsync(is64BitProcess, markusVer, null);
3061
        }
3062
        
3063
        public void GetVersionDataAsync(bool is64BitProcess, string markusVer, object userState) {
3064
            if ((this.onBeginGetVersionDataDelegate == null)) {
3065
                this.onBeginGetVersionDataDelegate = new BeginOperationDelegate(this.OnBeginGetVersionData);
3066
            }
3067
            if ((this.onEndGetVersionDataDelegate == null)) {
3068
                this.onEndGetVersionDataDelegate = new EndOperationDelegate(this.OnEndGetVersionData);
3069
            }
3070
            if ((this.onGetVersionDataCompletedDelegate == null)) {
3071
                this.onGetVersionDataCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetVersionDataCompleted);
3072
            }
3073
            base.InvokeAsync(this.onBeginGetVersionDataDelegate, new object[] {
3074
                        is64BitProcess,
3075
                        markusVer}, this.onEndGetVersionDataDelegate, this.onGetVersionDataCompletedDelegate, userState);
3076
        }
3077
        
2991 3078
        public IKCOM.KCOM_SystemInfo GetSystemData() {
2992 3079
            return base.Channel.GetSystemData();
2993 3080
        }
KCOM/Connected Services/ServiceDeepView/ServiceDeepView.wsdl
13 13
      <xsd:import schemaLocation="http://localhost:13009/ServiceDeepView.svc?xsd=xsd8" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
14 14
    </xsd:schema>
15 15
  </wsdl:types>
16
  <wsdl:message name="ServiceDeepView_GetVersionData_InputMessage">
17
    <wsdl:part name="parameters" element="GetVersionData" />
18
  </wsdl:message>
19
  <wsdl:message name="ServiceDeepView_GetVersionData_OutputMessage">
20
    <wsdl:part name="parameters" element="GetVersionDataResponse" />
21
  </wsdl:message>
16 22
  <wsdl:message name="ServiceDeepView_GetSystemData_InputMessage">
17 23
    <wsdl:part name="parameters" element="GetSystemData" />
18 24
  </wsdl:message>
......
434 440
    <wsdl:part name="parameters" element="FinalPDF_GetPropertiesResponse" />
435 441
  </wsdl:message>
436 442
  <wsdl:portType name="ServiceDeepView">
443
    <wsdl:operation name="GetVersionData">
444
      <wsdl:input wsaw:Action="urn:ServiceDeepView/GetVersionData" message="ServiceDeepView_GetVersionData_InputMessage" />
445
      <wsdl:output wsaw:Action="urn:ServiceDeepView/GetVersionDataResponse" message="ServiceDeepView_GetVersionData_OutputMessage" />
446
    </wsdl:operation>
437 447
    <wsdl:operation name="GetSystemData">
438 448
      <wsdl:input wsaw:Action="urn:ServiceDeepView/GetSystemData" message="ServiceDeepView_GetSystemData_InputMessage" />
439 449
      <wsdl:output wsaw:Action="urn:ServiceDeepView/GetSystemDataResponse" message="ServiceDeepView_GetSystemData_OutputMessage" />
KCOM/Connected Services/ServiceDeepView/ServiceDeepView1.wsdl
4 4
  <wsdl:types />
5 5
  <wsdl:binding name="DeepViewPoint" type="ServiceDeepView">
6 6
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
7
    <wsdl:operation name="GetVersionData">
8
      <soap:operation soapAction="urn:ServiceDeepView/GetVersionData" style="document" />
9
      <wsdl:input>
10
        <soap:body use="literal" />
11
      </wsdl:input>
12
      <wsdl:output>
13
        <soap:body use="literal" />
14
      </wsdl:output>
15
    </wsdl:operation>
7 16
    <wsdl:operation name="GetSystemData">
8 17
      <soap:operation soapAction="urn:ServiceDeepView/GetSystemData" style="document" />
9 18
      <wsdl:input>
KCOM/Connected Services/ServiceDeepView/ServiceDeepView6.xsd
5 5
  <xs:import schemaLocation="http://localhost:13009/ServiceDeepView.svc?xsd=xsd6" namespace="http://schemas.datacontract.org/2004/07/System.Windows" />
6 6
  <xs:import schemaLocation="http://localhost:13009/ServiceDeepView.svc?xsd=xsd7" namespace="http://schemas.datacontract.org/2004/07/IFinalPDF" />
7 7
  <xs:import schemaLocation="http://localhost:13009/ServiceDeepView.svc?xsd=xsd8" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
8
  <xs:element name="GetVersionData">
9
    <xs:complexType>
10
      <xs:sequence>
11
        <xs:element minOccurs="0" name="is64BitProcess" type="xs:boolean" />
12
        <xs:element minOccurs="0" name="markusVer" nillable="true" type="xs:string" />
13
      </xs:sequence>
14
    </xs:complexType>
15
  </xs:element>
16
  <xs:element name="GetVersionDataResponse">
17
    <xs:complexType>
18
      <xs:sequence>
19
        <xs:element minOccurs="0" name="GetVersionDataResult" nillable="true" type="xs:string" />
20
      </xs:sequence>
21
    </xs:complexType>
22
  </xs:element>
8 23
  <xs:element name="GetSystemData">
9 24
    <xs:complexType>
10 25
      <xs:sequence />
KCOM/KCOM.csproj
90 90
    <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
91 91
      <HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
92 92
    </Reference>
93
    <Reference Include="MarkUsODAConvert">
93
    <Reference Include="MarkUsODAConvert, Version=1.9.3.12, Culture=neutral, processorArchitecture=AMD64">
94
      <SpecificVersion>False</SpecificVersion>
94 95
      <HintPath>..\packages\ODA\MarkUsODAConvert.dll</HintPath>
95 96
    </Reference>
96 97
    <Reference Include="Microsoft.AspNet.SignalR.Client">
......
641 642
    <None Include="Properties\app.manifest" />
642 643
    <None Include="Properties\DataSources\IKCOM.KCOM_SystemInfo.datasource" />
643 644
    <None Include="Properties\DataSources\IKCOM.MarkupInfoItem.datasource" />
645
    <None Include="Properties\DataSources\IKCOM.VersionInfo.datasource" />
644 646
    <None Include="Properties\DataSources\IKCOM.VPRevision.datasource" />
645 647
    <None Include="Properties\DataSources\KCOMDataModel.DataModel.CHECK_LIST.datasource" />
646 648
    <None Include="Properties\DataSources\KCOMDataModel.DataModel.CHECK_LIST_HISTORY.datasource" />
KCOM/MainWindow.xaml.cs
1 1
using KCOM.Common;
2
using KCOM.Views;
2 3
using KCOMDataModel;
3 4
using KCOMDataModel.DataModel;
4 5
using MarkupToPDF.Common;
......
7 8
using MarkupToPDF.Serialize.S_Control;
8 9
using System;
9 10
using System.Collections.Generic;
11
using System.ComponentModel;
12
using System.Diagnostics;
10 13
using System.IO;
11 14
using System.Linq;
15
using System.Net;
16
using System.Reflection;
12 17
using System.Runtime.InteropServices;
13 18
using System.Text;
19
using System.Threading;
20
using System.Threading.Tasks;
14 21
using System.Windows;
15 22
using System.Windows.Controls;
16 23
using System.Windows.Data;
......
38 45
            this.KeyDown += new KeyEventHandler(KeyEventDownAction);
39 46
            this.KeyUp += new KeyEventHandler(KeyEventUpAction);
40 47
            this.SourceInitialized += new EventHandler(win_SourceInitialized);
48
            this.Closed += MainWindow_Closed;
41 49
            
42 50
        }
43 51

  
......
168 176

  
169 177
        private void WindowDragEvent(object sender, MouseButtonEventArgs e)
170 178
        {
171
            if (e.ClickCount == 2)
179
            if(filename == null)
172 180
            {
173
                if ((ResizeMode == ResizeMode.CanResize) ||
174
                    (ResizeMode == ResizeMode.CanResizeWithGrip))
181
                if (e.ClickCount == 2)
175 182
                {
176
                    SwitchState();
183
                    if ((ResizeMode == ResizeMode.CanResize) ||
184
                        (ResizeMode == ResizeMode.CanResizeWithGrip))
185
                    {
186
                        SwitchState();
187
                    }
177 188
                }
178
            }
179
            else
180
            {
181
                if (WindowState == WindowState.Maximized)
189
                else
182 190
                {
183
                    restoreIfMove = true;
184
                }
191
                    if (WindowState == WindowState.Maximized)
192
                    {
193
                        restoreIfMove = true;
194
                    }
185 195

  
186
                this.DragMove();
187
            }
196
                    this.DragMove();
197
                }
198
            }            
188 199
        }
189 200

  
190 201
        private void WindowDragEventUp(object sender, MouseButtonEventArgs e)
......
337 348
                                RadWindow.Confirm(parameters);
338 349
                            }
339 350
                        }
340
                        this.Close();
351
                        
352
                        MainWindow_Close();
341 353
                    }
342 354
                    break;
343 355
            }
344 356
        }
345 357

  
358
        private void MainWindow_Closed(object sender, EventArgs e)
359
        {
360
            splashScreen.Close();
361
            ProcessStartInfo proInfo = new ProcessStartInfo();
362
            proInfo.FileName = AppDomain.CurrentDomain.BaseDirectory + filename;
363
            Process.Start(proInfo);
364
        }
365

  
366
        //파일 다운로드 상황을 반영(수정 필요)
367
        private void DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
368
        {
369

  
370
            if (i <= 100)
371
            {
372
                i++;
373
            }
374
            Thread.Sleep(3);
375
            splashScreen.Progress = i;
376
            splashScreen.Close();
377

  
378
            //splashScreen.Close();
379
        }
380
        private Thread theProgBarThread;
381
        string filename = null;
382
        int i = 1;
383

  
384

  
385
        public static SplashScreenWindow splashScreen = new SplashScreenWindow();
386
        private void MainWindow_Close()
387
        {
388
            try
389
            {
390
                string url = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetVersionData(Environment.Is64BitProcess, Assembly.GetExecutingAssembly().GetName().Version.ToString());
391
                if (!string.IsNullOrEmpty(url))
392
                {
393
                    if (MessageBox.Show("새로운 버전이 있습니다. \n업데이트 하시겠습니까?", "MARKUS", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
394
                    {
395
                        //splashScreen.splashText.Text = "  DownLoad...";                        
396

  
397
                        splashScreen.Show();
398
                        WebClient theDownloadThread = new WebClient();
399
                        //Uri url = new Uri(itemInfoList[i].FileName);
400
                        theDownloadThread.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged);
401
                        theDownloadThread.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
402
                        filename = System.IO.Path.GetFileName(url);
403

  
404
                        if (!File.Exists(TempFile.TempFolder))
405
                        {
406
                            Directory.CreateDirectory(TempFile.TempFolder);
407
                        }
408

  
409
                        theDownloadThread.DownloadFileAsync(new Uri(url), System.IO.Path.Combine(TempFile.TempFolder, filename));
410
                       
411
                    }
412
                    else
413
                    {
414
                        this.Close();
415
                    }
416
                }
417
                else
418
                {
419
                    this.Close();
420
                }
421

  
422
            }
423
            catch (Exception)
424
            {
425
                this.Close();
426
            }            
427
        }
428

  
429
        private void Completed(object sender, AsyncCompletedEventArgs e)
430
        {            
431
            try
432
            {
433
                this.Close();                
434
            }
435
            catch (Exception ee)
436
            {
437
            }       
438

  
439
        }
440

  
346 441
        private void Onclose(object sender, WindowClosedEventArgs e)
347 442
        {
348 443
            if (e.DialogResult == true)
KCOM/Views/SplashScreenWindow.xaml
9 9

  
10 10
    <Grid>
11 11

  
12
        <Image Source="/KCOM;component/Resources/Images/MenuImage_New/splash.png" VerticalAlignment="Top" HorizontalAlignment="Left"/>
12
        <Image Source="/KCOM;component/Resources/Images/MenuImage_New/splash.png" VerticalAlignment="Top" HorizontalAlignment="Left" x:Name="sImage"/>
13 13
        <ProgressBar HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="18.1" x:Name="progressBar" Width="496" Background="Transparent" BorderThickness="0" 
14 14
                      Foreground="LightSlateGray"  Opacity="0.5"/>
15 15
        <TextBlock HorizontalAlignment="Left" VerticalAlignment="Bottom" TextAlignment="Center" x:Name="splashText" Foreground="AntiqueWhite"  FontWeight="ExtraBold" xml:space="preserve" Height="17.5">   Loading...</TextBlock>
KCOM_API/ServiceDeepView.svc.cs
31 31
        //    return null;
32 32
        //}
33 33

  
34
        [OperationContract]
35
        public string GetVersionData(bool is64BitProcess, string markusVer)
36
        {
37
            string url = null;
38
            try
39
            {
40
                using (KCOMEntities uc = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString()))
41
                {
42
                    
43
                    if (is64BitProcess) //64 bit machine
44
                    {
45
                        url = uc.PROPERTIES.Where(data => data.TYPE == "Update_x64"
46
                        && data.PROPERTY != markusVer).FirstOrDefault().VALUE;                        
47
                    }
48
                    else
49
                    {
50
                        url = uc.PROPERTIES.Where(data => data.TYPE == "Update_x84"
51
                        && data.PROPERTY != markusVer).FirstOrDefault().VALUE;
52
                    }
53
                    
54
                }
55
            }
56
            catch (Exception)
57
            {
58
                url = null;
59
            }
60
            return url;
61
        }
62

  
34 63

  
35 64
        [OperationContract]
36 65
        public KCOM_SystemInfo GetSystemData()
......
90 119
        [OperationContract]
91 120
        public List<FAVORITE_DOC> GetFavoriteVP(string PrjNo, string userID, string sharepointItemID)
92 121
        {
93

  
94

  
95 122
            using (KCOMEntities dc = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString()))
96 123
            {
97 124

  

내보내기 Unified diff

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