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; }
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)); }
public StuffInfo(ImmutableStuff stuff) { _stuff = stuff; }
public StuffRemovedFromInbox(ImmutableStuff stuffThatWasRemoved, int inboxCount) { Stuff = stuffThatWasRemoved; InboxCount = inboxCount; }
public StuffUpdated(ImmutableStuff stuff) { Stuff = stuff; }
public StuffAddedToInbox(ImmutableStuff stuffThatWasAdded, int inboxCount) { Stuff = stuffThatWasAdded; InboxCount = inboxCount; }
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)); }