/// <summary> /// Create an instance of the specified type, adding it to the Instances collection. /// </summary> public IRuntimeSemanticType Create(string typeName, IRuntimeSemanticType parent = null) { Assert.That(SemanticTypes.ContainsKey(typeName), "The semantic type " + typeName + " has not been declared."); IRuntimeSemanticType t = (IRuntimeSemanticType)CompiledAssembly.CreateInstance("SemanticTypes." + typeName); t.Initialize(this); Guid guid = Guid.NewGuid(); // We create a unique key for this instance. Instances[guid] = (new SemanticTypeInstance() { Name = typeName, Instance = t, Parent = parent, Key = guid, Definition = SemanticTypes[typeName] }); NewSemanticType.Fire(this, new NewSemanticTypeEventArgs(t)); return(t); }
public bool VerifyProtocolExists(string protocol) { return(SemanticTypes.ContainsKey(protocol)); }
public ISemanticTypeStruct GetSemanticTypeStruct(string typeName) { Assert.That(SemanticTypes.ContainsKey(typeName), "The semantic type " + typeName + " has not been declared."); return(SemanticTypes[typeName].Struct); }