public void ParseType(byte[] buf) { BinaryReader r = new BinaryReader(new MemoryStream(buf), Encoding.GetEncoding("iso-8859-1")); String t = new String(r.ReadChars(3)); TypeValue = (K3pType)Enum.Parse(typeof(K3pType), t); }
/// <summary> /// Return the name of the type specified. /// </summary> public static String GetTypeName(K3pType type) { switch (type) { case K3pType.INS: return("instruction"); case K3pType.INT: return("integer"); case K3pType.STR: return("string"); default: return("unknown type"); } }
/// <summary> /// Return the name of the type specified. /// </summary> public static String GetTypeName(K3pType type) { switch (type) { case K3pType.INS: return "instruction"; case K3pType.INT: return "integer"; case K3pType.STR: return "string"; default: return "unknown type"; } }