Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
codestackdev committed Oct 22, 2019
2 parents a2b5b76 + 7656b2b commit 7d414dd
Show file tree
Hide file tree
Showing 37 changed files with 1,264 additions and 317 deletions.
24 changes: 0 additions & 24 deletions CodeMaid.config

This file was deleted.

10 changes: 5 additions & 5 deletions Installer/AddInReg.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
</Class>
<File Id="fil4320846A83E1D6A9BFA99753384C2099" KeyPath="yes" Source="$(var.SourceOutDir)\CodeStack.Sw.MyToolbar.dll" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="Class" Value="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="CodeBase" Value="file:///[#fil4320846A83E1D6A9BFA99753384C2099]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.2.0.0" Name="Class" Value="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.2.0.0" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.2.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.2.0.0" Name="CodeBase" Value="file:///[#fil4320846A83E1D6A9BFA99753384C2099]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="Class" Value="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="CodeBase" Value="file:///[#fil4320846A83E1D6A9BFA99753384C2099]" Type="string" Action="write" />
</Component>
Expand Down
2 changes: 1 addition & 1 deletion Installer/AddInRegistry.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<RegistryValue Root="HKCU" Key="Software\SolidWorks\AddInsStartup\{63496b16-e9ad-4d3a-8473-99d124a1672b}" Value="1" Type="integer" Action="write" />
<RegistryValue Root="HKLM" Key="Software\SolidWorks\Addins\{63496b16-e9ad-4d3a-8473-99d124a1672b}" Value="0" Type="integer" Action="write" />
<RegistryValue Root="HKLM" Key="Software\SolidWorks\Addins\{63496b16-e9ad-4d3a-8473-99d124a1672b}" Name="Description" Value="Add-in for managing custom toolbars" Type="string" Action="write" />
<RegistryValue Root="HKLM" Key="Software\SolidWorks\Addins\{63496b16-e9ad-4d3a-8473-99d124a1672b}" Name="Title" Value="MyToolbar" Type="string" Action="write" />
<RegistryValue Root="HKLM" Key="Software\SolidWorks\Addins\{63496b16-e9ad-4d3a-8473-99d124a1672b}" Name="Title" Value="MyToolbar (Beta)" Type="string" Action="write" />
</Component>
</Fragment>
</Wix>
27 changes: 0 additions & 27 deletions Installer/Addin11.wxs

This file was deleted.

2 changes: 1 addition & 1 deletion Installer/Installer.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
<HeatFile File="..\Build\CodeStack.Sw.MyToolbar.dll" PreprocessorVariable="var.SourceOutDir" OutputFile="AddInReg.wxs" ComponentGroupName="AddInComRegGroup" DirectoryRefId="INSTALLFOLDER" AutogenerateGuids="true" ToolPath="$(WixToolPath)" SuppressFragments="false" SuppressRegistry="false" SuppressCom="false" SuppressRootDirectory="true" />
</Target>
<PropertyGroup>
<PreBuildEvent>"%25Wix%25bin\heat" file "$(SolutionDir)Build\CodeStack.Sw.MyToolbar.dll" -gg -srd -sfrag -template fragment -cg AddinComponents -var var.SourceOutDir -dr INSTALLFOLDER -out "$(ProjectDir)Addin11.wxs"</PreBuildEvent>
<PreBuildEvent />
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Installer/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="MyToolbar" Language="1033" Version="2.1.0.0" Manufacturer="CodeStack" UpgradeCode="{61EB1313-A362-41AC-A3D5-F50D43CE74D8}">
<Product Id="*" Name="MyToolbar (Beta)" Language="1033" Version="2.2.0.0" Manufacturer="CodeStack" UpgradeCode="{61EB1313-A362-41AC-A3D5-F50D43CE74D8}">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

<MajorUpgrade DowngradeErrorMessage="A newer version of MyToolbar is already installed." />
Expand Down
28 changes: 14 additions & 14 deletions MyToolbar.Tests/MyToolbar.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,35 @@
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CodeStack.SwEx.AddIn, Version=0.7.0.0, Culture=neutral, PublicKeyToken=a46023996d4724e7, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.AddIn.0.7.0\lib\net40\CodeStack.SwEx.AddIn.dll</HintPath>
<Private>True</Private>
<Reference Include="CodeStack.SwEx.AddIn, Version=0.8.1.0, Culture=neutral, PublicKeyToken=a46023996d4724e7, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.AddIn.0.8.1\lib\net40\CodeStack.SwEx.AddIn.dll</HintPath>
</Reference>
<Reference Include="CodeStack.SwEx.Common, Version=0.9.6.0, Culture=neutral, PublicKeyToken=a46023996d4724e7, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.6\lib\net40\CodeStack.SwEx.Common.dll</HintPath>
<Private>True</Private>
<Reference Include="CodeStack.SwEx.Common, Version=0.9.9.0, Culture=neutral, PublicKeyToken=a46023996d4724e7, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.9\lib\net40\CodeStack.SwEx.Common.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.11.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.11.0\lib\net45\Moq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="SolidWorks.Interop.sldworks, Version=26.2.0.63, Culture=neutral, PublicKeyToken=7c4797c3e4eeac03, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.6\lib\net40\SolidWorks.Interop.sldworks.dll</HintPath>
<Reference Include="SolidWorks.Interop.sldworks, Version=27.1.0.72, Culture=neutral, PublicKeyToken=7c4797c3e4eeac03, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.9\lib\net40\SolidWorks.Interop.sldworks.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="SolidWorks.Interop.swconst, Version=26.2.0.63, Culture=neutral, PublicKeyToken=19f43e188e4269d8, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.6\lib\net40\SolidWorks.Interop.swconst.dll</HintPath>
<Reference Include="SolidWorks.Interop.swconst, Version=27.1.0.72, Culture=neutral, PublicKeyToken=19f43e188e4269d8, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.9\lib\net40\SolidWorks.Interop.swconst.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="SolidWorks.Interop.swpublished, Version=26.2.0.63, Culture=neutral, PublicKeyToken=89a97bdc5284e6d8, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.6\lib\net40\SolidWorks.Interop.swpublished.dll</HintPath>
<Reference Include="SolidWorks.Interop.swpublished, Version=27.1.0.72, Culture=neutral, PublicKeyToken=89a97bdc5284e6d8, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.9\lib\net40\SolidWorks.Interop.swpublished.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="SolidWorksTools, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bd18593873b4686d, processorArchitecture=MSIL">
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.6\lib\net40\SolidWorksTools.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\CodeStack.SwEx.Common.0.9.9\lib\net40\SolidWorksTools.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
5 changes: 4 additions & 1 deletion MyToolbar.Tests/UITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using System.Collections.Generic;
using System.Linq;

