Hello,
i need to know, if my device is connected via gprs, active sync or whatever.
Always when the device gets disconnected, the system changes the icon for the "online-status" in the titlebar. Is it possible to use this event in my application too Or do you know another event-notification which fires an event, when the device gets connected or disconnected Is it also possible with OpenNetCF
Thanks

Online-Event
Monish Nagisetty
The MSDN documentation should provide enough info to figure out which property to use.
I'd try the SystemState.ConnectionsCount property.
Carlos Quintero MVP
CaRNaGe_46038
My test-code:
public class OnlineManager
{
private static int i = 0;
private static OnlineManager manager;
SystemState _connectionCount;
SystemState _activeSyncStat;
SystemState _cradlePresent;
private OnlineManager()
{
_connectionCount = new SystemState(SystemProperty.ConnectionsCount);
_connectionCount.Changed += new ChangeEventHandler(_connection_Changed);
_activeSyncStat = new SystemState(SystemProperty.ActiveSyncStatus);
_activeSyncStat.Changed += new ChangeEventHandler(_active_Sync_Stat);
_cradlePresent = new SystemState(SystemProperty.CradlePresent);
_cradlePresent.Changed += new ChangeEventHandler(_cradle_Present);
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("ConCount"+(i + 1).ToString() + ".txt", SystemState.ConnectionsCount.ToString());
i++;
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("Active" + (i + 1).ToString() + ".txt", SystemState.ActiveSyncStatus.ToString());
i++;
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("Cradle" + (i + 1).ToString() + ".txt", SystemState.CradlePresent.ToString());
i++;
}
void _cradle_Present(object sender, ChangeEventArgs args)
{
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("ConCountCC" + (i + 1).ToString() + ".txt", SystemState.ConnectionsCount.ToString());
i++;
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("ActiveCC" + (i + 1).ToString() + ".txt", SystemState.ActiveSyncStatus.ToString());
i++;
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("CradleCC" + (i + 1).ToString() + ".txt", SystemState.CradlePresent.ToString());
i++;
}
void _connection_Changed(object sender, ChangeEventArgs args)
{
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("ConCountPP" + (i + 1).ToString() + ".txt", SystemState.ConnectionsCount.ToString());
i++;
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("ActivePP" + (i + 1).ToString() + ".txt", SystemState.ActiveSyncStatus.ToString());
i++;
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("CradlePP" + (i + 1).ToString() + ".txt", SystemState.CradlePresent.ToString());
i++;
}
void _active_Sync_Stat(object sender, ChangeEventArgs args)
{
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("ConCountTT" + (i + 1).ToString() + ".txt", SystemState.ConnectionsCount.ToString());
i++;
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("ActiveTT" + (i + 1).ToString() + ".txt", SystemState.ActiveSyncStatus.ToString());
i++;
de.csc_dd.mBisProto.mBisProtoHelper.FileHelper.WriteFile("CradleTT" + (i + 1).ToString() + ".txt", SystemState.CradlePresent.ToString());
i++;
}
public static void Start()
{
if (manager == null)
manager = new OnlineManager();
}
}
The class works, because the 3 files in the constructor are written, but thats it. Do I have any mistakes in may code or...
Thanks
XNA Rockstar
Take a look at the Microsoft.WindowsMobile.Status
Alvin Kuiper
Thanks a lot