public static Viewer Create <T>(IDatabaseNotifier databaseNotifier, IDatabaseReadOnly readOnlyDatabase, IInstantiator instantiator, IPositionsManager positioner, IBindComponentToDataDbRead bindComponentToDataDbRead) where T : Viewer, new() { var viewer = new T(); viewer.Init(databaseNotifier, readOnlyDatabase, instantiator, positioner, bindComponentToDataDbRead); viewer.Subscribe(); return(viewer); }
protected virtual void Init([NotNull] IDatabaseNotifier databaseNotifier, IDatabaseReadOnly readOnlyDatabase, [NotNull] IInstantiator instantiator, [NotNull] IPositionsManager positioner, [NotNull] IBindComponentToDataDbRead bindComponentToDataDbRead) { _notifier = databaseNotifier ?? throw new ArgumentNullException(nameof(databaseNotifier)); _readOnlyDatabase = readOnlyDatabase; _instantiator = instantiator ?? throw new ArgumentNullException(nameof(instantiator)); _positioner = positioner ?? throw new ArgumentNullException(nameof(positioner)); _bindComponentToDataDbRead = bindComponentToDataDbRead; }
public BindComponentToDataDb(IDatabaseCommands databaseCommands, IDatabaseReadOnly databaseReadOnly) { _databaseCommands = databaseCommands; _databaseReadOnly = databaseReadOnly; }