The more I try to get done, the more frustrated I become! I must be doing something wrong. I'm using the C# version (IntelMobileCLR.dll) in a Windows Forms project (on VMWare Workstation 5.5, Windows Server 2003/SP1). I'm using almost identical code to the DelegateEventSample, yet no event ever fires. I know that the underlying mechanism works since the C# Information Viewer (SDK tool) and the sample C# project (DelegateEventSample) both respond to events properly. My code is as follows:
class MainForm : Form
{
CapabilityClass myCapabilities = new CapabilityClass();
ConnectivityInstance myConnectivity;
public MainForm()
{
myConnectivity = (ConnectivityInstance)
myCapabilities.GetInstance("Connectivity");
DelegateObserver.ObserverNotifyDelegate del = new
DelegateObserver.ObserverNotifyDelegate(
ConnectedEventHandler);
Observer connectedChangeObsvr = new DelegateObserver(del);
Is there any limitation from Windows Forms? To test it, I enable and disable the adapter from VMWare. As I mentioned, it fires the event in the sample and the included SDK tool -- just not in my code.
Hooray! Another one to clear as fixed! My mistake. This was in the SDK documentation, I just missed it, being focused on the actual objects, methods, and properties. Thanks for responding!
Mobile SDK: Events
The more I try to get done, the more frustrated I become! I must be doing something wrong. I'm using the C# version (IntelMobileCLR.dll) in a Windows Forms project (on VMWare Workstation 5.5, Windows Server 2003/SP1). I'm using almost identical code to the DelegateEventSample, yet no event ever fires. I know that the underlying mechanism works since the C# Information Viewer (SDK tool) and the sample C# project (DelegateEventSample) both respond to events properly. My code is as follows:
class MainForm : Form
{
CapabilityClass myCapabilities = new CapabilityClass();
ConnectivityInstance myConnectivity;
public MainForm()
{
myConnectivity = (ConnectivityInstance)
myCapabilities.GetInstance("Connectivity");
DelegateObserver.ObserverNotifyDelegate del = new
DelegateObserver.ObserverNotifyDelegate(
ConnectedEventHandler);
Observer connectedChangeObsvr = new DelegateObserver(del);
myConnectivity.Connect.AddObserver(connectedChangeObsvr);
myConnectivity.Disconnect.AddObserver(connectedChangeObsvr);
...
}
private void ConnectedEventHandler(Event e)
{
...
}
}
Is there any limitation from Windows Forms? To test it, I enable and disable the adapter from VMWare. As I mentioned, it fires the event in the sample and the included SDK tool -- just not in my code.
Your help is *very* much appreciated!!