/// <summary> /// Creates the associations and populates the new dictionary with the associations instances created using the configuration <paramref name="configuration"/>. /// </summary> /// <param name="configuration">The configuration used to populate the collection.</param> /// <param name="bindingFactory">The binding factory responsible to create and return <see cref="IBinding"/> instance for each association.</param> /// <param name="encodingFactory">The encoding factory responsible to updated the created <see cref="IBinding"/> by provisioning all information necessary for encoding/decoding including <see cref="IValueConverter"/>.</param> /// <returns>New dictionary of type <see cref="AssociationsCollection"/>.</returns> /// <exception cref="System.ArgumentOutOfRangeException">Alias; Alias of any <see cref="Association"/> must be unique.</exception> internal static AssociationsCollection CreateAssociations(DataSetConfiguration[] configuration, IBindingFactory bindingFactory, IEncodingFactory encodingFactory) { AssociationsCollection _collection = new AssociationsCollection(); Association _newAssociation = null; foreach (DataSetConfiguration _dataSet in configuration) { if (_collection.ContainsKey(_dataSet.AssociationName)) { throw new ArgumentOutOfRangeException("Alias", "Alias of any Association must be unique"); } SemanticData _newSemanticData = new SemanticData(new Uri(_dataSet.InformationModelURI), _dataSet.DataSymbolicName, null, _dataSet.Id); switch (_dataSet.AssociationRole) { case AssociationRole.Consumer: _newAssociation = new ConsumerAssociation(_newSemanticData, _dataSet, bindingFactory, encodingFactory); break; case AssociationRole.Producer: _newAssociation = new ProducerAssociation(_newSemanticData, _dataSet.AssociationName, _dataSet, bindingFactory, encodingFactory); break; default: break; } _collection.Add(_dataSet.AssociationName, _newAssociation); } return(_collection); }
public void Load() { GameDefinitions.Init(); this.data = GameDefinitions.Semantics; }