프로젝트

일반

사용자정보

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

markus / KCOM / App.xaml.cs @ a0bab669

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

1

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
                        CreateFinalPDFPermission = result.NewCommentPermission,
73
                        NewCommentPermission = result.CreateFinalPDFPermission,
74
                        ProjectNO = result.ProjectNO,
75
                        UserID = result.UserID,
76
                        //UserID = "H2009115",
77
                        //Mode = 0 , 1 , 2
78
                    };
79
                    ParameterMode = true;
80
                }
81
                //GetQueryStringParameters();
82
                _binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
83
                _binding.MaxBufferSize = 2147483647;
84
                _binding.MaxReceivedMessageSize = 2147483647;
85
                _binding.OpenTimeout = new TimeSpan(0, 1, 0);
86
                _binding.ReceiveTimeout = new TimeSpan(0, 10, 0);
87
                _binding.CloseTimeout = new TimeSpan(0, 5, 0);
88
                _binding.SendTimeout = new TimeSpan(0, 5, 0);
89
                _binding.TextEncoding = System.Text.Encoding.UTF8;
90
                _binding.TransferMode = TransferMode.Buffered;
91
                //Support.SetLicense();
92
                //테스트
93
                //_EndPoint = new EndpointAddress(@"http://localhost:13009/ServiceDeepView.svc");
94
                //운영
95
                _EndPoint = new EndpointAddress(@"http://cloud.devdoftech.co.kr:5978/ServiceDeepView.svc");
96
                //Telerik.Windows.Controls.VisualStudio2013Palette.LoadPreset(Telerik.Windows.Controls.VisualStudio2013Palette.ColorVariation.Dark);
97
                base.OnStartup(e);
98
            }
99
            catch (Exception ex)
100
            {
101
                MessageBox.Show("에러 메시지" + ex.Message);
102
            }
103
        }
104

    
105
        //        //default color variation
106
        //        VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Light);
107

    
108
        ////blue color variation
109
        //VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Blue);
110

    
111
        ////dark color variation
112
        //VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark); 
113

    
114

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