Ejemplo n.º 1
0
        static ServiceType GetServiceType(SimpleAuth.Api api)
        {
            if (api is GoogleMusicApi)
            {
                return(ServiceType.Google);
            }
            if (api is CloudDriveApi)
            {
                return(ServiceType.Amazon);
            }
            if (api is YoutubeOauthApi)
            {
                return(ServiceType.YouTube);
            }
            if (api is SoundCloudApi)
            {
                return(ServiceType.SoundCloud);
            }
            if (api is OneDriveApi)
            {
                return(ServiceType.OneDrive);
            }

            App.ShowNotImplmented(new Dictionary <string, string> {
                { "Api type", api.GetType().ToString() }
            });
            return(ServiceType.FileSystem);
        }
Ejemplo n.º 2
0
        public MusicProvider CreateProvider(SimpleAuth.Api api)
        {
            try
            {
                var providerType = ApiProviderTypes[api.GetType()];
                var provider     = Activator.CreateInstance(providerType, api) as MusicProvider;
                return(provider);
            }
            catch (Exception ex)
            {
                LogManager.Shared.Report(ex);
            }

            App.ShowNotImplmented(new Dictionary <string, string> {
                { "Service Type", api.GetType().ToString() }
            });
            return(null);
        }