public static App[] GetApps()
        {
            ApiKey apiKey = GetApiKey();

            App[] result = ApiConnection.ListsUserApplications(apiKey.Value);
            Assert.IsNotNull(result);

            _cachedApps = new CachedApps(apiKey);
            _cachedApps.List.AddRange(result);
            _cachedApps.LastFullUpdateDateTime = DateTime.Now;

            return(result);
        }
        public static App GetAppInfo(AppSecret secret)
        {
            if (!secret.IsValid)
            {
                throw new InvalidArgumentException("secret");
            }

            ApiKey apiKey = GetApiKey();

            App app = ApiConnection.GetApplicationInfo(secret.Value);

            if (_cachedApps == null || !_cachedApps.ApiKey.Equals(apiKey))
            {
                _cachedApps = new CachedApps(apiKey);
            }

            _cachedApps.List.RemoveAll(x => x.secret == app.secret);
            _cachedApps.List.Add(app);

            return(app);
        }
        public static App CreateNewApp(AppName name, AppPlatform platform)
        {
            if (!name.IsValid)
            {
                throw new InvalidArgumentException("name");
            }

            ApiKey apiKey = GetApiKey();

            App app = ApiConnection.PostUserApplication(
                apiKey.Value,
                name.Value,
                platform.ToApiString());

            if (_cachedApps == null || !_cachedApps.ApiKey.Equals(apiKey))
            {
                _cachedApps = new CachedApps(apiKey);
            }

            _cachedApps.List.RemoveAll(x => x.secret == app.secret);
            _cachedApps.List.Add(app);

            return(app);
        }