Skip to content

Commit

Permalink
Add header to results panel
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandreu committed Jul 28, 2019
1 parent 65db535 commit 2f25e63
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
2 changes: 2 additions & 0 deletions OfficeRibbonXEditor/Interfaces/IResultCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ namespace OfficeRibbonXEditor.Interfaces
{
public interface IResultCollection
{
string Header { get; }

void AddToPanel(Scintilla editor, Scintilla resultsPanel);

void GoToPosition(int pos, Scintilla editor, Scintilla resultsPanel);
Expand Down
2 changes: 2 additions & 0 deletions OfficeRibbonXEditor/Models/FindResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public FindResults(IEnumerable<CharacterRange> items)
this.Items = new List<CharacterRange>(items);
}

public string Header { get; } = "Find Results";

public List<CharacterRange> Items { get; }

public void AddToPanel(Scintilla editor, Scintilla resultsPanel)
Expand Down
2 changes: 2 additions & 0 deletions OfficeRibbonXEditor/Models/XmlErrorResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public XmlErrorResults(IEnumerable<XmlError> items)
this.Items = new List<XmlError>(items);
}

public string Header { get; } = "XML Validation Results";

public List<XmlError> Items { get; }

public void AddToPanel(Scintilla editor, Scintilla resultsPanel)
Expand Down
23 changes: 13 additions & 10 deletions OfficeRibbonXEditor/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -511,16 +511,19 @@
ResizeBehavior="PreviousAndNext"/>

<DockPanel Grid.Row="2">
<Button DockPanel.Dock="Top"
Width="16"
Height="16"
Margin="2"
HorizontalAlignment="Right"
Click="OnCloseFindResults">
<Button.Content>
<Image Source="../Resources/Images/cross.png"/>
</Button.Content>
</Button>
<DockPanel DockPanel.Dock="Top">
<Label Name="ResultsHeader"/>
<Button DockPanel.Dock="Right"
Width="16"
Height="16"
Margin="2"
HorizontalAlignment="Right"
Click="OnCloseFindResults">
<Button.Content>
<Image Source="../Resources/Images/cross.png"/>
</Button.Content>
</Button>
</DockPanel>
<controls:ResultsPanel
x:Name="ResultsPanel"/>
</DockPanel>
Expand Down
1 change: 1 addition & 0 deletions OfficeRibbonXEditor/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs arg
{
this.ResultsSplitter.Visibility = Visibility.Visible;
this.ResultsRow.Height = this.lastResultsHeight;
this.ResultsHeader.Content = e.Data.Header;
this.ResultsPanel.UpdateFindAllResults(e.Data);
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ public void RemoveIconWarningTest()
this.AssertMessage(this.viewModel.CloseDocumentCommand.Execute, MessageBoxImage.Warning, MessageBoxResult.Cancel);
}

/// <summary>
/// Checks if the XML validation provides the expected result for a few sample cases
/// </summary>
[Test]
public void XmlValidationTest()
{
Expand Down

0 comments on commit 2f25e63

Please sign in to comment.