Пример #1
0
 public LoggingIn(MainWindow mainWindow, AuthorizationStructure userInfo)
 {
     InitializeComponent();
     main = mainWindow;
     LGThingApi.Communication.LGGateway.LGOAuth.AuthorizationData = userInfo;
     Loaded += LoggingIn_Loaded;
 }
Пример #2
0
                /// <summary>
                /// Parse access and refresh tokens based on response from Oauth Url from <see cref="GetOauthUrl" langword="static">GetOauthUrl</see>
                /// </summary>
                /// <param name="response">Response from <see cref="GetOauthUrl" langword="static">GetOauthUrl</see></param>
                public static void AuthorizeBasedOnOauth(string response)
                {
                    if (response == null)
                    {
                        throw new InvalidDataException();
                    }
                    string access  = response.Split('=')[1].Split('&')[0];
                    string refresh = response.Split('=')[2].Split('&')[0];

                    AuthorizationData = new AuthorizationStructure()
                    {
                        AccessToken = access, RefreshToken = refresh, GrantType = "refresh_token"
                    };
                }
Пример #3
0
 public CommandFactory(
     SubscriptionsModifyOperations subscriptions,
     AuthorizationStructure authorizationStructure,
     ISubscriptionFactory subscriptionFactory,
     SubscriptionDataCorrectnessCriteria dataCorrectnessCriteria,
     IAssetQueriesFactory assetQueriesFactory,
     Log log)
 {
     _subscriptions           = subscriptions;
     _authorizationStructure  = authorizationStructure;
     _subscriptionFactory     = subscriptionFactory;
     _dataCorrectnessCriteria = dataCorrectnessCriteria;
     _assetQueriesFactory     = assetQueriesFactory;
     _log = log;
 }
Пример #4
0
        static void Main(string[] args)
        {
            var structure = new AuthorizationStructure();

            var dummyLog = new DummyLog();
            var api      = new Api(
                new CommandFactory(
                    new Subscriptions.Subscriptions(),
                    structure,
                    new SubscriptionFactory(),
                    new SubscriptionDataCorrectnessCriteria(),
                    new AssetQueriesFactory(
                        structure
                        ),
                    dummyLog
                    ),
                new DefaultResponseBuilderFactory(),
                dummyLog
                );

            var response1 = api.StartSubscription(new NewSubscriptionParametersDto());
            var response2 = api.StopSubscription(new StoppedSubscriptionParametersDto());
        }
Пример #5
0
 public void GoToLogginIn(AuthorizationStructure author)
 {
     logIN = new LoggingIn(this, author);
     _NavigationFrame.Navigate(logIN);
 }
Пример #6
0
 public IncomingChangeProcessing(ChangeFactory changeFactory, AuthorizationStructure authorizationStructure)
 {
     _changeFactory          = changeFactory;
     _authorizationStructure = authorizationStructure;
 }
Пример #7
0
 public void MakeTo(AuthorizationStructure authorizationStructure)
 {
     Console.WriteLine("Create " + authorizationStructure);
 }