Skip to content

Commit 56d93f6

Browse files
committed
VisualDump 2.1
- Now all my extensions work on the basis of a single API, which made it possible to simplify some things
1 parent b81783d commit 56d93f6

File tree

12 files changed

+40
-125
lines changed

12 files changed

+40
-125
lines changed

VisualDump/Commands/BaseCommand.cs

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
using System;
1+
using KE.VSIX.Commands;
22
using Microsoft.VisualStudio.Shell;
33

44
namespace VisualDump.Commands
55
{
6+
[CommandID("e3161eb3-4aec-49de-bfe6-2eb5a01a0c34", 0x0100)]
67
public sealed class ShowDumpWindowCommand : BaseCommand<ShowDumpWindowCommand>
78
{
8-
#region Init
9-
static ShowDumpWindowCommand()
10-
{
11-
CommandID = 0x0100;
12-
CommandSet = new Guid("e3161eb3-4aec-49de-bfe6-2eb5a01a0c34");
13-
}
14-
#endregion
15-
16-
#region Functions
179
protected override void Execute(OleMenuCommand Button) => VSPackage.ShowToolWindow(typeof(Controls.VisualDump));
18-
#endregion
1910
}
2011
}

VisualDump/Controls/Options/OptionContainer.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public class OptionContainer
1919

2020
#region Init
2121
public static async Task InitializeAsync() => await Task.Run(() => {
22-
ThemesPath = Path.Combine(VSPackage.Path, "Themes\\");
22+
ThemesPath = VSPackage.PathData.MapPath("Themes");
2323
if (!Directory.Exists(ThemesPath))
2424
Directory.CreateDirectory(ThemesPath);
25-
DefaultThemesPath = Path.Combine(VSPackage.AssemblyPath, "DefaultThemes\\");
26-
Settings = Settings.Read(SettingsPath = Path.Combine(VSPackage.Path, "settings.xml"));
25+
DefaultThemesPath = Path.Combine(VSPackage.PathData.DllLocation, "DefaultThemes");
26+
Settings = Settings.Read(SettingsPath = VSPackage.PathData.MapPath("settings.xml"));
2727
LoadThemes();
2828
});
2929
#endregion
@@ -34,10 +34,10 @@ public static Theme[] LoadThemes()
3434
Theme[] themes = Theme.LoadThemes(ThemesPath).ToArray();
3535
if (themes.Length == 0)
3636
{
37-
foreach (string dirPath in Directory.GetDirectories(DefaultThemesPath, "*", SearchOption.AllDirectories))
37+
foreach (string dirPath in Directory.EnumerateDirectories(DefaultThemesPath, "*", SearchOption.AllDirectories))
3838
Directory.CreateDirectory(dirPath.Replace(DefaultThemesPath, ThemesPath));
3939

40-
foreach (string newPath in Directory.GetFiles(DefaultThemesPath, "*.*", SearchOption.AllDirectories))
40+
foreach (string newPath in Directory.EnumerateFiles(DefaultThemesPath, "*.*", SearchOption.AllDirectories))
4141
File.Copy(newPath, newPath.Replace(DefaultThemesPath, ThemesPath), true);
4242

4343
themes = Theme.LoadThemes(ThemesPath).ToArray();
64.3 KB
Loading
11.7 KB
Loading
Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,13 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

5-
// General Information about an assembly is controlled through the following
6-
// set of attributes. Change these attribute values to modify the information
7-
// associated with an assembly.
84
[assembly: AssemblyTitle("VisualDump")]
9-
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("")]
125
[assembly: AssemblyProduct("VisualDump")]
13-
[assembly: AssemblyCopyright("")]
14-
[assembly: AssemblyTrademark("")]
15-
[assembly: AssemblyCulture("")]
6+
[assembly: AssemblyCompany("Kir_Antipov")]
7+
[assembly: AssemblyCopyright("Kir_Antipov © 2019")]
8+
[assembly: AssemblyDescription("This extension allows you to view a visual dump of your objects during the debugging of the program in Visual Studio")]
169

17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
19-
// COM, set the ComVisible attribute to true on that type.
2010
[assembly: ComVisible(false)]
2111

22-
// Version information for an assembly consists of the following four values:
23-
//
24-
// Major Version
25-
// Minor Version
26-
// Build Number
27-
// Revision
28-
//
29-
// You can specify all the values or you can default the Build and Revision Numbers
30-
// by using the '*' as shown below:
31-
// [assembly: AssemblyVersion("1.0.*")]
32-
[assembly: AssemblyVersion("1.0.0.0")]
33-
[assembly: AssemblyFileVersion("1.0.0.0")]
12+
[assembly: AssemblyVersion("2.1.0.0")]
13+
[assembly: AssemblyFileVersion("2.1.0.0")]

VisualDump/VSHelpers/NuGetListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private static void AddReference(Project Project, int Wait, int TryIndex)
6868
}
6969

7070
private static void AddOnlineReferece(Project Project) => VSPackage.PackageInstaller.InstallPackage(NuGetAPI, Project, NuGet, NuGetVersionString, false);
71-
private static void AddOfflineReferece(Project Project) => VSPackage.PackageInstaller.InstallPackage(VSPackage.AssemblyPath, Project, NuGet, NuGetVersionString, false);
71+
private static void AddOfflineReferece(Project Project) => VSPackage.PackageInstaller.InstallPackage(VSPackage.PathData.DllLocation, Project, NuGet, NuGetVersionString, false);
7272
#endregion
7373
}
7474
}

