I'm using INetworkLoader3 to build a geometric network. I'd like to show progress on the UI.
It appears INetworkLoaderProgress is designed for this purpose, but I don't see how to use it.
Also I see INetworkLoaderProgress_Sinkhelper class (not interface), but again, no examples of using it.
Can someone post some code showing how to do this?
Thanks!
Solved! Go to Solution.
Hi Kirk,
I do not have a network dataset or the supporting objects to test this, but I believe what you want to do is cast your INetworkLoader3 object as INetworkLoaderProgress_Events and subscribe to the Step and PutMessage events. Inside the event-handlers is where you could presumably add your logic for updating the UI with progress info for the user.
For example:
INetworkLoader networkLoader = new NetworkLoaderClass();
(networkLoader as INetworkLoaderProgress_Event).Step += NetworkLoader_Step;
(networkLoader as INetworkLoaderProgress_Event).PutMessage += NetworkLoader_PutMessage;
protected void NetworkLoader_Step()
{
// Update UI here.
}
protected void NetworkLoader_PutMessage(esriNetworkLoaderProgress progress, string message)
{
// Update UI here.
}
Hi Kirk,
I do not have a network dataset or the supporting objects to test this, but I believe what you want to do is cast your INetworkLoader3 object as INetworkLoaderProgress_Events and subscribe to the Step and PutMessage events. Inside the event-handlers is where you could presumably add your logic for updating the UI with progress info for the user.
For example:
INetworkLoader networkLoader = new NetworkLoaderClass();
(networkLoader as INetworkLoaderProgress_Event).Step += NetworkLoader_Step;
(networkLoader as INetworkLoaderProgress_Event).PutMessage += NetworkLoader_PutMessage;
protected void NetworkLoader_Step()
{
// Update UI here.
}
protected void NetworkLoader_PutMessage(esriNetworkLoaderProgress progress, string message)
{
// Update UI here.
}