Пример #1
0
        public StreamSaving(Stream downloadedStream, SourceProperties objectToSave)
        {
            if (objectToSave == null || downloadedStream == null)
            {
                return;
            }

            if (String.IsNullOrEmpty(_sourceObj.name))
            {
                Console.WriteLine("ERROR @MP3FileSaving: Something not right. File NAME not set.");
                return;
            }
            if (String.IsNullOrEmpty(_sourceObj.saveTo))
            {
                Console.WriteLine("ERROR @MP3FileSaving: Something not right. file PATH not set.");
                return;
            }
            if (String.IsNullOrEmpty(_sourceObj.extension))
            {
                Console.WriteLine("ERROR @MP3FileSaving: Something not right. file EXTENSION not set.");
                return;
            }
            this._sourceObj  = objectToSave;
            this._dataStream = downloadedStream;
        }
Пример #2
0
        public WebpageDownloading(SourceProperties objectToDownload)
        {
            this._sourceObj = objectToDownload;

            if (_sourceObj.fullUrl == null)
            {
                Console.Write($"ERROR @WebpageDownloading: No URL found!");
                return;
            }
        }