public static string GetName(this IPeripheral @this) { var machine = @this.GetMachine(); var machineName = EmulationManager.Instance.CurrentEmulation[machine]; return($"{machineName}.{machine.GetLocalName(@this)}"); }
public static Endianess GetEndianness(this IPeripheral @this, Endianess?defaultEndianness = null) { var endianessAttributes = @this.GetType().GetCustomAttributes(typeof(EndianessAttribute), true); if (endianessAttributes.Length != 0) { return(((EndianessAttribute)endianessAttributes[0]).Endianess); } else if (defaultEndianness == null) { return(@this.GetMachine().SystemBus.Endianess); } else { return(defaultEndianness.Value); } }