private void Config() { int hr = 0; IAnalogTVTuningSpace ts = (IAnalogTVTuningSpace) new AnalogTVTuningSpace(); ITuneRequest tr = null; hr = ts.put_CountryCode(33); DsError.ThrowExceptionForHR(hr); hr = ts.put_InputType(TunerInputType.Cable); DsError.ThrowExceptionForHR(hr); hr = ts.put_MaxChannel(50); DsError.ThrowExceptionForHR(hr); hr = ts.put_MinChannel(5); DsError.ThrowExceptionForHR(hr); hr = ts.CreateTuneRequest(out tr); DsError.ThrowExceptionForHR(hr); channelTR = (IChannelTuneRequest)tr; Marshal.ReleaseComObject(ts); }
private void TestMaxChannel() { int hr = 0; int maxCh = 0; hr = analogTVTS.put_MaxChannel(50); DsError.ThrowExceptionForHR(hr); hr = analogTVTS.get_MaxChannel(out maxCh); DsError.ThrowExceptionForHR(hr); Debug.Assert(maxCh == 50, "IAnalogTVTuningSpace.get_MaxChannel / put_MaxChannel"); hr = analogTVTS.put_MaxChannel(25); DsError.ThrowExceptionForHR(hr); hr = analogTVTS.get_MaxChannel(out maxCh); DsError.ThrowExceptionForHR(hr); Debug.Assert(maxCh == 25, "IAnalogTVTuningSpace.get_MaxChannel / put_MaxChannel"); }