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 MetadataTypeProxy GetMetadataType(SoapMetadataType soapMetadataType) { lock (_padlock) { if (_nodeTypes == null) { _nodeTypes = new Dictionary<Guid, MetadataTypeProxy>(); } MetadataTypeProxy nodeType; if (_nodeTypes.ContainsKey(soapMetadataType.Id)) { nodeType = _nodeTypes[soapMetadataType.Id]; } else { nodeType = new MetadataTypeProxy(soapMetadataType); _nodeTypes[soapMetadataType.Id] = nodeType; } return nodeType; } }
public static MetadataTypeProxy GetMetadataType(SoapMetadataType soapMetadataType) { lock (_padlock) { if (_nodeTypes == null) { _nodeTypes = new Dictionary <Guid, MetadataTypeProxy>(); } MetadataTypeProxy nodeType; if (_nodeTypes.ContainsKey(soapMetadataType.Id)) { nodeType = _nodeTypes[soapMetadataType.Id]; } else { nodeType = new MetadataTypeProxy(soapMetadataType); _nodeTypes[soapMetadataType.Id] = nodeType; } return(nodeType); } }
private void AddMetadataDialog_Closed(object sender, EventArgs e) { EditMetadataDialog dialog = sender as EditMetadataDialog; if (dialog != null && dialog.DialogResult.Value == true) { //only allow a key to go into the properties once if (!_changes.ContainsKey(dialog.MetadataName.ToLower())) { MetadataContext newContext = new MetadataContext(); newContext.MetadataName = dialog.MetadataName; newContext.NodeUid = NodeProxy.Id; SoapMetadata metadata = new SoapMetadata(); metadata.MetadataName = dialog.MetadataName; TypeManager typeManager = IoC.IoCContainer.GetInjectionInstance().GetInstance <TypeManager>(); IMetadataTypeProxy[] metaDataTypes = typeManager.GetAllMetadataTypes(); foreach (IMetadataTypeProxy metadataType in metaDataTypes) { if (metadataType.Id == dialog.MetadataTypeUid) { SoapMetadataType soapMetadataType = new SoapMetadataType(); soapMetadataType.Id = metadataType.Id; soapMetadataType.Name = metadataType.Name; metadata.MetadataType = soapMetadataType; break; } } metadata.MetadataValue = dialog.Value; MetadataViewModel newData = new MetadataViewModel(newContext, metadata); _changes[newData.OriginalMetadataName.ToLower()] = true; _metadata.Add(newData); _metadataNames.Add(newData.MetadataName); newData.PropertyChanged += new PropertyChangedEventHandler(model_PropertyChanged); } else { MessageBox.Show("Metadata could not be added because the property name already existed", "Error Adding Metadata", MessageBoxButton.OK); } } }
private void AddMetadataDialog_Closed(object sender, EventArgs e) { EditMetadataDialog dialog = sender as EditMetadataDialog; if (dialog != null && dialog.DialogResult.Value == true) { //only allow a key to go into the properties once if (!_changes.ContainsKey(dialog.MetadataName.ToLower())) { MetadataContext newContext = new MetadataContext(); newContext.MetadataName = dialog.MetadataName; newContext.NodeUid = NodeProxy.Id; SoapMetadata metadata = new SoapMetadata(); metadata.MetadataName = dialog.MetadataName; TypeManager typeManager = IoC.IoCContainer.GetInjectionInstance().GetInstance<TypeManager>(); IMetadataTypeProxy[] metaDataTypes = typeManager.GetAllMetadataTypes(); foreach (IMetadataTypeProxy metadataType in metaDataTypes) { if (metadataType.Id == dialog.MetadataTypeUid) { SoapMetadataType soapMetadataType = new SoapMetadataType(); soapMetadataType.Id = metadataType.Id; soapMetadataType.Name = metadataType.Name; metadata.MetadataType = soapMetadataType; break; } } metadata.MetadataValue = dialog.Value; MetadataViewModel newData = new MetadataViewModel(newContext, metadata); _changes[newData.OriginalMetadataName.ToLower()] = true; _metadata.Add(newData); _metadataNames.Add(newData.MetadataName); newData.PropertyChanged += new PropertyChangedEventHandler(model_PropertyChanged); } else { MessageBox.Show("Metadata could not be added because the property name already existed", "Error Adding Metadata", MessageBoxButton.OK); } } }
public MetadataTypeProxy(SoapMetadataType soapMetadataType) { BaseSoapNodeType = soapMetadataType; }