/// <summary> /// Indicates that the specified API version is supported by the configured action. /// </summary> /// <param name="apiVersion">The supported <see cref="ApiVersion">API version</see> implemented by the action.</param> /// <returns>The original <see cref="ActionApiVersionConventionBuilder"/>.</returns> public virtual ActionApiVersionConventionBuilder HasApiVersion(ApiVersion apiVersion) { Arg.NotNull(apiVersion, nameof(apiVersion)); Contract.Ensures(Contract.Result <ActionApiVersionConventionBuilder>() != null); SupportedVersions.Add(apiVersion); return(this); }
private bool LoadConfig() { var configFile = new FileInfo(m_dirInf.FullName + "\\templateConfig.cfg"); if (!configFile.Exists) { Log.LogError(String.Format("Tried to load game template {0}, but there was no config file.", m_dirInf.Name)); return(false); } var reader = new StreamReader(configFile.OpenRead()); string sLine = null; while (reader.EndOfStream == false) { sLine = reader.ReadLine(); var splitLine = sLine.Split('='); if (splitLine[0] == ConfigValueNames.DescFilePath) { DescFilePath = splitLine[1]; } else if (splitLine[0] == ConfigValueNames.IconPath) { IconPath = splitLine[1]; } else if (splitLine[0] == ConfigValueNames.CompatibleVersions) { string sVersionsString = splitLine[1]; if (sVersionsString == "all") { continue; } var versions = sVersionsString.Split(';'); for (int i = 0; i < versions.Count(); i++) { var version = new CEVersion(); version.SetFromString(versions[i]); SupportedVersions.Add(version); } } else { Log.LogWarning("Found unknown value while reading game template '" + Name + "' config: '" + splitLine[0] + "'"); } } return(true); }
/// <summary> /// Indicates that the specified API version is supported by the configured controller. /// </summary> /// <param name="apiVersion">The supported <see cref="ApiVersion">API version</see> implemented by the controller.</param> /// <returns>The original <see cref="ControllerApiVersionConventionBuilder"/>.</returns> public virtual ControllerApiVersionConventionBuilder HasApiVersion(ApiVersion apiVersion) { SupportedVersions.Add(apiVersion); return(this); }