Skip to content

Commit

Permalink
VisualDump 2.1
Browse files Browse the repository at this point in the history
- Now all my extensions work on the basis of a single API, which made it possible to simplify some things
  • Loading branch information
Kir-Antipov committed Jul 30, 2019
1 parent b81783d commit 56d93f6
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 125 deletions.
65 changes: 0 additions & 65 deletions VisualDump/Commands/BaseCommand.cs

This file was deleted.

13 changes: 2 additions & 11 deletions VisualDump/Commands/ShowDumpWindowCommand.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
using System;
using KE.VSIX.Commands;
using Microsoft.VisualStudio.Shell;

namespace VisualDump.Commands
{
[CommandID("e3161eb3-4aec-49de-bfe6-2eb5a01a0c34", 0x0100)]
public sealed class ShowDumpWindowCommand : BaseCommand<ShowDumpWindowCommand>
{
#region Init
static ShowDumpWindowCommand()
{
CommandID = 0x0100;
CommandSet = new Guid("e3161eb3-4aec-49de-bfe6-2eb5a01a0c34");
}
#endregion

#region Functions
protected override void Execute(OleMenuCommand Button) => VSPackage.ShowToolWindow(typeof(Controls.VisualDump));
#endregion
}
}
10 changes: 5 additions & 5 deletions VisualDump/Controls/Options/OptionContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public class OptionContainer

#region Init
public static async Task InitializeAsync() => await Task.Run(() => {
ThemesPath = Path.Combine(VSPackage.Path, "Themes\\");
ThemesPath = VSPackage.PathData.MapPath("Themes");
if (!Directory.Exists(ThemesPath))
Directory.CreateDirectory(ThemesPath);
DefaultThemesPath = Path.Combine(VSPackage.AssemblyPath, "DefaultThemes\\");
Settings = Settings.Read(SettingsPath = Path.Combine(VSPackage.Path, "settings.xml"));
DefaultThemesPath = Path.Combine(VSPackage.PathData.DllLocation, "DefaultThemes");
Settings = Settings.Read(SettingsPath = VSPackage.PathData.MapPath("settings.xml"));
LoadThemes();
});
#endregion
Expand All @@ -34,10 +34,10 @@ public static Theme[] LoadThemes()
Theme[] themes = Theme.LoadThemes(ThemesPath).ToArray();
if (themes.Length == 0)
{
foreach (string dirPath in Directory.GetDirectories(DefaultThemesPath, "*", SearchOption.AllDirectories))
foreach (string dirPath in Directory.EnumerateDirectories(DefaultThemesPath, "*", SearchOption.AllDirectories))
Directory.CreateDirectory(dirPath.Replace(DefaultThemesPath, ThemesPath));

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

themes = Theme.LoadThemes(ThemesPath).ToArray();
Expand Down
Binary file added VisualDump/Images/VSPackageIcon128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VisualDump/Images/VSPackageIcon256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 5 additions & 25 deletions VisualDump/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VisualDump")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VisualDump")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyCompany("Kir_Antipov")]
[assembly: AssemblyCopyright("Kir_Antipov © 2019")]
[assembly: AssemblyDescription("This extension allows you to view a visual dump of your objects during the debugging of the program in Visual Studio")]

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

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
2 changes: 1 addition & 1 deletion VisualDump/VSHelpers/NuGetListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static void AddReference(Project Project, int Wait, int TryIndex)
}

private static void AddOnlineReferece(Project Project) => VSPackage.PackageInstaller.InstallPackage(NuGetAPI, Project, NuGet, NuGetVersionString, false);
private static void AddOfflineReferece(Project Project) => VSPackage.PackageInstaller.InstallPackage(VSPackage.AssemblyPath, Project, NuGet, NuGetVersionString, false);
private static void AddOfflineReferece(Project Project) => VSPackage.PackageInstaller.InstallPackage(VSPackage.PathData.DllLocation, Project, NuGet, NuGetVersionString, false);
#endregion
}
}
13 changes: 2 additions & 11 deletions VisualDump/VSPackage.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using EnvDTE;
using System;
using KE.VSIX;
using System.Threading;
using NuGet.VisualStudio;
using VisualDump.Controls;
Expand Down Expand Up @@ -28,25 +29,15 @@ namespace VisualDump
public sealed partial class VSPackage : AsyncPackage
{
#region Var
public static string Path { get; }
public static string AssemblyPath { get; }
public static DTE DTE { get; private set; }
public static VSPackage Instance { get; private set; }
public static IVsPackageInstaller PackageInstaller { get; private set; }
public static Guid Guid { get; } = new Guid(PackageGuidString);
public const string PackageGuidString = "bf22b5f8-9ec7-4810-880d-8d2bec2b68af";
public static PathContainer PathData { get; } = PackageHelper.Initialize<VSPackage>();
public static OptionControl OptionPage => (Instance.GetDialogPage(typeof(OptionPageGrid)) as OptionPageGrid)?.OptionControl;
#endregion

#region Init
static VSPackage()
{
Path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "VisualDump\\");
if (!System.IO.Directory.Exists(Path))
System.IO.Directory.CreateDirectory(Path);
AssemblyPath = System.IO.Path.GetDirectoryName(new Uri(typeof(VSPackage).Assembly.CodeBase, UriKind.Absolute).LocalPath);
}