namespace MyToolbar.Tests
{
Expand All @@ -32,9 +34,10 @@ public void Setup()

m_Services = new ServicesContainer(
appMock.Object,
new Mock<IToolbarAddIn>().Object,
new Mock<CodeStack.SwEx.Common.Diagnostics.ILogger>().Object);
}

[TestMethod]
public void DisplayCommandManagerView()
{
Expand Down
12 changes: 12 additions & 0 deletions MyToolbar.Tests/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SolidWorks.Interop.sldworks" publicKeyToken="7c4797c3e4eeac03" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-26.2.0.63" newVersion="26.2.0.63" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SolidWorks.Interop.swpublished" publicKeyToken="89a97bdc5284e6d8" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-26.2.0.63" newVersion="26.2.0.63" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SolidWorks.Interop.swconst" publicKeyToken="19f43e188e4269d8" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-26.2.0.63" newVersion="26.2.0.63" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
5 changes: 3 additions & 2 deletions MyToolbar.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="4.4.0" targetFramework="net461" />
<package id="CodeStack.SwEx.AddIn" version="0.7.0" targetFramework="net461" />
<package id="CodeStack.SwEx.Common" version="0.9.6" targetFramework="net461" />
<package id="CodeStack.SwEx.AddIn" version="0.8.1" targetFramework="net461" />
<package id="CodeStack.SwEx.Common" version="0.9.9" targetFramework="net461" />
<package id="Moq" version="4.11.0" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net461" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net461" />
</packages>
8 changes: 5 additions & 3 deletions MyToolbar/Base/CommandGroupInfoSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
//Product URL: https://www.codestack.net/labs/solidworks/my-toolbar/
//**********************

using CodeStack.Sw.MyToolbar.Enums;
using CodeStack.Sw.MyToolbar.Structs;
using CodeStack.SwEx.AddIn.Core;
using SolidWorks.Interop.sldworks;
using System;
using System.Linq;

Expand All @@ -16,7 +18,7 @@ internal class CommandGroupInfoSpec : CommandGroupSpec
{
public event Action<CommandMacroInfo> MacroCommandClick;

internal CommandGroupInfoSpec(CommandGroupInfo info)
internal CommandGroupInfoSpec(CommandGroupInfo info, ISldWorks app)
{
Id = info.Id;
Title = info.Title;
Expand All @@ -25,10 +27,10 @@ internal CommandGroupInfoSpec(CommandGroupInfo info)

if (info.Commands != null)
{
Commands = info.Commands.Select(
Commands = info.Commands.Where(c => c.Triggers.HasFlag(Triggers_e.Button)).Select(
c =>
{
var spec = new CommandItemInfoSpec(c);
var spec = new CommandItemInfoSpec(c, app);
spec.MacroCommandClick += OnMacroCommandClick;
return spec;
}).ToArray();
Expand Down
20 changes: 19 additions & 1 deletion MyToolbar/Base/CommandItemInfoSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
//Product URL: https://www.codestack.net/labs/solidworks/my-toolbar/
//**********************

using CodeStack.Sw.MyToolbar.Helpers;
using CodeStack.Sw.MyToolbar.Structs;
using CodeStack.SwEx.AddIn.Core;
using CodeStack.SwEx.AddIn.Enums;
using SolidWorks.Interop.sldworks;
using System;

namespace CodeStack.Sw.MyToolbar.Base
Expand All @@ -16,10 +19,13 @@ internal class CommandItemInfoSpec : CommandSpec
public event Action<CommandMacroInfo> MacroCommandClick;

private readonly CommandMacroInfo m_Info;
private readonly ISldWorks m_App;

internal CommandItemInfoSpec(CommandMacroInfo info)
internal CommandItemInfoSpec(CommandMacroInfo info, ISldWorks app)
{
m_Info = info;
m_App = app;

UserId = info.Id;
Title = info.Title;
Tooltip = info.Description;
Expand All @@ -32,5 +38,17 @@ public override void OnClick()
{
MacroCommandClick?.Invoke(m_Info);
}

public override CommandItemEnableState_e OnEnable()
{
if (m_Info.Scope.IsInScope(m_App))
{
return CommandItemEnableState_e.DeselectEnable;
}
else
{
return CommandItemEnableState_e.DeselectDisable;
}
}
}
}
Loading

0 comments on commit 7d414dd

Please sign in to comment.