public static Guid? GetIDFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); byte[] value = null; if (atom != null && atom.TryGetBytes(out value) && value.Length==16) { return ByteArrayToID(value); } else { return null; } }
public static ushort? GetUShortFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); ushort value = 0; if (atom != null && atom.TryGetUInt16(out value)) { return value; } else { return null; } }
public static byte? GetByteFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); byte value = 0; if (atom != null && atom.TryGetByte(out value)) { return value; } else { return null; } }
public static int? GetIntFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); int value = 0; if (atom != null && atom.TryGetInt32(out value)) { return value; } else { return null; } }
public static IAtomCollection GetCollectionFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); if (atom != null && atom.HasChildren) { return(atom.Children); } else { return(null); } }
public static byte?GetByteFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); byte value = 0; if (atom != null && atom.TryGetByte(out value)) { return(value); } else { return(null); } }
public static Guid?GetIDFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); byte[] value = null; if (atom != null && atom.TryGetBytes(out value) && value.Length == 16) { return(ByteArrayToID(value)); } else { return(null); } }
public static int?GetIntFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); int value = 0; if (atom != null && atom.TryGetInt32(out value)) { return(value); } else { return(null); } }
public static ushort?GetUShortFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); ushort value = 0; if (atom != null && atom.TryGetUInt16(out value)) { return(value); } else { return(null); } }
public static IPAddress GetIPAddressFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); IPAddress value = null; if (atom != null && atom.TryGetIPAddress(out value)) { return(value); } else { return(null); } }
public static string GetStringFrom(IAtomCollection collection, ID4 name) { string res = null; var atom = collection.FindByName(name); if (atom != null && atom.TryGetString(out res)) { return(res); } else { return(null); } }
public static ID4?GetID4From(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); byte[] value = null; if (atom != null && atom.TryGetBytes(out value) && value.Length == 4) { return(new ID4(value)); } else { return(null); } }
public static IAtomCollection GetCollectionFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); if (atom != null && atom.HasChildren) { return atom.Children; } else { return null; } }
public static Atom GetAtomFrom(IAtomCollection collection, ID4 name) { return(collection.FindByName(name)); }
public static ID4? GetID4From(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); byte[] value = null; if (atom != null && atom.TryGetBytes(out value) && value.Length==4) { return new ID4(value); } else { return null; } }
public static Atom GetAtomFrom(IAtomCollection collection, ID4 name) { return collection.FindByName(name); }
public static string GetStringFrom(IAtomCollection collection, ID4 name) { string res = null; var atom = collection.FindByName(name); if (atom != null && atom.TryGetString(out res)) { return res; } else { return null; } }
public static IPAddress GetIPAddressFrom(IAtomCollection collection, ID4 name) { var atom = collection.FindByName(name); IPAddress value = null; if (atom != null && atom.TryGetIPv4Address(out value)) { return value; } else { return null; } }