public T GetAttributeValue <T>(string name) { IProcessArtifact attribute = this.Attributes[name]; object value = attribute.Data; return((T)value); }
public object GetAttributeValue(string name) { IProcessArtifact attribute = this.Attributes[name]; var value = Convert.ChangeType(attribute.Data, attribute.DataType); return(value); }
private void AddOrUpdateAttribute(string name, object value) { IProcessArtifact attribute = null; try { attribute = this.GetAttribute(name); } catch (Exception exception) { } finally { }// [NOTE] - no need to handle exception; this is a guard; if (attribute != null) { this.Attributes.TryRemove(name, out attribute); // delete existing attribute to remake it; simpler than updating generic types; } this.Attributes.TryAdd(name, ProcessArtifact.Create(name, value)); }