本文整理汇总了C#中OscMessage.GetBytes方法的典型用法代码示例。如果您正苦于以下问题:C# OscMessage.GetBytes方法的具体用法?C# OscMessage.GetBytes怎么用?C# OscMessage.GetBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OscMessage
的用法示例。
在下文中一共展示了OscMessage.GetBytes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestLong
public void TestLong()
{
long num = 123456789012345;
var msg = new OscMessage("/test/1", num);
var bytes = msg.GetBytes();
var msg2 = (OscMessage)OscPacket.GetPacket(bytes);
Assert.AreEqual(num, msg2.Arguments[0]);
}
示例2: TestDouble
public void TestDouble()
{
double val = 1234567.2324521e36;
var msg = new OscMessage("/test/1", val);
var bytes = msg.GetBytes();
var msg2 = (OscMessage)OscPacket.GetPacket(bytes);
Assert.AreEqual(val, ((double)msg2.Arguments[0]));
}
示例3: TestBlob
public void TestBlob()
{
var blob = new byte[5] { 23, 65, 255, 12, 6 };
var msg = new OscMessage("/test/1", blob);
var bytes = msg.GetBytes();
var msg2 = (OscMessage)OscPacket.GetPacket(bytes);
Assert.AreEqual(blob, ((byte[])msg2.Arguments[0]));
}
示例4: TestTimetag
public void TestTimetag()
{
var val = DateTime.Now;
var tag = new Timetag(val);
var msg = new OscMessage("/test/1", tag);
var bytes = msg.GetBytes();
var msg2 = (OscMessage)OscPacket.GetPacket(bytes);
Assert.AreEqual(tag.Tag, ((Timetag)msg2.Arguments[0]).Tag);
}
示例5: TestNoAddress
public void TestNoAddress()
{
var msg = new OscMessage("", 9999, 24.24f);
var bytes = msg.GetBytes();
var msg2 = (OscMessage)OscPacket.GetPacket(bytes);
Assert.AreEqual("", msg2.Address);
Assert.AreEqual(9999, msg2.Arguments[0]);
Assert.AreEqual(24.24f, msg2.Arguments[1]);
}
示例6: TestArray
public void TestArray()
{
var list = new List<object>() {23, true, "hello world" };
var msg = new OscMessage("/test/1", 9999, list, 24.24f);
var bytes = msg.GetBytes();
var msg2 = (OscMessage)OscPacket.GetPacket(bytes);
Assert.AreEqual(9999, msg2.Arguments[0]);
Assert.AreEqual(list, msg2.Arguments[1]);
Assert.AreEqual(list.Count, ((List<object>)(msg2.Arguments[1])).Count);
Assert.AreEqual(24.24f, msg2.Arguments[2]);
}