예제 #1
0
        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)));
        }
예제 #2
0
        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");
        }
예제 #5
0
 public void RegisterCommand(string name, Delegate commandFunction)
 {
     _operationRegistry.RegisterCommand(name, commandFunction);
 }