// Copyright © 2021 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
namespace CefSharp.Fluent
{
///
/// Fluent DownloadHandler Builder
///
public class DownloadHandlerBuilder
{
private readonly DownloadHandler handler = new DownloadHandler();
///
/// See for details.
///
/// Action to be executed when
/// is called
///
/// Fluent Builder, call to create
/// a new instance
///
public DownloadHandlerBuilder CanDownload(CanDownloadDelegate action)
{
handler.SetCanDownload(action);
return this;
}
///
/// See for details.
///
/// Action to be executed when
/// is called
///
/// Fluent Builder, call to create
/// a new instance
///
public DownloadHandlerBuilder OnBeforeDownload(OnBeforeDownloadDelegate action)
{
handler.SetOnBeforeDownload(action);
return this;
}
///
/// See for details.
///
/// Action to be executed when
/// is called
///
/// Fluent Builder, call to create
/// a new instance
///
public DownloadHandlerBuilder OnDownloadUpdated(OnDownloadUpdatedDelegate action)
{
handler.SetOnDownloadUpdated(action);
return this;
}
///
/// Create a instance
///
/// a instance
public IDownloadHandler Build()
{
return handler;
}
}
}