/// <summary> /// Initializes a new instance of the <see cref="HomeController"/> class. /// </summary> /// <param name="context">The machine context.</param> /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="context"/> is <see langword="null" />. /// </exception> public HomeController(IProvideEnvironmentContext context) { { Lokad.Enforce.Argument(() => context); } m_Context = context; }
/// <summary> /// Initializes a new instance of the <see cref="OperatingSystemController"/> class. /// </summary> /// <param name="context">The environment context.</param> /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="context"/> is <see langword="null" />. /// </exception> public OperatingSystemController(IProvideEnvironmentContext context) { { Lokad.Enforce.Argument(() => context); } m_Context = context; }
private static void AddOperatingSystems(IProvideEnvironmentContext context, dynamic viewBag) { var operatingSystems = context.OperatingSystems().Select( c => new SelectListItem { Text = string.Format( CultureInfo.InvariantCulture, "{0} {1} - {2} - {3}", c.Name, c.ServicePack, c.PointerSize, c.CultureInfo), Value = c.Id.ToString(CultureInfo.InvariantCulture), }); viewBag.OperatingSystems = operatingSystems; }
private static void AddHostMachines(IProvideEnvironmentContext context, dynamic viewBag) { var hostMachines = context.PhysicalMachines().Select( c => new SelectListItem { Text = c.Name, Value = c.Id, }); viewBag.HostMachines = hostMachines; }