public void Execute(UnpairDeviceOptions opts) { if (!string.IsNullOrEmpty(opts.Mac)) { UnpairByMac(opts.Mac); } else { UnpairByName(opts.DeviceName); } }
public static void Execute(UnpairDeviceOptions opts) { if (!string.IsNullOrEmpty(opts.Mac)) { UnpairByMac(new MacAddress(opts.Mac), opts.DiscoveryTime, opts.Type); } else if (!string.IsNullOrEmpty(opts.DeviceName)) { UnpairByName(opts.DeviceName, opts.DiscoveryTime, opts.Type); } else { throw new Exception("Mac or device name must be specified"); } }