コード例 #1
0
        public void Initialize()
        {
            _community = new Community(new MemoryStorageStrategy())
                .Register<CorrespondenceModel>();

            _identity = _community.AddFact(new Identity("mike"));
            _viewModel = new HomeViewModel(_identity, new NavigationModel());
        }
コード例 #2
0
        public void Initialize()
        {
            _community = new Community(new MemoryStorageStrategy())
                .Register<Model.CorrespondenceModel>();

            _identity = _community.AddFact(new Identity("mike"));
            Cloud cloud = _community.AddFact(new Cloud(_identity));
            _cloudViewModel = new CloudViewModel(cloud, new CloudNavigationModel(cloud));
        }
コード例 #3
0
			public CorrespondenceFact CreateFact(FactMemento memento)
			{
				Identity newFact = new Identity(memento);

				// Create a memory stream from the memento data.
				using (MemoryStream data = new MemoryStream(memento.Data))
				{
					using (BinaryReader output = new BinaryReader(data))
					{
						newFact._anonymousId = (string)_fieldSerializerByType[typeof(string)].ReadData(output);
					}
				}

				return newFact;
			}
コード例 #4
0
        public void Initialize()
        {
            var sharedCommunication = new MemoryCommunicationStrategy();
            _mikesCommunity = new Community(new MemoryStorageStrategy())
                .AddCommunicationStrategy(sharedCommunication)
                .Register<Model.CorrespondenceModel>()
                .Subscribe(() => _mikesIdentity)
                .Subscribe(() => _mikesIdentity.SharedClouds)
				;
            _russellsCommunity = new Community(new MemoryStorageStrategy())
                .AddCommunicationStrategy(sharedCommunication)
                .Register<Model.CorrespondenceModel>()
                .Subscribe(() => _russellsIdentity)
                .Subscribe(() => _russellsIdentity.SharedClouds)
				;

            _mikesIdentity = _mikesCommunity.AddFact(new Identity("mike"));
            _russellsIdentity = _russellsCommunity.AddFact(new Identity("russell"));
		}
コード例 #5
0
 public HomeViewModel(Identity identity, NavigationModel navigation)
 {
     _identity = identity;
     _navigation = navigation;
 }
コード例 #6
0
        // Fields

        // Results

        // Business constructor
        public DisableToastNotification(
            Identity identity
            )
        {
            _unique = Guid.NewGuid();
            InitializeResults();
            _identity = new PredecessorObj<Identity>(this, RoleIdentity, identity);
        }
コード例 #7
0
        // Fields

        // Results

        // Business constructor
        public Share(
            Identity recipient
            ,Cloud cloud
            )
        {
            InitializeResults();
            _recipient = new PredecessorObj<Identity>(this, RoleRecipient, recipient);
            _cloud = new PredecessorObj<Cloud>(this, RoleCloud, cloud);
        }
コード例 #8
0
 // Business constructor
 public Cloud(
     Identity creator
     )
 {
     _unique = Guid.NewGuid();
     InitializeResults();
     _creator = new PredecessorObj<Identity>(this, RoleCreator, creator);
 }