bookmark-manager-r4/Classes/SupportedFile/SupportedFileBase.cs

48 lines
1.2 KiB
C#
Raw Normal View History

2021-09-07 11:32:24 +00:00
using RyzStudio.Windows.Forms;
using System.Collections.Generic;
using System.IO;
namespace BookmarkManager
{
public abstract class SupportedFileBase : ISupportedFile
{
protected List<string> supportedExtensions = new List<string>();
public SupportedFileBase()
{
}
public virtual bool IsEncryptionSupported { get; set; } = false;
public virtual bool IsSupported(string filename)
{
if (string.IsNullOrWhiteSpace(filename))
{
return false;
}
if (supportedExtensions == null)
{
return false;
}
if (supportedExtensions.Count <= 0)
{
return false;
}
return supportedExtensions.Contains(Path.GetExtension(filename)?.Trim()?.ToLower());
}
public virtual bool IsEncrypted(string filename) => false;
public virtual Result Load(BookmarkTreeView treeview, string filename, string password) => Result.Create(false);
public virtual Result Save(BookmarkTreeView treeview, string filename, string password) => Result.Create(false);
}
}