Skip to content

Commit

Permalink
Merge pull request #4 from andeart/develop
Browse files Browse the repository at this point in the history
Minor flow improvements.
  • Loading branch information
andeart authored Sep 16, 2018
2 parents 46f3fa0 + b7264a2 commit e82652d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.ComponentModel.Design;
using System.Windows.Forms;
using Andeart.CaseConversion;
using Andeart.JsonButlerIde.Forms;
using Andeart.JsonButlerIde.Utilities;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.TextManager.Interop;
Expand Down
4 changes: 2 additions & 2 deletions JsonButlerIde/JsonButlerIde/Commands/SerializeTypeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ private void Execute (object sender, EventArgs args)
ITypeResolutionService resolutionService = GetResolutionService (codeElement.ProjectItem.ContainingProject);
Type type = resolutionService.GetType (codeElement.FullName);

ButlerSerializerSettings serializerSettings = new ButlerSerializerSettings (type.Assembly);
ButlerSerializerSettings serializerSettings = new ButlerSerializerSettings (type?.Assembly);

JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings ();
JsonButlerSerializerContractResolver contractResolver = new JsonButlerSerializerContractResolver ();
SerializerContractResolver contractResolver = new SerializerContractResolver ();
contractResolver.SerializationType = _package.SerializationType;
jsonSerializerSettings.ContractResolver = contractResolver;
jsonSerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
Expand Down
2 changes: 1 addition & 1 deletion JsonButlerIde/JsonButlerIde/JsonButlerIde.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<Compile Include="Options\PropertySerializationType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utilities\EditorUtilities.cs" />
<Compile Include="Utilities\JsonButlerSerializerContractResolver.cs" />
<Compile Include="Utilities\SerializerContractResolver.cs" />
<Compile Include="Utilities\TwoWayDictionary.cs" />
<Compile Include="VSPackage.Designer.cs">
<AutoGen>True</AutoGen>
Expand Down
9 changes: 6 additions & 3 deletions JsonButlerIde/JsonButlerIde/JsonButlerIdePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ private void OnDteInitialized (DTE2 dte)
public void DoAlert (string alertMessage)
{
_statusBar = _statusBar ?? (_statusBar = GetService (typeof(SVsStatusbar)) as IVsStatusbar);
_statusBar.IsFrozen (out int frozen);
if (frozen == 0)
if (_statusBar != null)
{
_statusBar.SetText ($"JsonButler: {alertMessage}");
_statusBar.IsFrozen (out int frozen);
if (frozen == 0)
{
_statusBar.SetText ($"JsonButler: {alertMessage}");
}
}

AlertWindow alertWindow = new AlertWindow ();
Expand Down
2 changes: 1 addition & 1 deletion JsonButlerIde/JsonButlerIde/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
// 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 ("0.10.1.0")]
[assembly: AssemblyVersion("0.11.1.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Andeart.JsonButlerIde.Utilities
{

internal class JsonButlerSerializerContractResolver : DefaultContractResolver
internal class SerializerContractResolver : DefaultContractResolver
{
public PropertySerializationType SerializationType { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion JsonButlerIde/JsonButlerIde/Utilities/TwoWayDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Andeart.JsonButlerIde.Utilities
{

internal class TwoWayDictionary<TKey, TValue>
internal sealed class TwoWayDictionary<TKey, TValue>
{
private readonly Dictionary<TKey, TValue> _forward;
private readonly Dictionary<TValue, TKey> _backward;
Expand Down
2 changes: 1 addition & 1 deletion JsonButlerIde/JsonButlerIde/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="JsonButlerIde.74be87e6-f282-43d8-b8a6-cea1d2376938" Version="0.10.1.0" Language="en-US" Publisher="Anurag Devanapally" />
<Identity Id="JsonButlerIde.74be87e6-f282-43d8-b8a6-cea1d2376938" Version="0.11.1.0" Language="en-US" Publisher="Anurag Devanapally" />
<DisplayName>JsonButlerIde</DisplayName>
<Description xml:space="preserve">JsonButler adds several JSON-conversion features within the IDE. Generate C# types from JSON data, serialize C# types to JSON without instantiating objects, easily change cases of phrases, and so on. More features coming soon- stay updated!</Description>
<MoreInfo>https://github.com/andeart/JsonButler-IDE</MoreInfo>
Expand Down

0 comments on commit e82652d

Please sign in to comment.