Skip to content

Commit

Permalink
Moved browsers search tooltip to separate info type button.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-visual-studio committed May 23, 2021
1 parent 2528027 commit e380b13
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 47 deletions.
14 changes: 14 additions & 0 deletions DPackRx.Tests/Features/CodeBrowserViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,20 @@ public void ShowAllMembers(CodeModelFilterFlags flags, Visibility expectedVisibi
Assert.That(visibility, Is.EqualTo(expectedVisibility));
}

[Test]
public void ImageSearchHelp()
{
var viewModel = GetViewModel();
var image = new BitmapImage();

_shellImageServiceMock.Setup(s => s.GetWellKnownImage(WellKnownImage.Info)).Returns(image).Verifiable();

var result = viewModel.ImageSearchHelp;

Assert.That(result, Is.EqualTo(image));
_shellImageServiceMock.Verify(s => s.GetWellKnownImage(WellKnownImage.Info));
}

[Test]
public void ImageShowAllMembers()
{
Expand Down
14 changes: 14 additions & 0 deletions DPackRx.Tests/Features/FileBrowserViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,20 @@ public void FilteredFiles()
Assert.That(viewModel.FilteredFiles.Count, Is.EqualTo(2));
}

[Test]
public void ImageSearchHelp()
{
var viewModel = GetViewModel();
var image = new BitmapImage();

_shellImageServiceMock.Setup(s => s.GetWellKnownImage(WellKnownImage.Info)).Returns(image).Verifiable();

var result = viewModel.ImageSearchHelp;

Assert.That(result, Is.EqualTo(image));
_shellImageServiceMock.Verify(s => s.GetWellKnownImage(WellKnownImage.Info));
}

[Test]
public void ImageShowAllFiles()
{
Expand Down
1 change: 1 addition & 0 deletions DPackRx/DPackRx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@
<EmbeddedResource Include="Resources\VSPackage.resx">
<MergeWithCTO>true</MergeWithCTO>
<ManifestResourceName>VSPackage</ManifestResourceName>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
Expand Down
19 changes: 11 additions & 8 deletions DPackRx/Features/CodeBrowser/CodeBrowserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,26 @@

<Border DockPanel.Dock="Top" BorderThickness="0,1,0,1">
<DockPanel>
<Button DockPanel.Dock="Right" ToolTip="Show all members (Alt+A)"
<Button DockPanel.Dock="Right" Margin="12,0,0,0" ToolTip="Show all members (Alt+A)"
Command="{Binding ShowAllMembersCommand}"
Visibility="{Binding ShowAllMembers, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource SearchButton}">
<Image Width="16" Height="16" Source="{Binding ImageShowAllMembers, Mode=OneTime}" />
</Button>

<TextBox behaviors:TextBoxSelectAllOnFocus.Enabled="True"
behaviors:TextBoxInputRedirectToListView.Control="items"
Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource SearchTextBox}">
<TextBox.ToolTip>
<Button DockPanel.Dock="Right" Style="{StaticResource SearchButton}">
<Button.ToolTip>
<TextBlock>
Select member - <TextBlock FontWeight="Bold">Enter</TextBlock>
</TextBlock>
</TextBox.ToolTip>
</TextBox>
</Button.ToolTip>
<Image Width="16" Height="16" Source="{Binding ImageSearchHelp, Mode=OneTime}" />
</Button>

<TextBox behaviors:TextBoxSelectAllOnFocus.Enabled="True"
behaviors:TextBoxInputRedirectToListView.Control="items"
Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource SearchTextBox}" />
</DockPanel>
</Border>

Expand Down
8 changes: 8 additions & 0 deletions DPackRx/Features/CodeBrowser/CodeBrowserViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ public Visibility ShowAllMembers
}
}

/// <summary>
/// Image for help button.
/// </summary>
public ImageSource ImageSearchHelp
{
get { return _shellImageService.GetWellKnownImage(WellKnownImage.Info); }
}

