Beispiel #1
0
 public void AddStuff(ImmutableStuff stuff)
 {
     var stuffInfo = new StuffInfo(stuff);
     _stuffInInbox.Add(stuff.StuffId, stuffInfo);
     listBox1.Items.Add(stuffInfo);
     listBox1.Visible = listBox1.Items.Count > 0;
 }
Beispiel #2
0
        public void StuffPutInInbox(StuffId stuffId, string descriptionOfStuff, DateTime date)
        {
            var key  = "stuff-" + Id.Id;
            var item = new ImmutableStuff(stuffId, descriptionOfStuff, key, _stuffOrderCounter++);


            _stuffInInbox = _stuffInInbox.Add(stuffId, item);

            // the Client Model state has changed, so publish a "Dumb" UI event
            // to keep the contents of the UI current with the actual state of this client model
            Publish(new Dumb.StuffAddedToInbox(item, _stuffInInbox.Count));
        }
Beispiel #3
0
 public StuffInfo(ImmutableStuff stuff)
 {
     _stuff = stuff;
 }
Beispiel #4
0
 public StuffRemovedFromInbox(ImmutableStuff stuffThatWasRemoved, int inboxCount)
 {
     Stuff      = stuffThatWasRemoved;
     InboxCount = inboxCount;
 }
Beispiel #5
0
 public StuffUpdated(ImmutableStuff stuff)
 {
     Stuff = stuff;
 }
Beispiel #6
0
 public StuffAddedToInbox(ImmutableStuff stuffThatWasAdded, int inboxCount)
 {
     Stuff      = stuffThatWasAdded;
     InboxCount = inboxCount;
 }
Beispiel #7
0
        public void StuffPutInInbox(StuffId stuffId, string descriptionOfStuff, DateTime date)
        {
            var key = "stuff-" + Id.Id;
            var item = new ImmutableStuff(stuffId, descriptionOfStuff, key, _stuffOrderCounter++);

            _stuffInInbox = _stuffInInbox.Add(stuffId, item);

            // the Client Model state has changed, so publish a "Dumb" UI event
            // to keep the contents of the UI current with the actual state of this model
            Publish(new Dumb.StuffAddedToInbox(item, _stuffInInbox.Count));
        }