public ListItem(NSCoder coder) { Text = (string)(NSString)coder.DecodeObject(ListItemEncodingTextKey); NSUuid uid = (NSUuid)coder.DecodeObject(ListItemEncodingUUIDKey); UID = new Guid(uid.GetBytes()); IsComplete = coder.DecodeBool(ListItemEncodingCompletedKey); }
public void Constructors() { TestRuntime.AssertXcodeVersion(4, 5); var uuid = new NSUuid(new byte [] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }); Assert.That(uuid, Is.Not.EqualTo(null), "constructed"); var bytes = uuid.GetBytes(); Assert.That(bytes.Length, Is.EqualTo(16), "lenght"); for (int i = 0; i < 16; i++) { Assert.That(bytes [i], Is.EqualTo(i), "value " + i); } }
public void Constructors() { if (!TestRuntime.CheckSystemAndSDKVersion(6, 0)) { Assert.Inconclusive("NSUUID is new in 6.0"); } var uuid = new NSUuid(new byte [] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }); Assert.That(uuid, Is.Not.EqualTo(null), "constructed"); var bytes = uuid.GetBytes(); Assert.That(bytes.Length, Is.EqualTo(16), "lenght"); for (int i = 0; i < 16; i++) { Assert.That(bytes [i], Is.EqualTo(i), "value " + i); } }
public static Uuid ToUuid(this NSUuid uuid) { var bytes = uuid.GetBytes(); return(Uuid.FromBE(bytes)); }
/// <summary> /// Converts an <see cref="NSUuid"/> into a <see cref="Guid"/>. /// </summary> /// <param name="id">The universal unique idenfier to be converted</param> /// <returns>Returns an <see cref="Guid"/></returns> internal static Guid ToWave(this NSUuid id) { return(new Guid(id.GetBytes())); }