Beispiel #1
0
        public static DescriptorTypeProxy GetDescriptorType(SoapDescriptorType soapDescriptorType)
        {
            lock (_padlock)
            {
                if (_descriptorTypes == null)
                {
                    _descriptorTypes = new Dictionary <Guid, DescriptorTypeProxy>();
                }

                DescriptorTypeProxy descriptorType;

                if (_descriptorTypes.ContainsKey(soapDescriptorType.Id))
                {
                    descriptorType = _descriptorTypes[soapDescriptorType.Id];
                }
                else
                {
                    descriptorType = new DescriptorTypeProxy(soapDescriptorType);

                    _descriptorTypes[soapDescriptorType.Id] = descriptorType;
                }

                return(descriptorType);
            }
        }
        public void UpdateNodeMetadataAsync(Guid domainId, Guid nodeId, Guid relationshipId, IDescriptorTypeProxy descriptorTypeProxy, string metadataName, string metadataValue, IMetadataTypeProxy metadataType)
        {
            Guid soapRelationshipId = Guid.Empty;

            if (relationshipId != Guid.Empty)
            {
                soapRelationshipId = relationshipId;
            }

            SoapDescriptorType soapDescriptorType = null;

            if (descriptorTypeProxy != null)
            {
                soapDescriptorType = new SoapDescriptorType()
                {
                    Id = descriptorTypeProxy.Id, Name = descriptorTypeProxy.Name
                };
            }

            SoapMetadataType soapMetadataType = null;

            if (metadataType != null)
            {
                soapMetadataType = new SoapMetadataType()
                {
                    Id = metadataType.Id, Name = metadataType.Name
                };
            }

            Client.UpdateNodeMetadataAsync(domainId, nodeId, soapRelationshipId, soapDescriptorType, metadataName, metadataValue, soapMetadataType);
        }
        public static DescriptorTypeProxy GetDescriptorType(SoapDescriptorType soapDescriptorType)
        {
            lock (_padlock)
            {
                if (_descriptorTypes == null)
                {
                    _descriptorTypes = new Dictionary<Guid, DescriptorTypeProxy>();
                }

                DescriptorTypeProxy descriptorType;

                if (_descriptorTypes.ContainsKey(soapDescriptorType.Id))
                {
                    descriptorType = _descriptorTypes[soapDescriptorType.Id];
                }
                else
                {
                    descriptorType = new DescriptorTypeProxy(soapDescriptorType);

                    _descriptorTypes[soapDescriptorType.Id] = descriptorType;
                }

                return descriptorType;
            }
        }
Beispiel #4
0
        public DescriptorProxy(Guid nodeId, SoapDescriptorType descriptorType, IRelationshipProxy relationship, SoapRelationship soapRelationship)
        {
            Relationship = relationship;

            NodeId = nodeId;

            DescriptorType = DescriptorTypeProxy.GetDescriptorType(descriptorType);
        }
Beispiel #5
0
        public DescriptorProxy(Guid nodeId, SoapDescriptorType descriptorType, IRelationshipProxy relationship, SoapRelationship soapRelationship)
        {
            Relationship = relationship;

            NodeId = nodeId;

            DescriptorType = DescriptorTypeProxy.GetDescriptorType(descriptorType);
        }
Beispiel #6
0
        public IDescriptorTypeProxy GetDescriptorType(SoapDescriptorType soapDescriptorType)
        {
            if (!IsInitialised)
            {
                throw new NotSupportedException("This type manager has not been initialised.");
            }

            return(_descriptorTypesById[soapDescriptorType.Id]);
        }
        protected SqlCommand CreateDescriptor(out Guid newDescriptorUid, SoapDescriptorType descriptorType, TransactionToken nodeUid, Guid relationshipUid)
        {
            SqlCommand createDescriptorCommand = new SqlCommand();
            createDescriptorCommand.CommandText = "INSERT INTO dbo.[Descriptors] (DescriptorUid, DescriptorTypeUid, NodeUid, RelationshipUid) VALUES (@DescriptorUid, @DescriptorTypeUid, @NodeUid, @RelationshipUid)";
            createDescriptorCommand.Connection = Connection;

            newDescriptorUid = Guid.NewGuid();

            createDescriptorCommand.Parameters.AddWithValue("@DescriptorUid", newDescriptorUid);
            createDescriptorCommand.Parameters.AddWithValue("@DescriptorTypeUid", descriptorType.Id);
            createDescriptorCommand.Parameters.AddWithValue("@NodeUid", nodeUid.GetValue());
            createDescriptorCommand.Parameters.AddWithValue("@RelationshipUid", relationshipUid);

            return createDescriptorCommand;
        }