protected override async Task InitializeAsync(CancellationToken CancellationToken, IProgress<ServiceProgressData> Progress)
{
await JoinableTaskFactory.SwitchToMainThreadAsync(CancellationToken);
Expand Down
17 changes: 15 additions & 2 deletions VisualDump/VisualDump.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="Commands\BaseCommand.cs" />
<Compile Include="Controls\Options\OptionContainer.cs" />
<Compile Include="Controls\Options\OptionControl.cs">
<SubType>UserControl</SubType>
Expand Down Expand Up @@ -146,6 +145,14 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Images\VSPackageIcon128x128.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Images\VSPackageIcon256x256.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="snippets.pkgdef">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
Expand Down Expand Up @@ -173,14 +180,19 @@
<Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="KE.VSIX, Version=1.2.0.0, Culture=neutral, PublicKeyToken=4b86ba7b522e6653, processorArchitecture=MSIL">
<HintPath>..\packages\KE.VSIX.1.2.0\lib\net47\KE.VSIX.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.CommandBars, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.CoreUtility, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.ImageCatalog, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Imaging, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.OLE.Interop, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.15.0, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Shell.15.0.15.9.28307\lib\net45\Microsoft.VisualStudio.Shell.15.0.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Framework, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
Expand Down Expand Up @@ -228,6 +240,7 @@
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http, Version=4.1.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private>
Expand Down
6 changes: 5 additions & 1 deletion VisualDump/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Threading" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-16.0.0.0" newVersion="16.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-15.8.0.0" newVersion="15.8.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Validation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
Expand Down Expand Up @@ -50,6 +50,10 @@
<assemblyIdentity name="Microsoft.VisualStudio.ImageCatalog" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-16.0.0.0" newVersion="16.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="StreamJsonRpc" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<applicationSettings>
Expand Down
3 changes: 2 additions & 1 deletion VisualDump/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<packages>
<package id="EnvDTE" version="8.0.2" targetFramework="net471" />
<package id="EnvDTE80" version="8.0.3" targetFramework="net472" />
<package id="KE.VSIX" version="1.2.0" targetFramework="net472" />
<package id="Microsoft.VisualStudio.ComponentModelHost" version="16.0.467" targetFramework="net472" />
<package id="Microsoft.VisualStudio.CoreUtility" version="16.0.467" targetFramework="net472" />
<package id="Microsoft.VisualStudio.ImageCatalog" version="16.0.28727" targetFramework="net472" />
Expand All @@ -10,7 +11,7 @@
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6071" targetFramework="net471" />
<package id="Microsoft.VisualStudio.SDK.Analyzers" version="15.8.36" targetFramework="net472" />
<package id="Microsoft.VisualStudio.SDK.EmbedInteropTypes" version="15.0.27" targetFramework="net472" />
<package id="Microsoft.VisualStudio.Shell.15.0" version="15.0.26606" targetFramework="net472" />
<package id="Microsoft.VisualStudio.Shell.15.0" version="15.9.28307" targetFramework="net472" />
<package id="Microsoft.VisualStudio.Shell.Framework" version="16.0.28729" targetFramework="net472" />
<package id="Microsoft.VisualStudio.Shell.Interop" version="7.10.6072" targetFramework="net472" />
<package id="Microsoft.VisualStudio.Shell.Interop.10.0" version="10.0.30320" targetFramework="net472" />
Expand Down
6 changes: 3 additions & 3 deletions VisualDump/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?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="bf22b5f8-9ec7-4810-880d-8d2bec2b68af" Version="2.0" Language="en-US" Publisher="Kir_Antipov" />
<Identity Id="bf22b5f8-9ec7-4810-880d-8d2bec2b68af" Version="2.1" Language="en-US" Publisher="Kir_Antipov" />
<DisplayName>Visual Dump</DisplayName>
<Description xml:space="preserve">This extension allows you to view a visual dump of your objects during the debugging of the program in Visual Studio</Description>
<Icon>Images\VSPackageIcon.ico</Icon>
<PreviewImage>Images\VSPackageIcon.ico</PreviewImage>
<Icon>Images\VSPackageIcon256x256.png</Icon>
<PreviewImage>Images\VSPackageIcon128x128.png</PreviewImage>
<Tags>Visual Dump, VisualDump, Dump, Dumping, LINQPad</Tags>
</Metadata>
<Installation>
Expand Down

0 comments on commit 56d93f6

Please sign in to comment.