From d14b4e658c1fda150cfcff264f58a5d0d5241247 Mon Sep 17 00:00:00 2001 From: Miguel Poeira Date: Tue, 13 Dec 2016 17:32:26 +0000 Subject: [PATCH 1/3] Fixing Array Writing --- src/Protocol/MessageWriter.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Protocol/MessageWriter.cs b/src/Protocol/MessageWriter.cs index 11f5329..62489e1 100644 --- a/src/Protocol/MessageWriter.cs +++ b/src/Protocol/MessageWriter.cs @@ -340,8 +340,13 @@ public void Write (object val) } Type type = val.GetType (); - - WriteVariant (type, val); + + if (type.IsArray) { + Write(type, val); + } + else{ + WriteVariant (type, val); + } } public void WriteVariant (Type type, object val) From f7dbfc28f2395e65bf6cf5961ba57aa2713e8715 Mon Sep 17 00:00:00 2001 From: Miguel Poeira Date: Tue, 13 Dec 2016 18:10:44 +0000 Subject: [PATCH 2/3] Added TODO to reflect a temporary fix --- src/Protocol/MessageWriter.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Protocol/MessageWriter.cs b/src/Protocol/MessageWriter.cs index 62489e1..9dadc3e 100644 --- a/src/Protocol/MessageWriter.cs +++ b/src/Protocol/MessageWriter.cs @@ -341,6 +341,8 @@ public void Write (object val) Type type = val.GetType (); + //TODO: Take a look at TypeImplementer + // and understand why does this happens if (type.IsArray) { Write(type, val); } From 2b38f933cd45df87f9e5e76bdc379488b5730fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Laval?= Date: Sat, 7 Oct 2017 13:20:29 -0400 Subject: [PATCH 3/3] Style fixes --- src/Protocol/MessageWriter.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Protocol/MessageWriter.cs b/src/Protocol/MessageWriter.cs index 9dadc3e..a70672b 100644 --- a/src/Protocol/MessageWriter.cs +++ b/src/Protocol/MessageWriter.cs @@ -341,14 +341,12 @@ public void Write (object val) Type type = val.GetType (); - //TODO: Take a look at TypeImplementer - // and understand why does this happens - if (type.IsArray) { - Write(type, val); - } - else{ + // TODO: workaround issue with array being written as variant + // See PR for context: https://github.com/mono/dbus-sharp/pull/58 + if (type.IsArray) + Write (type, val); + else WriteVariant (type, val); - } } public void WriteVariant (Type type, object val)