This commit is contained in:
Alexander Luzgarev 2021-07-10 10:01:32 +02:00
parent b6c387a1e4
commit 6d899096e4
2 changed files with 14 additions and 0 deletions

View File

@ -20,5 +20,13 @@ namespace MatFileHandler
/// </summary> /// </summary>
/// <param name="variableName">Variable name.</param> /// <param name="variableName">Variable name.</param>
IVariable this[string variableName] { get; set; } IVariable this[string variableName] { get; set; }
/// <summary>
/// Gets the variable with the specified name.
/// </summary>
/// <param name="name">The name of the variable to get.</param>
/// <param name="variable">When this method returns, contains the variable with the specified name, if it is found; otherwise, null.</param>
/// <returns>True if the file contains a variable with the specified name; otherwise, false.</returns>
public bool TryGetVariable(string name, out IVariable? variable);
} }
} }

View File

@ -34,5 +34,11 @@ namespace MatFileHandler
get => _variables[variableName]; get => _variables[variableName];
set => _variables[variableName] = value; set => _variables[variableName] = value;
} }
/// <inheritdoc />
public bool TryGetVariable(string name, out IVariable value)
{
return _variables.TryGetValue(name, out value);
}
} }
} }