image-comments
image-comments copied to clipboard
Can you add support for relative paths for images?
Hi something like this
/// <summary>
/// <image url=".\images\sampleCall.png" />
/// </summary>
private VideoChannel videoChannel;
Thanks! Regards
Thanks for your suggestion. This should be feasible to implement in a future version. P.S. I edited your comment for code formatting to get the xml tags to show (you just need to indent each line by 4 spaces).
Any chance this is going to happen? My build configuration is outside my control, so being able to use a path relative to the source file rather than $(ProjectDir) or an absolute path is very important to me.
Here's a patch to VariableExpander.cs that allows the use of the variable $(CurrentDir) to point to the directory of the document. There's probably a prettier way, but I'm not a C# programmer.
private const string PROJECTDIR_PATTERN = "$(ProjectDir)";
private const string SOLUTIONDIR_PATTERN = "$(SolutionDir)";
private const string CURRENTDIR_PATTERN = "$(CurrentDir)";
....
private string evaluator(Match match)
{
string variableName = match.Value;
if (string.Compare(variableName, PROJECTDIR_PATTERN, StringComparison.InvariantCultureIgnoreCase) == 0)
{
return _projectDirectory;
}
else if (string.Compare(variableName, SOLUTIONDIR_PATTERN, StringComparison.InvariantCultureIgnoreCase) == 0)
{
return _solutionDirectory;
}
else if (string.Compare(variableName, CURRENTDIR_PATTERN, StringComparison.InvariantCultureIgnoreCase) == 0)
{
ITextDocument document;
_view.TextDataModel.DocumentBuffer.Properties.TryGetProperty(typeof(ITextDocument), out document);
return Path.GetDirectoryName(document.FilePath) + @"\";
}
else
{
// Could throw an exception here, but it's possible the path contains $(...).
// TODO: Variable name escaping
return variableName;
}
}