Skip to content

Commit

Permalink
Updated DirectN nuget package.
Browse files Browse the repository at this point in the history
  • Loading branch information
AelyoSoftWorks committed Mar 22, 2024
1 parent edbff50 commit ea5ef54
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Wice.DevTools/Wice.DevTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DirectN">
<Version>1.15.0.2</Version>
<Version>1.16.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
4 changes: 2 additions & 2 deletions Wice.Samples.Gallery/Wice.Samples.Gallery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DirectN">
<Version>1.15.0.2</Version>
<Version>1.16.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Windows.SDK.Contracts">
<Version>10.0.22621.2428</Version>
<Version>10.0.22621.3233</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Wice.Tests/Wice.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DirectN">
<Version>1.15.0.2</Version>
<Version>1.16.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Windows.SDK.Contracts">
<Version>10.0.22621.2428</Version>
<Version>10.0.22621.3233</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
25 changes: 0 additions & 25 deletions Wice/Interop/ICompositorInterop.cs

This file was deleted.

6 changes: 3 additions & 3 deletions Wice/Properties/AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Reflection;

[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyInformationalVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: AssemblyInformationalVersion("1.2.1.0")]
18 changes: 18 additions & 0 deletions Wice/Utilities/WinRTUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,24 @@ public static T WinRTCast<T>(this object obj, bool throwOnError = true) where T
#endif
}

public static T WinRTCast<T>(this IntPtr unk, bool throwOnError = true) where T : class
{
if (unk == IntPtr.Zero)
return default;

if (throwOnError)
return WinRTCast<T>(Marshal.GetObjectForIUnknown(unk), throwOnError);

try
{
return WinRTCast<T>(Marshal.GetObjectForIUnknown(unk), false);
}
catch
{
return default;
}
}

public static T ComCast<T>(this object obj, bool throwOnError = true) where T : class
{
if (obj == null)
Expand Down
5 changes: 2 additions & 3 deletions Wice/Wice.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
<Compile Include="EditorHost.cs" />
<Compile Include="EventTrigger.cs" />
<Compile Include="Interop\ICompositionTarget.cs" />
<Compile Include="Interop\ICompositorInterop.cs" />
<Compile Include="Interop\IGeometrySource2DWinRT.cs" />
<Compile Include="Interop\IGraphicsEffectSourceWinRT.cs" />
<Compile Include="Interop\IGraphicsEffectWinRT.cs" />
Expand Down Expand Up @@ -370,10 +369,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DirectN">
<Version>1.15.0.2</Version>
<Version>1.16.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Windows.SDK.Contracts">
<Version>10.0.22621.2428</Version>
<Version>10.0.22621.3233</Version>
</PackageReference>
<PackageReference Include="System.Numerics.Vectors">
<Version>4.5.0</Version>
Expand Down
4 changes: 2 additions & 2 deletions Wice/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,8 @@ protected virtual CompositionGraphicsDevice CreateCompositionDevice()
{
var interop = CompositorController.Compositor.ComCast<ICompositorInterop>();
var d2d1 = _d2D1Device.Value;
var hr = interop.CreateGraphicsDevice(d2d1.Object, out var obj);
var dev = obj.WinRTCast<CompositionGraphicsDevice>();
var hr = interop.CreateGraphicsDevice(d2d1.Object, out var unk);
var dev = unk.WinRTCast<CompositionGraphicsDevice>();
if (hr.Value < 0)
{
try
Expand Down
2 changes: 1 addition & 1 deletion WiceCore.Samples.Gallery/WiceCore.Samples.Gallery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<Compile Include="..\Wice.Samples.Gallery\Samples\Text\RichTextBox\RichTextBoxSample.cs" Link="Samples\Text\RichTextBox\RichTextBoxSample.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DirectNCore" Version="1.15.0.2" />
<PackageReference Include="DirectNCore" Version="1.16.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WiceCore\WiceCore.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion WiceCore.Tests/WiceCore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
<EmbeddedResource Include="..\Wice.Tests\pg61797.txt" Link="pg61797.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DirectNCore" Version="1.15.0.2" />
<PackageReference Include="DirectNCore" Version="1.16.0" />
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions WiceCore/WiceCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@
<Compile Include="..\Wice\PointerDragEventArgs.cs" Link="PointerDragEventArgs.cs" />
<Compile Include="..\Wice\DragEventArgs.cs" Link="DragEventArgs.cs" />
<Compile Include="..\Wice\Interop\ICompositionTarget.cs" Link="Interop\ICompositionTarget.cs" />
<Compile Include="..\Wice\Interop\ICompositorInterop.cs" Link="Interop\ICompositorInterop.cs" />
<Compile Include="..\Wice\Utilities\Extensions.cs" Link="Utilities\Extensions.cs" />
<Compile Include="..\Wice\Interop\IPropertyValueStatics.cs" Link="Interop\IPropertyValueStatics.cs" />
<Compile Include="..\Wice\Interop\IPropertyValueStaticsExtensions.cs" Link="Interop\IPropertyValueStaticsExtensions.cs" />
Expand All @@ -332,6 +331,6 @@
<Compile Include="..\Wice\PointerUpdateEventArgs.cs" Link="PointerUpdateEventArgs.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DirectNCore" Version="1.15.0.2" />
<PackageReference Include="DirectNCore" Version="1.16.0" />
</ItemGroup>
</Project>

0 comments on commit ea5ef54

Please sign in to comment.