public void RegisterServerSideViewModel <T>() { var type = typeof(T); if (_registeredTypes.Contains(type)) { throw new Exception("Type '" + type.Name + "' is already registered"); } _registeredTypes.Add(type); _operationRegistry.RegisterCommand(type.Name + "_front", new Func <JavascriptString>(() => RenderKoMapping(type))); _operationRegistry.RegisterCommand(type.Name + "_constructor", new Func <ViewModelWrapper>(() => ConstructViewModel(type))); }
public KnockoutMapper(IOperationRegistry operationRegistry, IMonitorCollection monitorCollection) { _operationRegistry = operationRegistry; _monitorCollection = monitorCollection; _operationRegistry.RegisterCommand("subscribeToViewModel", new Func <string, List <ChangeEntry> >(Subscribe)); }
public CherryCommanderService() { operationRegistry = new OperationRegistry(); operationRegistry.RegisterCommand("GetFiles", new Func<string, List<FileIdentifier>>(GetFiles)); webServer = new WebServer(operationRegistry) { Port = 8181 }; webServer.RegisterAssembly(GetType().Assembly, "", "CherryCommander.Core.Ui"); }
public CherryCommanderService() { operationRegistry = new OperationRegistry(); operationRegistry.RegisterCommand("GetFiles", new Func <string, List <FileIdentifier> >(GetFiles)); webServer = new WebServer(operationRegistry) { Port = 8181 }; webServer.RegisterAssembly(GetType().Assembly, "", "CherryCommander.Core.Ui"); }
public void RegisterCommand(string name, Delegate commandFunction) { _operationRegistry.RegisterCommand(name, commandFunction); }