Beispiel #8
0
        protected SqlCommand CreateDescriptor(out Guid newDescriptorUid, SoapDescriptorType descriptorType, TransactionToken nodeUid, Guid relationshipUid)
        {
            SqlCommand createDescriptorCommand = new SqlCommand();

            createDescriptorCommand.CommandText = "INSERT INTO dbo.[Descriptors] (DescriptorUid, DescriptorTypeUid, NodeUid, RelationshipUid) VALUES (@DescriptorUid, @DescriptorTypeUid, @NodeUid, @RelationshipUid)";
            createDescriptorCommand.Connection  = Connection;

            newDescriptorUid = Guid.NewGuid();

            createDescriptorCommand.Parameters.AddWithValue("@DescriptorUid", newDescriptorUid);
            createDescriptorCommand.Parameters.AddWithValue("@DescriptorTypeUid", descriptorType.Id);
            createDescriptorCommand.Parameters.AddWithValue("@NodeUid", nodeUid.GetValue());
            createDescriptorCommand.Parameters.AddWithValue("@RelationshipUid", relationshipUid);

            return(createDescriptorCommand);
        }
        public void RenameNodeMetadataAsync(Guid domainId, Guid nodeId, Guid relationshipId, IDescriptorTypeProxy descriptorTypeProxy, string originalMetadataName, string newMetadataName)
        {
            Guid soapRelationshipId = Guid.Empty;

            if (relationshipId != Guid.Empty)
            {
                soapRelationshipId = relationshipId;
            }

            SoapDescriptorType soapDescriptorType = null;

            if (descriptorTypeProxy != null)
            {
                soapDescriptorType = new SoapDescriptorType()
                {
                    Id = descriptorTypeProxy.Id, Name = descriptorTypeProxy.Name
                };
            }
            Client.RenameNodeMetadataAsync(domainId, nodeId, soapRelationshipId, soapDescriptorType, originalMetadataName, newMetadataName);
        }
        public void ConnectNodesAsync(Guid domainId, Dictionary <IDescriptorTypeProxy, Guid> nodes, IRelationshipTypeProxy relationshipType, Point location, string originalId)
        {
            Dictionary <SoapDescriptorType, Guid> soapNodes = new Dictionary <SoapDescriptorType, Guid>();

            foreach (KeyValuePair <IDescriptorTypeProxy, Guid> nodeDetails in nodes)
            {
                SoapDescriptorType soapDescriptorType = new SoapDescriptorType()
                {
                    Id = nodeDetails.Key.Id, Name = nodeDetails.Key.Name
                };
                soapNodes.Add(soapDescriptorType, nodeDetails.Value);
            }

            SoapRelationshipType soapRelationship = new SoapRelationshipType()
            {
                Id = relationshipType.Id, Name = relationshipType.Name
            };

            Client.ConnectNodesAsync(domainId, soapNodes, soapRelationship, originalId, location);
        }
Beispiel #11
0
        public IDescriptorTypeProxy GetDescriptorType(SoapDescriptorType soapDescriptorType)
        {
            if (!IsInitialised)
            {
                throw new NotSupportedException("This type manager has not been initialised.");
            }

            return _descriptorTypesById[soapDescriptorType.Id];
        }
        public void UpdateNodeMetadataAsync(Guid domainId, Guid nodeId, Guid relationshipId, IDescriptorTypeProxy descriptorTypeProxy, string metadataName, string metadataValue, IMetadataTypeProxy metadataType)
        {
            Guid soapRelationshipId = Guid.Empty;

            if (relationshipId != Guid.Empty)
            {
                soapRelationshipId = relationshipId;
            }

            SoapDescriptorType soapDescriptorType = null;

            if (descriptorTypeProxy != null)
            {
                soapDescriptorType = new SoapDescriptorType() { Id = descriptorTypeProxy.Id, Name = descriptorTypeProxy.Name };
            }

            SoapMetadataType soapMetadataType = null;

            if (metadataType != null)
            {
                soapMetadataType = new SoapMetadataType() { Id = metadataType.Id, Name = metadataType.Name };
            }

            Client.UpdateNodeMetadataAsync(domainId, nodeId, soapRelationshipId, soapDescriptorType, metadataName, metadataValue, soapMetadataType);
        }
        public void RenameNodeMetadataAsync(Guid domainId, Guid nodeId, Guid relationshipId, IDescriptorTypeProxy descriptorTypeProxy, string originalMetadataName, string newMetadataName)
        {
            Guid soapRelationshipId = Guid.Empty;

            if (relationshipId != Guid.Empty)
            {
                soapRelationshipId = relationshipId;
            }

            SoapDescriptorType soapDescriptorType = null;

            if (descriptorTypeProxy != null)
            {
                soapDescriptorType = new SoapDescriptorType() { Id = descriptorTypeProxy.Id, Name = descriptorTypeProxy.Name };
            }
            Client.RenameNodeMetadataAsync(domainId, nodeId, soapRelationshipId, soapDescriptorType, originalMetadataName, newMetadataName);
        }
        public void ConnectNodesAsync(Guid domainId, Dictionary<IDescriptorTypeProxy, Guid> nodes, IRelationshipTypeProxy relationshipType, Point location, string originalId)
        {
            Dictionary<SoapDescriptorType, Guid> soapNodes = new Dictionary<SoapDescriptorType, Guid>();

            foreach (KeyValuePair<IDescriptorTypeProxy, Guid> nodeDetails in nodes)
            {
                SoapDescriptorType soapDescriptorType = new SoapDescriptorType() { Id = nodeDetails.Key.Id, Name = nodeDetails.Key.Name };
                soapNodes.Add(soapDescriptorType, nodeDetails.Value);
            }

            SoapRelationshipType soapRelationship = new SoapRelationshipType() { Id = relationshipType.Id, Name = relationshipType.Name };

            Client.ConnectNodesAsync(domainId, soapNodes, soapRelationship, originalId, location);
        }
Beispiel #15
0
 public DescriptorTypeProxy(SoapDescriptorType soapDescriptorType)
 {
     BaseSoapDescriptorType = soapDescriptorType;
 }
 public DescriptorTypeProxy(SoapDescriptorType soapDescriptorType)
 {
     BaseSoapDescriptorType = soapDescriptorType;
 }