Код: Выделить всё
public interface IMyOperationContext where Т : IMyOperationWithContext
{
// some fields and methods
}
public interface IMyOperationWithContext
{
void ApplyContext(IMyOperationContext ctx);
}
e.g. Некоторое время: ImyoPerationWithContext будет вынужден реализовать Public void ApplyContext (iMyoPerationContext ) .
это любой способ реализовать такую идею? simplified):
- My solution consists of several projects/layers. Некоторые из проектов являются платформы-агрессиями, и некоторые из проектов предназначены исключительно для кода, связанного с Winforms.
Я надеюсь, что это обеспечит плавное расширение на другие платформы. />Context would a kind of DTO which fields depend on a particular operation. WinForm object would return that DTOs and generic code would inject it into operation.
Подробнее здесь: https://stackoverflow.com/questions/796 ... mplementin