42 lines
943 B
C#
42 lines
943 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace skyscraper5.UI.StreamAcquisition
|
|
{
|
|
internal interface IStreamAcquirer
|
|
{
|
|
object BaseGetHandle(string arg);
|
|
StreamSource BaseGetStream(object inputHandle);
|
|
object BaseAskUserForHandle(IWin32Window parent);
|
|
|
|
Type HandleType { get; }
|
|
}
|
|
|
|
internal abstract class AbstractStreamAcquirer<T> : IStreamAcquirer
|
|
{
|
|
public abstract T GetHandle(string arg);
|
|
public abstract StreamSource GetStream(T inputHandle);
|
|
public abstract T AskUserForHandle(IWin32Window parent);
|
|
|
|
public object BaseGetHandle(string arg)
|
|
{
|
|
return (T)GetHandle(arg);
|
|
}
|
|
|
|
public StreamSource BaseGetStream(object inputHandle)
|
|
{
|
|
return GetStream((T)inputHandle);
|
|
}
|
|
|
|
public object BaseAskUserForHandle(IWin32Window parent)
|
|
{
|
|
return AskUserForHandle(parent);
|
|
}
|
|
|
|
public Type HandleType { get => typeof(T); }
|
|
}
|
|
}
|