예제 #1
0
        public void Initialize(IGApiAccount account, bool canBeMainService = false)
        {
            try
            {
                Account = account;

                Client.AddDefaultHeaders(new Dictionary <string, string>()
                {
                    { "Content-Type", "application/json; charset=UTF-8" },
                    { "Accept", "application/json; charset=UTF-8" },
                    { "X-IG-API-KEY", Account.ApiKey }
                });

                if (!_initilized)
                {
                    AccountDetails = Authenticate();
                    if (mainService == null && canBeMainService)
                    {
                        lock (serviceLock)
                            mainService = this;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #2
0
 public void SetAccountService(HttpIGAccountService httpIGAccountService)
 {
     IGAccountService = httpIGAccountService;
 }