Remove C# 7 pattern match

This commit is contained in:
Frank A. Krueger 2018-03-02 22:06:46 -08:00
parent 99b229ebed
commit 730b254f6e
No known key found for this signature in database
GPG Key ID: 0471C67474FFE664
2 changed files with 8 additions and 5 deletions

View File

@ -36,8 +36,10 @@ namespace Ooui
{ {
if (message.TargetId == Id) { if (message.TargetId == Id) {
switch (message.MessageType) { switch (message.MessageType) {
case MessageType.Call when message.Key == "getContext" && message.Value is Array a && a.Length == 1 && "2d".Equals (a.GetValue (0)): case MessageType.Call:
AddStateMessage (message); if (message.Key == "getContext" && message.Value is Array a && a.Length == 1 && "2d".Equals (a.GetValue (0))) {
AddStateMessage (message);
}
break; break;
} }
} }

View File

@ -124,6 +124,7 @@ namespace Ooui
protected override bool SaveStateMessageIfNeeded (Message message) protected override bool SaveStateMessageIfNeeded (Message message)
{ {
if (message.TargetId == Id) { if (message.TargetId == Id) {
var handled = false;
switch (message.MessageType) { switch (message.MessageType) {
case MessageType.Call when message.Key == "insertBefore": case MessageType.Call when message.Key == "insertBefore":
AddStateMessage (message); AddStateMessage (message);
@ -150,9 +151,9 @@ namespace Ooui
} }
}); });
break; break;
default: }
base.SaveStateMessageIfNeeded (message); if (!handled) {
break; base.SaveStateMessageIfNeeded (message);
} }
return true; return true;
} }