public void DisplayPropertyPage( IntPtr parentWindow )
{
// check source
if ( ( deviceMoniker == null ) || ( deviceMoniker == string.Empty ) )
throw new ArgumentException( "Video source is not specified." );
lock ( sync )
{
if ( IsRunning )
{
// pass the request to backgroud thread if video source is running
parentWindowForPropertyPage = parentWindow;
needToDisplayPropertyPage = true;
return;
}
object tempSourceObject = null;
// create source device's object
try
{
tempSourceObject = FilterInfo.CreateFilter( deviceMoniker );
}
catch
{
throw new ApplicationException( "Failed creating device object for moniker." );
}
if ( !( tempSourceObject is ISpecifyPropertyPages ) )
{
throw new NotSupportedException( "The video source does not support configuration property page." );
}
DisplayPropertyPage( parentWindow, tempSourceObject );
Marshal.ReleaseComObject( tempSourceObject );
}
}