public HashStructProjectionModel(StructProjectionInfo structProjectionInfo) { var controller = new HashStructProjectionController(this); Pattern = "*"; this.WhenActivated(disposables => { var key = structProjectionInfo.ResultProjectionInfo.Value; var targetInfo = structProjectionInfo.ResultProjectionInfo.Result.TargetInfo; controller.BindLength(key, targetInfo) .DisposeWith(disposables); controller.BindScanCommand(key, targetInfo) .DisposeWith(disposables); controller.BindAddCommand(key, targetInfo) .DisposeWith(disposables); controller.BindDeleteCommand(key, targetInfo) .DisposeWith(disposables); controller.BindEditCommand(key, targetInfo) .DisposeWith(disposables); controller.BindCancelCommand() .DisposeWith(disposables); controller.ExecuteScanCommand() .DisposeWith(disposables); }); }
public ListStructProjectionModel(StructProjectionInfo structProjectionInfo) { var controller = new ListStructProjectionController(this); StartIndex = "0"; StopIndex = "9"; Range = Tuple.Create(0, 9); this.WhenActivated(disposables => { var key = structProjectionInfo.ResultProjectionInfo.Value; var targetInfo = structProjectionInfo.ResultProjectionInfo.Result.TargetInfo; controller.BindLength(key, targetInfo) .DisposeWith(disposables); controller.BindStartIndex() .DisposeWith(disposables); controller.BindStopIndex() .DisposeWith(disposables); controller.BindRange() .DisposeWith(disposables); controller.BindRangeCommand(key, targetInfo) .DisposeWith(disposables); controller.BindAddCommand(key, targetInfo) .DisposeWith(disposables); controller.BindDeleteCommand(key, targetInfo) .DisposeWith(disposables); controller.BindEditCommand(key, targetInfo) .DisposeWith(disposables); controller.BindCancelCommand() .DisposeWith(disposables); controller.ExecuteRangeCommand() .DisposeWith(disposables); }); }
public StringStructProjectionModel(StructProjectionInfo structProjectionInfo) { var controller = new StringStructProjectionController(this); this.WhenActivated(disposables => { var key = structProjectionInfo.ResultProjectionInfo.Value; var targetInfo = structProjectionInfo.ResultProjectionInfo.Result.TargetInfo; controller.BindMimeTypes() .DisposeWith(disposables); controller.BindLength(key, targetInfo) .DisposeWith(disposables); controller.BindValue(key, targetInfo) .DisposeWith(disposables); controller.BindSaveCommand(key, targetInfo) .DisposeWith(disposables); }); }
private StructProjectionModel CreateProjectionModel( StructProjectionInfo structProjectionInfo) { switch (structProjectionInfo.Kind) { case StructProjectionKind.String: return(new StringStructProjectionModel(structProjectionInfo)); case StructProjectionKind.List: return(new ListStructProjectionModel(structProjectionInfo)); case StructProjectionKind.Hash: return(new HashStructProjectionModel(structProjectionInfo)); case StructProjectionKind.Set: return(new SetStructProjectionModel(structProjectionInfo)); case StructProjectionKind.ZSet: return(new ZSetStructProjectionModel(structProjectionInfo)); } return(new NoneStructProjectionModel()); }