프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / App.xaml.cs @ 3797ff05

이력 | 보기 | 이력해설 | 다운로드 (4.29 KB)

1 787a4489 KangIngu

2
using System;
3
using System.Collections.Generic;
4
using System.ComponentModel;
5
using System.Configuration;
6
using System.Data;
7
using System.Linq;
8
using System.Runtime.CompilerServices;
9
using System.ServiceModel;
10
using System.Windows;
11
12
namespace KCOM
13
{
14
    public class OpenProperties
15
    {
16
        public string DocumentItemID { get; set; }
17
        public bool bPartner { get; set; }
18
        public bool CreateFinalPDFPermission { get; set; }
19
        public bool NewCommentPermission { get; set; }
20
        public string ProjectNO { get; set; }
21
        public string UserID { get; set; }
22
        public int Mode { get; set; }
23
    }
24
    /// <summary>
25
    /// App.xaml에 대한 상호 작용 논리
26
    /// </summary>
27
    public partial class App : Application
28
    {
29
        public static BasicHttpBinding _binding;
30
        public static EndpointAddress _EndPoint;
31
        public static EndpointAddress _EndPoint_SaveLoad;
32
        public static EndpointAddress _EndPoint_Symbol;
33
        public static string UserID;
34
        public static string UserName;
35
        public static string UserIP;
36
        public static IKCOM.ViewInfo ViewInfo;
37
        public static string urlHost;
38
        public static string urlPort;
39
        public static string urlHost_DB;
40
        public static string urlPort_DB;
41
        public static string Custom_ViewInfoId;
42
        public static bool ParameterMode = false;
43
44
45
        public static RestSharp.RestClient BaseClient { get; set; }
46
        public static IKCOM.KCOM_SystemInfo SystemInfo { get; set; }
47
        private static OpenProperties ParamDecoding(string DecodingText, System.Text.Encoding oEncoding = null)
48
        {
49
            if (oEncoding == null)
50
                oEncoding = System.Text.Encoding.UTF8;
51
52
            byte[] byteArray = Convert.FromBase64String(DecodingText);
53
54
            string jsonBack = oEncoding.GetString(byteArray);
55
56
            return Newtonsoft.Json.JsonConvert.DeserializeObject<OpenProperties>(jsonBack);
57
        }
58
59
        protected override void OnStartup(StartupEventArgs e)
60
        {
61
            try
62
            {
63
                if (e.Args.Count() > 0)
64
                {
65
                    
66
                    var result = ParamDecoding(e.Args[0].Replace(@"kcom://","").Replace(@"/",""));
67
                    App.ViewInfo = new IKCOM.ViewInfo
68
                    {
69
                        DocumentItemID = result.DocumentItemID,
70
                        //DocumentItemID = "10001",
71
                        bPartner = result.bPartner,
72 bc664e9b djkim
                        CreateFinalPDFPermission = result.CreateFinalPDFPermission,
73
                        NewCommentPermission = result.NewCommentPermission,
74 787a4489 KangIngu
                        ProjectNO = result.ProjectNO,
75
                        UserID = result.UserID,
76
                        //UserID = "H2009115",
77
                        //Mode = 0 , 1 , 2
78
                    };
79
                    ParameterMode = true;
80
                }
81 992a98b4 KangIngu
82
                //App.ViewInfo.CreateFinalPDFPermission = false;
83
                //App.ViewInfo.NewCommentPermission = false;
84
85
               //GetQueryStringParameters();
86
               _binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
87 787a4489 KangIngu
                _binding.MaxBufferSize = 2147483647;
88
                _binding.MaxReceivedMessageSize = 2147483647;
89
                _binding.OpenTimeout = new TimeSpan(0, 1, 0);
90
                _binding.ReceiveTimeout = new TimeSpan(0, 10, 0);
91
                _binding.CloseTimeout = new TimeSpan(0, 5, 0);
92
                _binding.SendTimeout = new TimeSpan(0, 5, 0);
93
                _binding.TextEncoding = System.Text.Encoding.UTF8;
94
                _binding.TransferMode = TransferMode.Buffered;
95
                //Support.SetLicense();
96 992a98b4 KangIngu
97 814116a9 humkyung
                string sBaseServiceURL = global::KCOM.Properties.Settings.Default.BaseClientAddress;
98 992a98b4 KangIngu
#if DEBUG
99
                //_EndPoint = new EndpointAddress(@"http://10.11.252.3/MARKUS/ServiceDeepView.svc"); //효성
100 814116a9 humkyung
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL));
101
102 992a98b4 KangIngu
#else
103 814116a9 humkyung
                _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL));
104 992a98b4 KangIngu
#endif
105 787a4489 KangIngu
                base.OnStartup(e);
106
            }
107
            catch (Exception ex)
108
            {
109
                MessageBox.Show("에러 메시지" + ex.Message);
110
            }
111
        }
112
    }
113
}
클립보드 이미지 추가 (최대 크기: 500 MB)