namespace VideoBrowser.Core
{
using System;
using System.ComponentModel;
using VideoBrowser.Extensions;
using VideoBrowser.If;
///
/// Defines the
///
public abstract class UrlHandlerBase : IUrlHandler, INotifyPropertyChanged
{
#region Fields
private string _fullUrl;
private bool _isDownloadable;
private bool _isPlayList;
#endregion Fields
#region Constructors
///
/// Initializes a new instance of the class.
///
/// The domainName
protected UrlHandlerBase(string domainName)
{
this.DomainName = domainName;
this.PropertyChanged += this.OnPropertyChanged;
}
#endregion Constructors
#region Events
///
/// Defines the PropertyChanged
///
public event PropertyChangedEventHandler PropertyChanged;
#endregion Events
#region Properties
///
/// Gets the DomainName
///
public string DomainName { get; }
///
/// Gets or sets the FullUrl
///
public string FullUrl { get => _fullUrl; set => this.Set(this.PropertyChanged, ref _fullUrl, value); }
///
/// Gets or sets a value indicating whether IsDownloadable
///
public bool IsDownloadable { get => _isDownloadable; set => this.Set(this.PropertyChanged, ref _isDownloadable, value); }
///
/// Gets or sets a value indicating whether IsPlayList
///
public bool IsPlayList { get => _isPlayList; set => this.Set(this.PropertyChanged, ref _isPlayList, value); }
///
/// Gets the VideoUrlTypes
///
public UrlTypes VideoUrlTypes => throw new NotImplementedException();
#endregion Properties
#region Methods
///
/// The ParseFullUrl
///
protected abstract void ParseFullUrl();
///
/// The OnPropertyChanged
///
/// The sender
/// The e
private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case nameof(this.FullUrl):
this.ParseFullUrl();
break;
default:
break;
}
}
#endregion Methods
}
}