Use UnbindFrom()

This commit is contained in:
smoogipoo 2018-12-10 13:48:10 +09:00
parent 41c7d10dff
commit be3a912d0b
2 changed files with 23 additions and 15 deletions

View File

@ -54,19 +54,24 @@ namespace osu.Game.Screens.Multi.Components
private Room room;
public Room Room
{
get { return room; }
get => room;
set
{
if (value == room) return;
room = value;
if (value == room)
return;
nameBind.UnbindBindings();
hostBind.UnbindBindings();
statusBind.UnbindBindings();
typeBind.UnbindBindings();
beatmapBind.UnbindBindings();
maxParticipantsBind.UnbindBindings();
participantsBind.UnbindBindings();
if (room != null)
{
nameBind.UnbindFrom(room.Name);
hostBind.UnbindFrom(room.Host);
statusBind.UnbindFrom(room.Status);
typeBind.UnbindFrom(room.Type);
beatmapBind.UnbindFrom(room.Beatmap);
maxParticipantsBind.UnbindFrom(room.MaxParticipants);
participantsBind.UnbindFrom(room.Participants);
}
room = value;
if (room != null)
{

View File

@ -190,12 +190,15 @@ namespace osu.Game.Screens.Multi.Components
if (room == value)
return;
room = value;
if (room != null)
{
nameBind.UnbindFrom(room.Name);
availabilityBind.UnbindFrom(room.Availability);
typeBind.UnbindFrom(room.Type);
maxParticipantsBind.UnbindFrom(room.MaxParticipants);
}
nameBind.UnbindBindings();
availabilityBind.UnbindBindings();
typeBind.UnbindBindings();
maxParticipantsBind.UnbindBindings();
room = value;
if (room != null)
{