Feature #7: AC Adapter Device Detail

This commit is contained in:
Gary Sharp
2013-10-29 13:30:41 +11:00
parent 94c7cae443
commit df633b3591
7 changed files with 221 additions and 11 deletions
@@ -63,7 +63,16 @@ namespace Disco.BI.Extensions
}
if (detail.Value != Value)
detail.Value = Value;
{
if (Value == null)
{
device.DeviceDetails.Remove(detail);
}
else
{
detail.Value = Value;
}
}
}
#endregion
@@ -105,5 +114,24 @@ namespace Disco.BI.Extensions
}
#endregion
#region ACAdapter
public const string KeyACAdapter = "ACAdapter";
/// <summary>
/// Gets the ACAdapter Device Detail Value
/// </summary>
/// <returns>The ACAdapter or null</returns>
public static string ACAdapter(this IEnumerable<DeviceDetail> details)
{
return details.GetDetail(ScopeHardware, KeyACAdapter);
}
/// <summary>
/// Sets the ACAdapter Device Detail Value
/// </summary>
public static void ACAdapter(this IEnumerable<DeviceDetail> details, Device device, string ACAdapter)
{
device.SetDetail(ScopeHardware, KeyACAdapter, ACAdapter);
}
#endregion
}
}