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));
        }
示例#2
0
 // Results
 // Business constructor
 public City(
     Company company
     ,string name
     )
 {
     InitializeResults();
     _company = new PredecessorObj<Company>(this, RoleCompany, company);
     _name = name;
 }
示例#3
0
 // Business constructor
 public ProvisionFrontOffice(
     Machine machine
     ,Company company
     )
 {
     _unique = Guid.NewGuid();
     InitializeResults();
     _machine = new PredecessorObj<Machine>(this, RoleMachine, machine);
     _company = new PredecessorObj<Company>(this, RoleCompany, company);
 }
示例#4
0
 // Business constructor
 public Order(
     Company company
     )
 {
     _unique = Guid.NewGuid();
     InitializeResults();
     _company = new PredecessorObj<Company>(this, RoleCompany, company);
 }
 private void ProvisionKitchen(MemoryCommunicationStrategy sharedCommunicationStrategy)
 {
     _kitchenCommunity = new Community(new MemoryStorageStrategy())
         .AddCommunicationStrategy(sharedCommunicationStrategy)
         .RegisterAssembly(typeof(Machine))
         .Subscribe(() => _kitchenCompany);
     _kitchenCompany = _kitchenCommunity.AddFact(new Company("Nanas Nook"));
     Kitchen kitchen = _kitchenCompany.NewKitchen("Market Street");
     _kitchenViewModel = new k.KitchenViewModel(kitchen, new k.KitchenNavigationModel());
 }
 private void ProvisionFrontOffice(MemoryCommunicationStrategy sharedCommunicationStrategy)
 {
     _frontOfficeCommunity = new Community(new MemoryStorageStrategy())
         .AddCommunicationStrategy(sharedCommunicationStrategy)
         .RegisterAssembly(typeof(Machine))
         .Subscribe(() => _frontOfficeCompany);
     _frontOfficeCompany = _frontOfficeCommunity.AddFact(new Company("Nanas Nook"));
     _frontOfficeViewModel = new f.FrontOfficeViewModel(_frontOfficeCompany, new f.FrontOfficeNavigationModel());
 }
 public OrderSnapshotViewModel(Company company, OrderSnapshot orderSnapshot)
 {
     _company = company;
     _orderSnapshot = orderSnapshot;
 }
        public void SetupFrontOffice()
        {
            _frontOfficeCommunity = new Community(new MemoryStorageStrategy())
                .AddCommunicationStrategy(_sharedCommunication)
                .RegisterAssembly(typeof(Machine))
                .Subscribe(() => _frontOfficeCompany);

            Machine frontOfficeMachine = _frontOfficeCommunity.AddFact(new Machine());
            _frontOfficeCompany = _frontOfficeCommunity.AddFact(new Company("NanasNook"));
            _frontOfficeCommunity.AddFact(new ProvisionFrontOffice(frontOfficeMachine, _frontOfficeCompany));
        }
 public FrontOfficeViewModel(Company company, FrontOfficeNavigationModel navigation)
 {
     _company = company;
     _navigation = navigation;
 }