feat: scaffold P_Rec_Annot .NET 8 architecture

This commit is contained in:
codex
2026-07-31 09:57:53 +03:00
parent 34222cedc8
commit 60b3934cd2
30 changed files with 482 additions and 0 deletions
@@ -0,0 +1,15 @@
namespace PRecAnnot.Plant3D2026;
/// <summary>
/// Autodesk-facing composition-root lifecycle. The concrete IExtensionApplication
/// implementation is enabled only after the Plant 3D 2026 SDK reference contract
/// is verified on the target installation.
/// </summary>
public sealed class EntryPointLifecycle : IDisposable
{
private int _initialized;
public bool IsInitialized => Volatile.Read(ref _initialized) == 1;
public bool Initialize() => Interlocked.Exchange(ref _initialized, 1) == 0;
public void Terminate() => Interlocked.Exchange(ref _initialized, 0);
public void Dispose() => Terminate();
}
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup><TargetFramework>net8.0-windows</TargetFramework><PlatformTarget>x64</PlatformTarget><UseWindowsForms>true</UseWindowsForms></PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PRecAnnot.Abstractions\PRecAnnot.Abstractions.csproj" />
<ProjectReference Include="..\PRecAnnot.Application\PRecAnnot.Application.csproj" />
<ProjectReference Include="..\PRecAnnot.Core\PRecAnnot.Core.csproj" />
</ItemGroup>
<ItemGroup Condition="Exists('$(Plant3D2026InstallDir)')">
<Reference Include="AcMgd"><HintPath>$(Plant3D2026InstallDir)\AcMgd.dll</HintPath><Private>false</Private></Reference>
<Reference Include="AcDbMgd"><HintPath>$(Plant3D2026InstallDir)\AcDbMgd.dll</HintPath><Private>false</Private></Reference>
<Reference Include="AcCoreMgd"><HintPath>$(Plant3D2026InstallDir)\AcCoreMgd.dll</HintPath><Private>false</Private></Reference>
<Reference Include="PnPProjectManagerMgd"><HintPath>$(Plant3D2026InstallDir)\PLNT3D\PnPProjectManagerMgd.dll</HintPath><Private>false</Private></Reference>
<Reference Include="PnPDataLinks"><HintPath>$(Plant3D2026InstallDir)\PLNT3D\PnPDataLinks.dll</HintPath><Private>false</Private></Reference>
</ItemGroup>
</Project>
@@ -0,0 +1,14 @@
namespace PRecAnnot.Plant3D2026;
public sealed record Plant3D2026Availability(bool IsAvailable, string InstallDirectory, IReadOnlyList<string> MissingAssemblies)
{
public static Plant3D2026Availability Detect(string installDirectory)
{
var expected = new[] { "AcMgd.dll", "AcDbMgd.dll", "AcCoreMgd.dll", Path.Combine("PLNT3D", "PnPProjectManagerMgd.dll"), Path.Combine("PLNT3D", "PnPDataLinks.dll") };
var missing = expected.Where(x => !File.Exists(Path.Combine(installDirectory, x))).ToArray();
return new(missing.Length == 0, installDirectory, missing);
}
}
public sealed class Plant3D2026BlockedException(Plant3D2026Availability availability)
: InvalidOperationException($"Plant 3D 2026 assemblies are unavailable at '{availability.InstallDirectory}'. Missing: {string.Join(", ", availability.MissingAssemblies)}") { }