Exemple #1
0
        public void AddProvider(ILyricsProvider provider)
        {
            if (this.started)
            {
                throw new InvalidOperationException("Already started.");
            }

            this.providers.Add(provider);
        }
        public void AddProvider(ILyricsProvider provider)
        {
            if (this.started)
            {
                throw new InvalidOperationException("Already started.");
            }

            this.providers.Add(provider);
        }
Exemple #3
0
        public void AddProvidersForAssembly(Assembly assembly)
        {
            Type targetInterface = typeof(ILyricsProvider);

            foreach (Type t in assembly.GetTypes().Where(t => targetInterface.IsAssignableFrom(t)))
            {
                if (t.IsInterface)
                {
                    continue;
                }
                if (t.IsAbstract)
                {
                    continue;
                }
                ConstructorInfo constructor = t.GetConstructor(EmptyTypes);
                ILyricsProvider provider    = (ILyricsProvider)constructor.Invoke(null);
                this.AddProvider(provider);
            }
        }
 public Processor(IRecordingInformationProvider recordingInformationProvider, ILyricsProvider lyricsProvider, ILyricParser lyricParser)
 {
     this.recordingInformationProvider = recordingInformationProvider ?? throw new ArgumentNullException($"{nameof(recordingInformationProvider)} cannot be null");
     this.lyricsProvider = lyricsProvider ?? throw new ArgumentNullException($"{nameof(lyricsProvider)} cannot be null");
     this.lyricParser    = lyricParser ?? throw new ArgumentNullException($"{nameof(lyricParser)} cannot be null");
 }
Exemple #5
0
 public LyricsController(ILyricsProvider l, IS3Provider r)
 {
     _lyricsProvider = l;
     _recordProvider = r;
     req.Properties[System.Web.Http.Hosting.HttpPropertyKeys.HttpConfigurationKey] = configuration;
 }