Ejemplo n.º 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;
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 3
0
 public StuffInfo(ImmutableStuff stuff)
 {
     _stuff = stuff;
 }
Ejemplo n.º 4
0
 public StuffRemovedFromInbox(ImmutableStuff stuffThatWasRemoved, int inboxCount)
 {
     Stuff      = stuffThatWasRemoved;
     InboxCount = inboxCount;
 }
Ejemplo n.º 5
0
 public StuffUpdated(ImmutableStuff stuff)
 {
     Stuff = stuff;
 }
Ejemplo n.º 6
0
 public StuffAddedToInbox(ImmutableStuff stuffThatWasAdded, int inboxCount)
 {
     Stuff      = stuffThatWasAdded;
     InboxCount = inboxCount;
 }
Ejemplo n.º 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));
        }