Beispiel #1
0
 public FriendSheetController(
     FriendSheetView friendSheetView,
     Friend friend
     ) : this(friendSheetView)
 {
     SetFriend(friend);
 }
Beispiel #2
0
        private void SetFriendValuesToView(FriendSheetView view, Friend friend)
        {
            DelViewEventHandlers(view);

            view.SetName(friend.Name);
            view.SetDietary(friend.DietaryRestrictions);
            view.SetCanDrink(friend.CanDrink);

            AddViewEventHandlers(view);
        }
Beispiel #3
0
        public FriendSheetController(FriendSheetView friendSheetView)
        {
            this.view = friendSheetView ?? throw new ArgumentNullException();

            lock (friendLock)
            {
                this.friend = new Friend();

                this.data = SerializeFriend(this.friend);

                SetFriendValuesToView(this.view, this.friend);
            }
        }
Beispiel #4
0
 private void DelViewEventHandlers(FriendSheetView view)
 {
     view.NameChanged     -= new EventHandler(TextBoxName_SaveToFriend);
     view.DietaryChanged  -= new EventHandler(RadioButtonDietary_SaveToFriend);
     view.CanDrinkChanged -= new EventHandler(RadioButtonCanDrink_SaveToFriend);
 }