/// <summary>Gets a specified property collection, i.e. a collection of settings grouped by a specified name. /// </summary> /// <param name="propertyCollectionName">The name of the property collection.</param> /// <returns>A perhaps empty collection of properties (i.e. settings) in the configuration file in its <see cref="ConfigurationFile.PropertyCollection"/> representation.</returns> /// <exception cref="System.ArgumentNullException">Thrown if <paramref name="propertyCollectionName"/> is <c>null</c>.</exception> public PropertyCollection GetPropertyCollection(string propertyCollectionName) { if (propertyCollectionName == null) { throw new ArgumentNullException(nameof(propertyCollectionName)); } return(new PropertyCollection(this, IdentifierString.Create(propertyCollectionName))); }
/// <summary>Gets a specific <see cref="DataTable"/> object. /// </summary> /// <param name="tableName">The name of the table.</param> /// <param name="dataTableType">The type of the tables to take into account.</param> /// <returns>A <see cref="DataTable"/> with the desired name.</returns> /// <exception cref="ArgumentException">Thrown, if no table available with the desired name.</exception> public DataTable GetDataTable(string tableName, DataTableType dataTableType = DataTableType.Single) { if (TryGetDataTable(IdentifierString.Create(tableName), out DataTable value, dataTableType) == true) { return(value); } throw new ArgumentException(String.Format(ExceptionMessages.TableNameUnknown, tableName), tableName); }
/// <summary>Initializes a new instance of the <see cref="MklQuasiRandomNumberGenerator" /> class. /// </summary> /// <param name="generatorName">The name of the Random Number Generator.</param> /// <param name="generatorID">The (internal) Generator ID.</param> /// <param name="initialConditions">The description of initial conditions.</param> /// <param name="description">The description of the Quasi-Random Number Generator.</param> /// <param name="splittingApproach">The splitting approach supported by the Random Number Generator.</param> /// <param name="randomNumberLibrary">The random number library.</param> internal MklQuasiRandomNumberGenerator(string generatorName, int generatorID, RandomNumberInitialConditions.Descriptor initialConditions, string description, RandomNumberSequence.SplittingApproach splittingApproach = RandomNumberSequence.SplittingApproach.None, IRandomNumberLibrary randomNumberLibrary = null) { m_Library = randomNumberLibrary; m_GeneratorName = IdentifierString.Create(generatorName); m_GeneratorID = generatorID; m_InitialConditions = initialConditions; m_Description = description; m_SplittingApproach = splittingApproach; }
/// <summary>Initializes a new instance of the <see cref="MklPseudoRandomNumberGenerator" /> class. /// </summary> /// <param name="generatorName">The name of the Random Number Generator.</param> /// <param name="generatorID">The (internal) Generator ID.</param> /// <param name="initialConditions">The description of initial conditions.</param> /// <param name="description">The description of the Pseudo-Random Number Generator.</param> /// <param name="splittingApproach">The splitting approach supported by the Random Number Generator.</param> /// <param name="numberOfSubGenerators">The number of sub-generator's (relevant for Wichmann-Hill and MT2203 only).</param> /// <param name="randomNumberLibrary">The random number library.</param> internal MklPseudoRandomNumberGenerator(string generatorName, int generatorID, RandomNumberInitialConditions.Descriptor initialConditions, string description, RandomNumberSequence.SplittingApproach splittingApproach = RandomNumberSequence.SplittingApproach.None, int numberOfSubGenerators = 1, IRandomNumberLibrary randomNumberLibrary = null) { m_Library = randomNumberLibrary; m_GeneratorName = IdentifierString.Create(generatorName); m_GeneratorID = generatorID; m_InitialConditions = initialConditions; m_Description = description; m_SplittingApproach = splittingApproach; m_SubGeneratorIDs = Enumerable.Range(0, numberOfSubGenerators); }
public void GeneralProperties_IdentifierStringProperty_TheProperty() { string propertyName = "Day count convention"; object propertyValue = IdentifierString.Create("30/360"); m_InfoOutputPackage.Add(propertyName, propertyValue); m_InfoOutputPackage.Add("A second property name", "Second property value"); // add a second property InfoOutputProperty expectedInfoOutputProperty = new InfoOutputProperty("day Count convention", propertyValue); var actualInfoOutputProperty = m_InfoOutputPackage.GeneralProperties[propertyName]; Assert.That(actualInfoOutputProperty, PropertyNameValuePair.Matches(expectedInfoOutputProperty)); }
/// <summary>Gets the <see cref="System.Data.DataTable"/> objects with homogeneous informations, and the table name in its <see cref="IdentifierString"/> representation. /// </summary> /// <param name="dataTableType">The type of the tables to take into account.</param> /// <returns>The tables and table names.</returns> /// <remarks>The table name of an <see cref="DataTable"/> object can be changed.</remarks> public IEnumerable <Tuple <IdentifierString, DataTable> > GetDataTables(DataTableType dataTableType = DataTableType.Single) { if (dataTableType.HasFlag(DataTableType.Single) == true) { foreach (var namedTable in m_Tables.NamedValues) { yield return(namedTable); } } if (dataTableType.HasFlag(DataTableType.Parent) == true) { foreach (var namedParentChildTables in m_ParentChildTables.NamedValues) { yield return(Tuple.Create(namedParentChildTables.Item1, namedParentChildTables.Item2.ParentDataTable)); } } if (dataTableType.HasFlag(DataTableType.Child) == true) { foreach (var namedParentChildTables in m_ParentChildTables.NamedValues) { yield return(Tuple.Create(IdentifierString.Create(namedParentChildTables.Item2.ParentDataTable.TableName + ParentChildTableNameSeparator + namedParentChildTables.Item2.ChildDataTable.TableName), namedParentChildTables.Item2.ChildDataTable)); } } }
/// <summary>Gets the holiday in its <see cref="IHoliday"/> representation. /// </summary> /// <param name="resourceManager">The <see cref="ResourceManager"/> object that contains the resource with respect to the holiday, i.e. the /// language depending <see cref="System.String"/> representations.</param> /// <returns>An instance of <see cref="IHoliday"/> that represents the holiday. /// </returns> /// <exception cref="ArgumentException">Thrown, if <paramref name="resourceManager"/> is not valid for the current instance, i.e. no resources are available for the holiday.</exception> public override IHoliday GetHoliday(ResourceManager resourceManager) { IdentifierString holidayLongName = IdentifierString.Create(resourceManager, ResourcePropertyName); return(new SingleHoliday(m_Name.ToIdentifierString(), DateOfHoliday, holidayLongName)); }
/// <summary>Initializes a new instance of the <see cref="GaussianGenerationMode"/> class. /// </summary> /// <param name="name">The name of the generation method for uniform distributed random numbers.</param> /// <param name="annotation">The annotation (description) of the generation method.</param> internal GaussianGenerationMode(string name, string annotation) : base(IdentifierString.Create(name), annotation) { }
/// <summary>Gets a specified data table, i. e. a collection of homogeneous data grouped by a specified name. /// </summary> /// <param name="tableName">The name of the table, i.e. of the section in the XML representation of the configuration file.</param> /// <param name="tableEntryName">The name of each data table entry.</param> /// <param name="fieldNames">The name of each field of the data table entries.</param> /// <returns>A <see cref="Table"/> object that contains homogeneous data.</returns> public Table GetTable(string tableName, string tableEntryName, params string[] fieldNames) { return(new Table(this, IdentifierString.Create(tableName), IdentifierString.Create(tableEntryName), fieldNames)); }
/// <summary>Initializes a new instance of the <see cref="UniformGenerationMode"/> class. /// </summary> /// <param name="name">The name of the generation method for uniform distributed random numbers.</param> /// <param name="annotation">The annotation (description) of the generation method.</param> private UniformGenerationMode(string name, string annotation) : base(IdentifierString.Create(name), annotation) { }
/// <summary>Gets the holiday in its <see cref="IHoliday"/> representation. /// </summary> /// <param name="resourceManager">The <see cref="ResourceManager"/> object that contains the resource with respect to the holiday, i.e. the /// language depending <see cref="System.String"/> representations.</param> /// <returns>An instance of <see cref="IHoliday"/> that represents the holiday. /// </returns> /// <exception cref="ArgumentException">Thrown, if <paramref name="resourceManager"/> is not valid for the current instance, i.e. no resources are available for the holiday.</exception> public override IHoliday GetHoliday(ResourceManager resourceManager) { IdentifierString holidayLongName = IdentifierString.Create(resourceManager, ResourcePropertyName); return(new MonthWeekdayHoliday(m_Name.ToIdentifierString(), m_DayOfWeek, m_Month, m_Week, m_FirstYear, m_LastYear, holidayLongName)); }
/// <summary>Initializes a new instance of the <see cref="UniformGenerationMode"/> class. /// </summary> /// <param name="name">The name of the generation method for uniform distributed random numbers.</param> /// <param name="magicNumber">The magic number</param> /// <param name="annotation">The annotation (description) of the generation method.</param> private UniformGenerationMode(string name, int magicNumber, string annotation) : base(IdentifierString.Create(name), annotation) { MagicNumber = magicNumber; }
/// <summary>Initializes a new instance of the <see cref="Table" /> class. /// </summary> /// <param name="configurationFile">The configuration file.</param> /// <param name="tableName">The name of the table, i.e. of the section in the XML representation of the configuration file.</param> /// <param name="tableEntryName">The name of each data table entry.</param> /// <param name="fieldNames">The name of each field of the data table entries.</param> internal protected Table(ConfigurationFile configurationFile, string tableName, string tableEntryName, params string[] fieldNames) { m_ConfigurationFile = configurationFile; m_TableName = new IdentifierString(tableName); m_FieldNames = fieldNames; m_Items = new DataCollection(this, configurationFile.GetSectionNode(m_TableName.IDString, out m_ContainsSettings), IdentifierString.Create(tableEntryName)); }
/// <summary>Gets a specific <see cref="DataTable"/> object. /// </summary> /// <param name="tableName">The name of the table.</param> /// <param name="value">The <see cref="DataTable"/> (output).</param> /// <param name="dataTableType">The type of the tables to take into account.</param> /// <returns>A value indicating whether <paramref name="value"/> contains valid data.</returns> public bool TryGetDataTable(string tableName, out DataTable value, DataTableType dataTableType = DataTableType.Single) { return(TryGetDataTable(IdentifierString.Create(tableName), out value, dataTableType)); }
/// <summary>Gets the holiday in its <see cref="IHoliday"/> representation. /// </summary> /// <param name="resourceManager">The <see cref="ResourceManager"/> object that contains the resource with respect to the holiday, i.e. the /// language depending <see cref="System.String"/> representations.</param> /// <returns>An instance of <see cref="IHoliday"/> that represents the holiday. /// </returns> /// <exception cref="ArgumentException">Thrown, if <paramref name="resourceManager"/> is not valid for the current instance, i.e. no resources are available for the holiday.</exception> public override IHoliday GetHoliday(ResourceManager resourceManager) { IdentifierString holidayLongName = IdentifierString.Create(resourceManager, ResourcePropertyName); return(new EasterDependingHoliday(m_Name.ToIdentifierString(), m_OffsetToEasterMonday, m_FirstYear, m_LastYear, m_HolidayRollingType, holidayLongName)); }
/// <summary>Gets the holiday in its <see cref="IHoliday"/> representation. /// </summary> /// <param name="resourceManager">The <see cref="ResourceManager"/> object that contains the resource with respect to the holiday, i.e. the /// language depending <see cref="System.String"/> representations.</param> /// <returns>An instance of <see cref="IHoliday"/> that represents the holiday. /// </returns> /// <exception cref="ArgumentException">Thrown, if <paramref name="resourceManager"/> is not valid for the current instance, i.e. no resources are available for the holiday.</exception> public override IHoliday GetHoliday(ResourceManager resourceManager) { IdentifierString holidayLongName = IdentifierString.Create(resourceManager, ResourcePropertyName); return(new FixHoliday(m_Name.ToIdentifierString(), m_Day, m_Month, m_FirstYear, m_LastYear, m_HolidayRollingType, holidayLongName)); }
/// <summary>Initializes a new instance of the <see cref="PropertyCollection" /> class. /// </summary> /// <param name="configurationFile">The configuration file.</param> /// <param name="propertyCollectionName">The name of the property collection.</param> internal protected PropertyCollection(ConfigurationFile configurationFile, string propertyCollectionName) : this(configurationFile, IdentifierString.Create(propertyCollectionName)) { }
/// <summary>Initializes a new instance of the <see cref="GaussianGenerationMode" /> class. /// </summary> /// <param name="name">The name of the generation mode.</param> /// <param name="magicNumber">The magic number, i.e. ID needed by Intel's MKL library.</param> /// <param name="description">The description of the generation mode.</param> private GaussianGenerationMode(string name, int magicNumber, string description) : base(IdentifierString.Create(name), description) { MagicNumber = magicNumber; }