How do I subscribe to INetworkLoaderProgress using .NET?

580
1
Jump to solution
08-09-2014 07:16 AM
Highlighted
Regular Contributor

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!

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Occasional Contributor II

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.

}

View solution in original post

Reply
0 Kudos
1 Reply
Highlighted
Occasional Contributor II

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.

}

View solution in original post

Reply
0 Kudos