1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Give this class a constructor to make sure that message data will always assigned.

This commit is contained in:
andy840119 2022-08-03 23:17:09 +08:00
parent 8d175bc402
commit 8b02c955d8

View File

@ -37,17 +37,19 @@ namespace osu.Desktop.LegacyIpc
public new object Value
{
get => base.Value;
set => base.Value = new Data
{
MessageType = value.GetType().Name,
MessageData = value
};
set => base.Value = new Data(value.GetType().Name, value);
}
public class Data
{
public string MessageType { get; set; } = string.Empty;
public object MessageData { get; set; } = default!;
public Data(string messageType, object messageData)
{
MessageType = messageType;
MessageData = messageData;
}
public string MessageType { get; set; }
public object MessageData { get; set; }
}
}
}