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 TestCountryCode() { int hr = 0; int countryCode = 0; hr = analogTVTS.put_CountryCode(33); DsError.ThrowExceptionForHR(hr); hr = analogTVTS.get_CountryCode(out countryCode); DsError.ThrowExceptionForHR(hr); Debug.Assert(countryCode == 33, "IAnalogTVTuningSpace.get_CountryCode / put_CountryCode"); hr = analogTVTS.put_CountryCode(1); DsError.ThrowExceptionForHR(hr); hr = analogTVTS.get_CountryCode(out countryCode); DsError.ThrowExceptionForHR(hr); Debug.Assert(countryCode == 1, "IAnalogTVTuningSpace.get_CountryCode / put_CountryCode"); }