Skip to content

Commit

Permalink
1.0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
GregTrevellick committed Aug 22, 2017
1 parent c3b7d8c commit cb20934
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

These are the changes to each version that has been released on the official Visual Studio extension gallery.

## 1.0.27
**2017-08-21**
## 1.0.28
**2017-08-22**
- [x] Minor bug fixes

## 1.0.25
Expand Down
23 changes: 19 additions & 4 deletions SolutionOpenPopUp/VSPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public sealed class VSPackage : Package
private string bulletPoint = " - ";
private string solutionFolder;
private List<TextFileDto> textFileDtos;
private bool popUpBodyIsPopulated;

public VSPackage()
{
Expand All @@ -43,16 +44,16 @@ protected override void Initialize()

private void OnSolutionOpened()
{
textFileDtos = new List<TextFileDto>();
popUpBodyIsPopulated = false;
popUpFooter = string.Empty;
textFileDtos = new List<TextFileDto>();

SolutionOpenPopUpDotTxtHandler();

ReadMeDotTxtHandler();

var popUpBody = GetPopUpBody(textFileDtos);

if (!string.IsNullOrEmpty(popUpBody))
if (popUpBodyIsPopulated)
{
if (GeneralOptionsDto.ShowFileNamesInPopUp)
{
Expand Down Expand Up @@ -131,7 +132,9 @@ private string GetPopUpMessage(TextFileDto textFileDto)
if (textFileDto.FileExists)
{
var linesToUse = textFileDto.AllLines.Take(textFileDto.MaxLinesToShow);
var linesToUseJoined = string.Join(Environment.NewLine, linesToUse);
var toUse = linesToUse as IList<string> ?? linesToUse.ToList();
SetPopUpBodyIsPopulated(toUse);
var linesToUseJoined = string.Join(Environment.NewLine, toUse);
linesToUseJoined.TrimPrefix(Environment.NewLine);
result += linesToUseJoined;

Expand All @@ -152,6 +155,18 @@ private string GetPopUpMessage(TextFileDto textFileDto)
return result;
}

private void SetPopUpBodyIsPopulated(IList<string> linesToUse)
{
if (!popUpBodyIsPopulated)
{
if (linesToUse.Any(x => !string.IsNullOrEmpty(x)) ||
linesToUse.Any(x => !string.IsNullOrWhiteSpace(x)))
{
popUpBodyIsPopulated = true;
}
}
}

private string GetPopUpFooter()
{
string result = null;
Expand Down
2 changes: 1 addition & 1 deletion SolutionOpenPopUp/source.extension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static class Vsix
public const string Description = @"Display the contents of certain text files when the solution is opened in a pop-up window. A handy way to share solution-specific gotchas, non-critical team messages or your own personal notes for a solution.
";
public const string Language = "en-US";
public const string Version = "1.0.27";
public const string Version = "1.0.28";
public const string Author = "Greg Trevellick";
public const string Tags = "solution open, popup, pop-up, pop up, gotcha, gotchas, read me, readme, readme.txt";
}
Expand Down
2 changes: 1 addition & 1 deletion SolutionOpenPopUp/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="9ea776a6-e317-4ba8-a957-fa59958ec214" Version="1.0.27" Language="en-US" Publisher="Greg Trevellick" />
<Identity Id="9ea776a6-e317-4ba8-a957-fa59958ec214" Version="1.0.28" Language="en-US" Publisher="Greg Trevellick" />
<DisplayName>Solution Open Pop Up</DisplayName>
<Description xml:space="preserve">Display the contents of certain text files when the solution is opened in a pop-up window. A handy way to share solution-specific gotchas, non-critical team messages or your own personal notes for a solution.
</Description>
Expand Down

0 comments on commit cb20934

Please sign in to comment.