[smuxi: 2/3] Engine: support value types for MessageBuilder.AppendFormat() params



commit 890eebcad305eabc599f29a444272db34df3b53d
Author: Mirco Bauer <meebey meebey net>
Date:   Mon Jan 12 23:06:40 2015 +0100

    Engine: support value types for MessageBuilder.AppendFormat() params

 src/Engine/Messages/MessageBuilder.cs |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/Engine/Messages/MessageBuilder.cs b/src/Engine/Messages/MessageBuilder.cs
index 83598c2..7e6851d 100644
--- a/src/Engine/Messages/MessageBuilder.cs
+++ b/src/Engine/Messages/MessageBuilder.cs
@@ -719,6 +719,8 @@ namespace Smuxi.Engine
                             foreach (var part in ((MessageModel) placeMe).MessageParts) {
                                 parts.Add(part);
                             }
+                        } else if (placeMe.GetType().IsValueType) {
+                            parts.Add(CreateText(placeMe.ToString()));
                         } else {
                             // no idea how to format this
                             throw new System.FormatException("unknown object type to format: " + 
placeMe.GetType().ToString());


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]