VisualDump/VSPackage.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using EnvDTE;
22
using System;
3+
using KE.VSIX;
34
using System.Threading;
45
using NuGet.VisualStudio;
56
using VisualDump.Controls;
@@ -28,25 +29,15 @@ namespace VisualDump
2829
public sealed partial class VSPackage : AsyncPackage
2930
{
3031
#region Var
31-
public static string Path { get; }
32-
public static string AssemblyPath { get; }
3332
public static DTE DTE { get; private set; }
3433
public static VSPackage Instance { get; private set; }
3534
public static IVsPackageInstaller PackageInstaller { get; private set; }
36-
public static Guid Guid { get; } = new Guid(PackageGuidString);
3735
public const string PackageGuidString = "bf22b5f8-9ec7-4810-880d-8d2bec2b68af";
36+
public static PathContainer PathData { get; } = PackageHelper.Initialize<VSPackage>();
3837
public static OptionControl OptionPage => (Instance.GetDialogPage(typeof(OptionPageGrid)) as OptionPageGrid)?.OptionControl;
3938
#endregion
4039

4140
#region Init
42-
static VSPackage()
43-
{
44-
Path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "VisualDump\\");
45-
if (!System.IO.Directory.Exists(Path))
46-
System.IO.Directory.CreateDirectory(Path);
47-
AssemblyPath = System.IO.Path.GetDirectoryName(new Uri(typeof(VSPackage).Assembly.CodeBase, UriKind.Absolute).LocalPath);
48-
}
49-
5041
protected override async Task InitializeAsync(CancellationToken CancellationToken, IProgress<ServiceProgressData> Progress)
5142
{
5243
await JoinableTaskFactory.SwitchToMainThreadAsync(CancellationToken);

VisualDump/VisualDump.csproj

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
<LangVersion>7.3</LangVersion>
5959
</PropertyGroup>
6060
<ItemGroup>
61-
<Compile Include="Commands\BaseCommand.cs" />
6261
<Compile Include="Controls\Options\OptionContainer.cs" />
6362
<Compile Include="Controls\Options\OptionControl.cs">
6463
<SubType>UserControl</SubType>
@@ -146,6 +145,14 @@
146145
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
147146
<IncludeInVSIX>true</IncludeInVSIX>
148147
</Content>
148+
<Content Include="Images\VSPackageIcon128x128.png">
149+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
150+
<IncludeInVSIX>true</IncludeInVSIX>
151+
</Content>
152+
<Content Include="Images\VSPackageIcon256x256.png">
153+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
154+
<IncludeInVSIX>true</IncludeInVSIX>
155+
</Content>
149156
<Content Include="snippets.pkgdef">
150157
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
151158
<IncludeInVSIX>true</IncludeInVSIX>
@@ -173,14 +180,19 @@
173180
<Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
174181
<EmbedInteropTypes>False</EmbedInteropTypes>
175182
</Reference>
183+
<Reference Include="KE.VSIX, Version=1.2.0.0, Culture=neutral, PublicKeyToken=4b86ba7b522e6653, processorArchitecture=MSIL">
184+
<HintPath>..\packages\KE.VSIX.1.2.0\lib\net47\KE.VSIX.dll</HintPath>
185+
</Reference>
176186
<Reference Include="Microsoft.CSharp" />
177187
<Reference Include="Microsoft.VisualStudio.CommandBars, PublicKeyToken=b03f5f7f11d50a3a" />
178188
<Reference Include="Microsoft.VisualStudio.CoreUtility, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
179189
<Reference Include="Microsoft.VisualStudio.ImageCatalog, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
180190
<Reference Include="Microsoft.VisualStudio.Imaging, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
181191
<Reference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
182192
<Reference Include="Microsoft.VisualStudio.OLE.Interop, PublicKeyToken=b03f5f7f11d50a3a" />
183-
<Reference Include="Microsoft.VisualStudio.Shell.15.0, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
193+
<Reference Include="Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
194+
<HintPath>..\packages\Microsoft.VisualStudio.Shell.15.0.15.9.28307\lib\net45\Microsoft.VisualStudio.Shell.15.0.dll</HintPath>
195+
</Reference>
184196
<Reference Include="Microsoft.VisualStudio.Shell.Framework, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
185197
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
186198
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
@@ -228,6 +240,7 @@
228240
<Private>True</Private>
229241
<Private>True</Private>
230242
</Reference>
243+
<Reference Include="System.IO.Compression" />
231244
<Reference Include="System.Net.Http, Version=4.1.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
232245
<HintPath>..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll</HintPath>
233246
<Private>True</Private>

VisualDump/app.config

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
1313
<dependentAssembly>
1414
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
15-
<bindingRedirect oldVersion="0.0.0.0-16.0.0.0" newVersion="16.0.0.0" />
15+
<bindingRedirect oldVersion="0.0.0.0-15.8.0.0" newVersion="15.8.0.0" />
1616
</dependentAssembly>
1717
<dependentAssembly>
1818
<assemblyIdentity name="Microsoft.VisualStudio.Validation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -50,6 +50,10 @@
5050
<assemblyIdentity name="Microsoft.VisualStudio.ImageCatalog" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
5151
<bindingRedirect oldVersion="0.0.0.0-16.0.0.0" newVersion="16.0.0.0" />
5252
</dependentAssembly>
53+
<dependentAssembly>
54+
<assemblyIdentity name="StreamJsonRpc" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
55+
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
56+
</dependentAssembly>
5357
</assemblyBinding>
5458
</runtime>
5559
<applicationSettings>

0 commit comments

Comments
 (0)