File scoped namespace

This commit is contained in:
2022-05-07 19:40:54 +02:00
parent b161ded92e
commit 9bf95ebe4e
126 changed files with 2562 additions and 2598 deletions

View File

@@ -1,51 +1,50 @@
using FileTime.Core.Command;
using FileTime.Core.Models;
namespace FileTime.App.Core.Services
namespace FileTime.App.Core.Services;
public class ClipboardService : IClipboardService
{
public class ClipboardService : IClipboardService
private List<IAbsolutePath> _content;
public IReadOnlyList<IAbsolutePath> Content { get; private set; }
public Type? CommandType { get; private set; }
public ClipboardService()
{
private List<IAbsolutePath> _content;
public IReadOnlyList<IAbsolutePath> Content { get; private set; }
public Type? CommandType { get; private set; }
_content = new List<IAbsolutePath>();
Content = _content.AsReadOnly();
}
public ClipboardService()
public void AddContent(IAbsolutePath absolutePath)
{
foreach (var content in _content)
{
_content = new List<IAbsolutePath>();
Content = _content.AsReadOnly();
if (content.Equals(absolutePath)) return;
}
public void AddContent(IAbsolutePath absolutePath)
_content.Add(absolutePath);
}
public void RemoveContent(IAbsolutePath absolutePath)
{
for (var i = 0; i < _content.Count; i++)
{
foreach (var content in _content)
if (_content[i].Equals(absolutePath))
{
if (content.Equals(absolutePath)) return;
_content.RemoveAt(i--);
}
_content.Add(absolutePath);
}
public void RemoveContent(IAbsolutePath absolutePath)
{
for (var i = 0; i < _content.Count; i++)
{
if (_content[i].Equals(absolutePath))
{
_content.RemoveAt(i--);
}
}
}
public void Clear()
{
_content = new List<IAbsolutePath>();
Content = _content.AsReadOnly();
CommandType = null;
}
public void SetCommand<T>() where T : ITransportationCommand
{
CommandType = typeof(T);
}
}
public void Clear()
{
_content = new List<IAbsolutePath>();
Content = _content.AsReadOnly();
CommandType = null;
}
public void SetCommand<T>() where T : ITransportationCommand
{
CommandType = typeof(T);
}
}