示例#1
0
        private void OnAddNodeCompletedNodeArgs(object sender, AddedNodeEventArgs e)
        {
            NodesEventArgs nodesEventArgs = new NodesEventArgs(null, e.Node, (INodeProxy[])null);

            ConnectNodeToMap(e.Node.Id, e.Location); //the event of the connect will add it to the map

            if (AddNodeCompleted != null)
            {
                AddNodeCompleted.Invoke(this, e);
            }
        }
        private void OnAddNodeAsyncCompleted(object sender, AddNodeCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                SoapNode   soapNode  = e.Result;
                INodeProxy nodeProxy = new NodeProxy(soapNode);

                if (AddNodeCompleted != null)
                {
                    Point location = new Point(0, 0);
                    if (e.UserState != null)
                    {
                        location = ((MapLocationState)e.UserState).Location;
                    }
                    AddedNodeEventArgs anea = new AddedNodeEventArgs(nodeProxy, location);
                    AddNodeCompleted.Invoke(sender, anea);
                }
            }
        }