public void Initialize() { MemoryCommunicationStrategy sharedCommunication = new MemoryCommunicationStrategy(); _frontOfficeCommunity = new Community(new MemoryStorageStrategy()) .AddCommunicationStrategy(sharedCommunication) .RegisterAssembly(typeof(Machine)) .Subscribe(() => _frontOfficeCompany); _kitchenCommunity = new Community(new MemoryStorageStrategy()) .AddCommunicationStrategy(sharedCommunication) .RegisterAssembly(typeof(Machine)) .Subscribe(() => _kitchen.Company); Machine frontOfficeMachine = _frontOfficeCommunity.AddFact(new Machine()); _frontOfficeCompany = _frontOfficeCommunity.AddFact(new Company("NanasNook")); _frontOfficeCommunity.AddFact(new ProvisionFrontOffice(frontOfficeMachine, _frontOfficeCompany)); Machine kitchenMachine = _kitchenCommunity.AddFact(new Machine()); Company kitchenCompany = _kitchenCommunity.AddFact(new Company("NanasNook")); _kitchen = _kitchenCommunity.AddFact(new Kitchen(kitchenCompany, "Main Street")); _kitchenCommunity.AddFact(new ProvisionKitchen(kitchenMachine, _kitchen)); }
// Business constructor public Pull( Order order ,Kitchen kitchen ) { InitializeResults(); _order = new PredecessorObj<Order>(this, RoleOrder, order); _kitchen = new PredecessorObj<Kitchen>(this, RoleKitchen, kitchen); }
// Business constructor public ProvisionKitchen( Machine machine ,Kitchen kitchen ) { _unique = Guid.NewGuid(); InitializeResults(); _machine = new PredecessorObj<Machine>(this, RoleMachine, machine); _kitchen = new PredecessorObj<Kitchen>(this, RoleKitchen, kitchen); }
public KitchenViewModel(Kitchen kitchen, KitchenNavigationModel navigation) { _kitchen = kitchen; _navigation = navigation; }
public void SetupKitchen() { _kitchenCommunity = new Community(new MemoryStorageStrategy()) .AddCommunicationStrategy(_sharedCommunication) .RegisterAssembly(typeof(Machine)) .Subscribe(() => _kitchen.Company); Machine kitchenMachine = _kitchenCommunity.AddFact(new Machine()); Company kitchenCompany = _kitchenCommunity.AddFact(new Company("NanasNook")); _kitchen = _kitchenCommunity.AddFact(new Kitchen(kitchenCompany, "Main Street")); _kitchenCommunity.AddFact(new ProvisionKitchen(kitchenMachine, _kitchen)); }