public bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition) { // First, look in the built-ins. tupleDefinition = TupleDefinitions.ByName(name); if (tupleDefinition == null) { if (this.ExtensionData == null) { this.LoadExtensionData(); } // Second, look in the extensions. foreach (var data in this.ExtensionData) { if (data.TryGetTupleDefinitionByName(name, out tupleDefinition)) { break; } } // Finally, look in the custom tuple definitions provided during an intermediate load. if (tupleDefinition == null) { this.CustomDefinitionByName.TryGetValue(name, out tupleDefinition); } } return(tupleDefinition != null); }
public void CanCreateFileTupleByName() { var tuple = TupleDefinitions.ByName("File").CreateTuple(); Assert.IsType <FileTuple>(tuple); Assert.Same(TupleDefinitions.File, tuple.Definition); }