Ejemplo n.º 1
0
        public static void Startup()
        {
            SnapInContext.Instance.AuthTokenManager = new AuthTokenManager();
            var filePath = Path.Combine(SnapInContext.Instance.ApplicationPath, Constants.LocalStorageFileName);
            _store = new LocalFileStorage(filePath);
            SnapInContext.Instance.AuthTokenManager.CacheAuthTokens(_store.Load());

            var httpTransportFilePath = Path.Combine(SnapInContext.Instance.ApplicationPath, Constants.HttpTransportLocalStorageFileName);
            _httpTransportStore = new HttpTransportLocalFileStorage(httpTransportFilePath);

            var httpData = _httpTransportStore.Load();
            var service = SnapInContext.Instance.ServiceGateway;
            service.HttpTransport.SetAll(httpData);
        }
Ejemplo n.º 2
0
        public void Startup()
        {
            SnapInContext.Instance.AuthTokenManager = new AuthTokenManager();
            var filePath = Path.Combine(SnapInContext.Instance.ApplicationPath, Constants.LocalStorageFileName);

            _store = new LocalFileStorage(filePath);
            SnapInContext.Instance.AuthTokenManager.CacheAuthTokens(_store.Load());

            var httpTransportFilePath = Path.Combine(SnapInContext.Instance.ApplicationPath, Constants.HttpTransportLocalStorageFileName);

            _httpTransportStore = new HttpTransportLocalFileStorage(httpTransportFilePath);

            var httpData = _httpTransportStore.Load();
            var service  = SnapInContext.Instance.ServiceGateway;

            service.HttpTransport.SetAll(httpData);
        }
Ejemplo n.º 3
0
        public void Startup()
        {
            SnapInContext.Instance.AuthTokenManager = new AuthTokenManager();
            var filePath = Path.Combine(SnapInContext.Instance.ApplicationPath, Constants.LocalStorageFileName);

            _store = new LocalFileStorage(filePath);
            SnapInContext.Instance.AuthTokenManager.CacheAuthTokens(_store.Load());

            var httpTransportFilePath = Path.Combine(SnapInContext.Instance.ApplicationPath, Constants.HttpTransportLocalStorageFileName);

            _httpTransportStore = new HttpTransportLocalFileStorage(httpTransportFilePath);

            var httpData = _httpTransportStore.Load();
            var service  = ScopeNodeExtensions.GetServiceGateway();

            service.HttpTransport.SetAll(httpData);
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12;
        }