Exemple #1
0
        public void NodesAndRelationshipBuildEventArgs(Proxy.NodesEventArgs eventArgs, IDictionary <Guid, ServerObjects.Node> nodes, IDictionary <Guid, ServerObjects.Relationship> relationships)
        {
            foreach (ServerObjects.Node serviceNode in nodes.Values)
            {
                Proxy.INode proxyNode = NodeManager.FindNode(serviceNode);

                eventArgs.Nodes.Add(proxyNode.Id, proxyNode);
            }

            foreach (ServerObjects.Relationship serviceRelationship in relationships.Values)
            {
                RelationshipManager.CreateRelationship(serviceRelationship);
            }

            foreach (ServerObjects.Node serviceNode in nodes.Values)
            {
                Proxy.INode proxyNode = NodeManager.FindNode(serviceNode);

                SoapNode soapNode = proxyNode as SoapNode;

                /// Not all the nodes that are stored in the NodeManager are SoapNodes, some are FacadeNodes. In this scenario we want to check if they have an inner SoapNode and use that instead.
                if (soapNode == null)
                {
                    if (proxyNode is FacadeNode)
                    {
                        FacadeNode facadeNode = proxyNode as FacadeNode;
                        soapNode = facadeNode.BaseNode as SoapNode;
                    }
                }

                if (soapNode != null)
                {
                    soapNode.LoadNode(RelationshipManager);
                }
            }

            foreach (ServerObjects.Relationship serviceRelationship in relationships.Values)
            {
                Proxy.IRelationship proxyRelationship = RelationshipManager.FindRelationship(serviceRelationship);

                SoapRelationship soapRelationship = proxyRelationship as SoapRelationship;

                /// Not all the relationships that are stored in the RelationshipManager are SoapRelationships, some are FacadeRelationships. In this scenario we want to check if they have an inner SoapRelationship and use that instead.
                if (soapRelationship == null)
                {
                    if (proxyRelationship is FacadeRelationship)
                    {
                        FacadeRelationship facadeRelationship = proxyRelationship as FacadeRelationship;
                        soapRelationship = facadeRelationship.BaseRelationship as SoapRelationship;
                    }
                }

                if (soapRelationship != null)
                {
                    soapRelationship.LoadRelationship(NodeManager);
                }
            }
        }
        private void OnCreateNewDomainCompleted(object sender, CreateNewDomainCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                SoapNode domainNode = e.Result;

                ReturnedNodesEventArgs eventArgs = new ReturnedNodesEventArgs();
                eventArgs.SearchedNode = e.Result.Domain;
                eventArgs.Nodes        = new INodeProxy[] { new NodeProxy(e.Result) };

                if (CreateNewDomainCompleted != null)
                {
                    CreateNewDomainCompleted.Invoke(this, eventArgs);
                }
            }
        }
        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);
                }
            }
        }
Exemple #4
0
 public NodeProxy(SoapNode node)
     : this()
 {
     BaseSoapNode = node;
 }
Exemple #5
0
 public NodeProxy(SoapNode node)
     : this()
 {
     BaseSoapNode = node;
 }