// ReSharper restore InconsistentNaming #endregion #region Methods internal static string GetAPIName(this SteelSeriesDeviceType deviceType) { if (!_deviceTypeNames.TryGetValue(deviceType, out string apiName)) { _deviceTypeNames.Add(deviceType, apiName = GetAPIName(typeof(SteelSeriesDeviceType), deviceType)); } return(apiName); }
/// <summary> /// Internal constructor of managed <see cref="SteelSeriesRGBDeviceInfo"/>. /// </summary> /// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param> /// <param name="model">The represented device model.</param> /// <param name="deviceCaps">The lighting-capabilities of the device.</param> /// <param name="imageLayout">The layout used to decide which images to load.</param> /// <param name="layoutPath">The path/name of the layout-file.</param> internal SteelSeriesRGBDeviceInfo(RGBDeviceType deviceType, string model, SteelSeriesDeviceType steelSeriesDeviceType, string imageLayout, string layoutPath) { this.DeviceType = deviceType; this.Model = model; this.SteelSeriesDeviceType = steelSeriesDeviceType; this.ImageLayout = imageLayout; this.LayoutPath = layoutPath; DeviceName = $"{Manufacturer} {Model}"; }
public SteelSeriesHIDDevice(int pid, string name, string deviceClass, int leds, string image, SteelSeriesDeviceType ssDeviceType, Dictionary <LedId, SteelSeriesLedId> map) { PID = pid; Name = name; DeviceClass = deviceClass; NumberOfLeds = leds; SteelSeriesDeviceType = ssDeviceType; Mapping = map; Assembly myAssembly = Assembly.GetExecutingAssembly(); using (Stream myStream = myAssembly.GetManifestResourceStream("SteelSeriesSLSProvider." + image + ".png")) { if (myStream != null) { Image = (Bitmap)System.Drawing.Image.FromStream(myStream); } } }