/// <summary>
/// Image for Show All Members button state.
/// </summary>
Expand Down
21 changes: 12 additions & 9 deletions DPackRx/Features/FileBrowser/FileBrowserControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<Separator DockPanel.Dock="Right" Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />

<Button DockPanel.Dock="Right" Command="{Binding ShowFilesCommand}">
<Button DockPanel.Dock="Right" Margin="12,0,0,0" Command="{Binding ShowFilesCommand}">
<!-- Conditional tooltip -->
<Button.Style>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource SearchButton}">
Expand Down Expand Up @@ -90,20 +90,23 @@
</Image>
</Button>

<TextBox behaviors:TextBoxSelectAllOnFocus.Enabled="True"
behaviors:TextBoxInputRedirectToListView.Control="items"
Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource SearchTextBox}">
<TextBox.ToolTip>
<Button DockPanel.Dock="Right" Style="{StaticResource SearchButton}">
<Button.ToolTip>
<TextBlock>
Open file(s) in:
<LineBreak /><LineBreak />
<LineBreak />
edit view - <TextBlock FontWeight="Bold">Enter</TextBlock>
<LineBreak />
design view - <TextBlock FontWeight="Bold">Ctrl+Enter</TextBlock>
</TextBlock>
</TextBox.ToolTip>
</TextBox>
</Button.ToolTip>
<Image Width="16" Height="16" Source="{Binding ImageSearchHelp, Mode=OneTime}" />
</Button>

<TextBox behaviors:TextBoxSelectAllOnFocus.Enabled="True"
behaviors:TextBoxInputRedirectToListView.Control="items"
Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource SearchTextBox}" />
</DockPanel>
</Border>

Expand Down
8 changes: 8 additions & 0 deletions DPackRx/Features/FileBrowser/FileBrowserViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ protected internal IList<FileModel> FilteredFiles
get { return ((IEnumerable)_files?.View).Cast<FileModel>().ToList(); }
}

/// <summary>
/// Image for help button.
/// </summary>
public ImageSource ImageSearchHelp
{
get { return _shellImageService.GetWellKnownImage(WellKnownImage.Info); }
}

/// <summary>
/// Image for Show All Files button state.
/// </summary>
Expand Down
56 changes: 28 additions & 28 deletions DPackRx/Resources/VSPackage.resx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
Expand All @@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -123,7 +123,7 @@
</data>
<data name="102" xml:space="preserve">
<value>DPack Rx for Visual Studio
Copyright © 2004-2020 Sergey Mishkovskiy</value>
Copyright © 2004-2021 Sergey Mishkovskiy</value>
<comment>Help|About</comment>
</data>
<data name="103" xml:space="preserve">
Expand Down
3 changes: 2 additions & 1 deletion DPackRx/Services/IShellImageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public enum WellKnownImage
Members,
Classes,
Methods,
Properties
Properties,
Info
}

#endregion
Expand Down
3 changes: 3 additions & 0 deletions DPackRx/Services/ShellImageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ public ImageSource GetWellKnownImage(WellKnownImage knownImage)
case WellKnownImage.Properties:
id = KnownImageIds.PropertyPublic;
break;
case WellKnownImage.Info:
id = KnownImageIds.StatusInformationOutline;
break;
default:
throw new ApplicationException($"Unknown image {knownImage}");
}
Expand Down
2 changes: 1 addition & 1 deletion DPackRx/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="3D22E261-32E5-46CE-A4B0-B884FA49A9A2" Version="4.0.1.0" Language="en-US" Publisher="Sergey M" />
<Identity Id="3D22E261-32E5-46CE-A4B0-B884FA49A9A2" Version="4.0.3.0" Language="en-US" Publisher="Sergey M" />
<DisplayName>DPack Rx</DisplayName>
<Description xml:space="preserve">FREE tools collection designed to greatly increase developer's productivity, automate repetitive processes and expand upon some of Microsoft Visual Studio features. Visual Studio 2017 and 2019 are supported.</Description>
<MoreInfo>https://github.com/sergey-visual-studio/dpack</MoreInfo>
Expand Down

0 comments on commit e380b13

Please sign in to comment.