I am trying to add an event handler for a static variable of a class and i
can't figure out how to do so since the class is never instantiated.
The wmp variable gets instantiated when my code calls one of my static
methods (not listed) for the first time. Any help is greatly appreciated
public class MediaHelper
{
private static WindowsMediaPlayer wmp = new WindowsMediaPlayerClass();
//I need to do this somewhere: wmp.PlayStateChange += new
Microsoft.MediaPlayer.Interop._WMPOCXEvents_PlaySt ateChangeEventHandler(Play
er_PlayStateChange);
private static void Player_PlayStateChange(int stateValue)
{string ss;
if( stateValue == 3)
ss = stateValue.ToString();
}
}