示例#1
0
        public static async Task <Song> LoadAsync(Uri uri, SongUriResolver resolver, ISongReader reader, CancellationToken cancellation = default(CancellationToken))
        {
            var song = new Song();

            song.Uri         = uri;
            song.uriResolver = resolver;

            if (reader.NeedsTemplate)
            {
                song.LoadClearTemplate();
            }

            using (Stream stream = await song.uriResolver.GetAsync(uri, cancellation))
            {
                cancellation.ThrowIfCancellationRequested();
                reader.Read(song, stream);
            }

            if (!(reader is PowerpraiseSongReader))
            {
                song.IsImported = true;
            }

            return(song);
        }
示例#2
0
        public Song(Uri uri, SongUriResolver resolver, ISongReader reader) : this()
        {
            this.Uri         = uri;
            this.uriResolver = resolver;

            if (reader.NeedsTemplate)
            {
                LoadClearTemplate();
            }

            using (Stream stream = uriResolver.Get(uri))
            {
                reader.Read(this, stream);
            }

            if (!(reader is PowerpraiseSongReader))
            {
                IsImported = true;
            }
        }
示例#3
0
		public static async Task<Song> LoadAsync(Uri uri, SongUriResolver resolver, ISongReader reader, CancellationToken cancellation = default(CancellationToken))
		{
			var song = new Song();
			song.Uri = uri;
			song.uriResolver = resolver;

			if (reader.NeedsTemplate)
			{
				song.LoadClearTemplate();
			}

			using (Stream stream = await song.uriResolver.GetAsync(uri, cancellation))
			{
				cancellation.ThrowIfCancellationRequested();
				reader.Read(song, stream);
			}

			if (!(reader is PowerpraiseSongReader))
			{
				song.IsImported = true;
			}

			return song;
		}
示例#4
0
		public static Task<Song> LoadAsync(Uri uri, ISongReader reader, CancellationToken cancellation = default(CancellationToken))
		{
			return LoadAsync(uri, SongUriResolver.Default, reader, cancellation);
		}
示例#5
0
		public Song(Uri uri, SongUriResolver resolver, ISongReader reader) : this()
		{
			this.Uri = uri;
			this.uriResolver = resolver;

			if (reader.NeedsTemplate)
			{
				LoadClearTemplate();
			}

			using (Stream stream = uriResolver.Get(uri))
			{
				reader.Read(this, stream);
			}

			if (!(reader is PowerpraiseSongReader))
			{
				IsImported = true;
			}
		}
示例#6
0
		public Song(Uri uri, ISongReader reader) : this(uri, SongUriResolver.Default, reader) { }
示例#7
0
 public static Task <Song> LoadAsync(Uri uri, ISongReader reader, CancellationToken cancellation = default(CancellationToken))
 {
     return(LoadAsync(uri, SongUriResolver.Default, reader, cancellation));
 }
示例#8
0
 public Song(Uri uri, ISongReader reader) : this(uri, SongUriResolver.Default, reader)
 {
 }