Skip to content

Commit 1af03ec

Browse files
committed
[Add] Use of App Center
1 parent 5655ccb commit 1af03ec

4 files changed

Lines changed: 73 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

66
# User-specific files
7+
AppCenterConfiguration.cs
78
*.rsuser
89
*.suo
910
*.user

ImageInserter/ImageInserter.csproj

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
<FriendlyName>ImageInserter</FriendlyName>
4545
<OfficeApplicationDescription />
4646
<LoadBehavior>3</LoadBehavior>
47+
<NuGetPackageImportStamp>
48+
</NuGetPackageImportStamp>
4749
</PropertyGroup>
4850
<ItemGroup>
4951
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
@@ -123,11 +125,51 @@
123125
-->
124126
<ItemGroup>
125127
<Reference Include="Accessibility" />
128+
<Reference Include="Microsoft.AppCenter, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
129+
<HintPath>..\packages\Microsoft.AppCenter.4.1.0\lib\net461\Microsoft.AppCenter.dll</HintPath>
130+
</Reference>
131+
<Reference Include="Microsoft.AppCenter.Analytics, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
132+
<HintPath>..\packages\Microsoft.AppCenter.Analytics.4.1.0\lib\net461\Microsoft.AppCenter.Analytics.dll</HintPath>
133+
</Reference>
134+
<Reference Include="Microsoft.AppCenter.Crashes, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
135+
<HintPath>..\packages\Microsoft.AppCenter.Crashes.4.1.0\lib\net461\Microsoft.AppCenter.Crashes.dll</HintPath>
136+
</Reference>
126137
<Reference Include="Microsoft.VisualBasic" />
138+
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
139+
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
140+
</Reference>
141+
<Reference Include="SQLitePCLRaw.batteries_v2, Version=2.0.2.669, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
142+
<HintPath>..\packages\SQLitePCLRaw.bundle_green.2.0.2\lib\net461\SQLitePCLRaw.batteries_v2.dll</HintPath>
143+
</Reference>
144+
<Reference Include="SQLitePCLRaw.core, Version=2.0.2.669, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
145+
<HintPath>..\packages\SQLitePCLRaw.core.2.0.2\lib\netstandard2.0\SQLitePCLRaw.core.dll</HintPath>
146+
</Reference>
147+
<Reference Include="SQLitePCLRaw.nativelibrary, Version=2.0.2.669, Culture=neutral, PublicKeyToken=502ed628492ab262, processorArchitecture=MSIL">
148+
<HintPath>..\packages\SQLitePCLRaw.bundle_green.2.0.2\lib\net461\SQLitePCLRaw.nativelibrary.dll</HintPath>
149+
</Reference>
150+
<Reference Include="SQLitePCLRaw.provider.dynamic_cdecl, Version=2.0.2.669, Culture=neutral, PublicKeyToken=b68184102cba0b3b, processorArchitecture=MSIL">
151+
<HintPath>..\packages\SQLitePCLRaw.provider.dynamic_cdecl.2.0.2\lib\netstandard2.0\SQLitePCLRaw.provider.dynamic_cdecl.dll</HintPath>
152+
</Reference>
127153
<Reference Include="System" />
154+
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
155+
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
156+
</Reference>
128157
<Reference Include="System.Configuration" />
129158
<Reference Include="System.Data" />
159+
<Reference Include="System.Deployment" />
130160
<Reference Include="System.Drawing" />
161+
<Reference Include="System.Management" />
162+
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
163+
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
164+
</Reference>
165+
<Reference Include="System.Net.Http" />
166+
<Reference Include="System.Numerics" />
167+
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
168+
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
169+
</Reference>
170+
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
171+
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
172+
</Reference>
131173
<Reference Include="System.Windows.Forms" />
132174
<Reference Include="System.Xml" />
133175
<Reference Include="System.Core" />
@@ -181,6 +223,7 @@
181223
can be found.
182224
-->
183225
<ItemGroup>
226+
<Compile Include="AppCenterConfiguration.cs" />
184227
<Compile Include="Properties\MessageBox.Designer.cs">
185228
<AutoGen>True</AutoGen>
186229
<DesignTime>True</DesignTime>
@@ -223,6 +266,7 @@
223266
</EmbeddedResource>
224267
<None Include="app.config" />
225268
<None Include="ImageInserter_TemporaryKey.pfx" />
269+
<None Include="packages.config" />
226270
<None Include="Properties\Settings.settings">
227271
<Generator>SettingsSingleFileGenerator</Generator>
228272
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -281,4 +325,11 @@
281325
</FlavorProperties>
282326
</VisualStudio>
283327
</ProjectExtensions>
328+
<Import Project="..\packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets" Condition="Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets')" />
329+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
330+
<PropertyGroup>
331+
<ErrorText>このプロジェクトは、このコンピューター上にない NuGet パッケージを参照しています。それらのパッケージをダウンロードするには、[NuGet パッケージの復元] を使用します。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。見つからないファイルは {0} です。</ErrorText>
332+
</PropertyGroup>
333+
<Error Condition="!Exists('..\packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets'))" />
334+
</Target>
284335
</Project>

ImageInserter/ThisAddIn.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
using Excel = Microsoft.Office.Interop.Excel;
77
using Office = Microsoft.Office.Core;
88
using Microsoft.Office.Tools.Excel;
9+
using Microsoft.AppCenter;
10+
using Microsoft.AppCenter.Analytics;
11+
using Microsoft.AppCenter.Crashes;
912

1013
namespace ImageInserter
1114
{
@@ -14,6 +17,7 @@ public partial class ThisAddIn
1417
//アドイン起動時にリボンの読み込みを行う処理
1518
protected override Office.IRibbonExtensibility CreateRibbonExtensibilityObject()
1619
{
20+
AppCenter.Start(AppCenterConfiguration.secret, typeof(Analytics), typeof(Crashes));
1721
#if false
1822
// 設定前のカルチャを表示
1923
System.Diagnostics.Debug.WriteLine("CurrentCulture: {0}", System.Threading.Thread.CurrentThread.CurrentCulture.Name);
@@ -47,7 +51,7 @@ private void InternalStartup()
4751
this.Startup += new System.EventHandler(ThisAddIn_Startup);
4852
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
4953
}
50-
51-
#endregion
54+
55+
#endregion
5256
}
5357
}

ImageInserter/packages.config

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.AppCenter" version="4.1.0" targetFramework="net48" />
4+
<package id="Microsoft.AppCenter.Analytics" version="4.1.0" targetFramework="net48" />
5+
<package id="Microsoft.AppCenter.Crashes" version="4.1.0" targetFramework="net48" />
6+
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net48" />
7+
<package id="SQLitePCLRaw.bundle_green" version="2.0.2" targetFramework="net48" />
8+
<package id="SQLitePCLRaw.core" version="2.0.2" targetFramework="net48" />
9+
<package id="SQLitePCLRaw.lib.e_sqlite3" version="2.0.2" targetFramework="net48" />
10+
<package id="SQLitePCLRaw.provider.dynamic_cdecl" version="2.0.2" targetFramework="net48" />
11+
<package id="System.Buffers" version="4.4.0" targetFramework="net48" />
12+
<package id="System.Memory" version="4.5.3" targetFramework="net48" />
13+
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net48" />
14+
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net48" />
15+
</packages>

0 commit comments

Comments
 (0)