Ejemplo n.º 1
0
        private async void HandleDownloadedFileAsync(object sender, DownloadedWebPageEventArgs e)
        {
            if (e == null || e.Uri == null)
            {
                return;
            }

            string filePath = GetLocalFilePath(e.Uri);

            Directory.CreateDirectory(filePath);

            filePath = Path.Combine(filePath, "index.html");

            await WriteFileAsync(filePath, e.Content);

            var args = new FileWriteEventArgs
            {
                FilePath = filePath,
            };

            OnFileWritten(args);
        }
Ejemplo n.º 2
0
 protected virtual void OnFileWritten(FileWriteEventArgs e)
 {
     FileWrittenEvent?.Invoke(this, e);
 }