diff --git a/Build/NuGetPackageSpecs/AudioHandling.Sample.nuspec b/Build/NuGetPackageSpecs/AudioHandling.Sample.nuspec index 6b1f1b137..54af0f67a 100644 --- a/Build/NuGetPackageSpecs/AudioHandling.Sample.nuspec +++ b/Build/NuGetPackageSpecs/AudioHandling.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.AudioHandling - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Audio Handling Sample @@ -13,18 +13,18 @@ Demonstrates how to handle Audio in Duality. This package contains a sample Scene for handling audio using SoundEmitters, and another one for handling it manually using code. Duality Sample Plugin Audio - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/Base.Editor.nuspec b/Build/NuGetPackageSpecs/Base.Editor.nuspec index 02abe7280..7b109057d 100644 --- a/Build/NuGetPackageSpecs/Base.Editor.nuspec +++ b/Build/NuGetPackageSpecs/Base.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor.Plugins.Base - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Editor Base Infrastructure @@ -16,8 +16,8 @@ Patch Version Update - - + + diff --git a/Build/NuGetPackageSpecs/BasicMenu.Sample.nuspec b/Build/NuGetPackageSpecs/BasicMenu.Sample.nuspec index 42904f82a..e37ebff93 100644 --- a/Build/NuGetPackageSpecs/BasicMenu.Sample.nuspec +++ b/Build/NuGetPackageSpecs/BasicMenu.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.BasicMenu - 3.0.4 + 4.0.0-alpha Pilati Alessandro Pilati Alessandro Basic Menu Sample @@ -13,18 +13,18 @@ Demonstrates a GameObject-based way to create a game menu. This package contains an object-based game menu sample with a custom Font, multiple menu pages and simple color animations. Duality Sample Plugin Menu - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/BasicShaders.Sample.nuspec b/Build/NuGetPackageSpecs/BasicShaders.Sample.nuspec index 7d656b5ad..564eb3bb8 100644 --- a/Build/NuGetPackageSpecs/BasicShaders.Sample.nuspec +++ b/Build/NuGetPackageSpecs/BasicShaders.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.BasicShaders - 3.0.4 + 4.0.0-alpha Pilati Alessandro, Fedja Adam Pilati Alessandro, Fedja Adam Basic Shaders Sample @@ -13,14 +13,16 @@ Demonstrates how to use shaders in Duality. This package contains a sample Scene that uses some very basic shaders to render sprites. Duality Sample Plugin Shaders Rendering - Patch Version Update - + Patch Version Update + + + - - + + - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/Benchmarks.Sample.nuspec b/Build/NuGetPackageSpecs/Benchmarks.Sample.nuspec index f221eb736..6e09c209b 100644 --- a/Build/NuGetPackageSpecs/Benchmarks.Sample.nuspec +++ b/Build/NuGetPackageSpecs/Benchmarks.Sample.nuspec @@ -13,18 +13,18 @@ Implements a set of benchmarks for profiling Duality. This package implements a set of benchmarks for profiling Duality performance on your system. Duality Sample Plugin Benchmark Rendering - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/CamView.Editor.nuspec b/Build/NuGetPackageSpecs/CamView.Editor.nuspec index 25398ea19..cda3bdc54 100644 --- a/Build/NuGetPackageSpecs/CamView.Editor.nuspec +++ b/Build/NuGetPackageSpecs/CamView.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor.Plugins.CamView - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Camera View @@ -16,8 +16,8 @@ Patch Version Update - - + + diff --git a/Build/NuGetPackageSpecs/CameraController.Sample.nuspec b/Build/NuGetPackageSpecs/CameraController.Sample.nuspec index 6ded1caa4..018fcb1b4 100644 --- a/Build/NuGetPackageSpecs/CameraController.Sample.nuspec +++ b/Build/NuGetPackageSpecs/CameraController.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.CameraController - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Camera Controller Sample @@ -13,18 +13,18 @@ Demonstrates various camera controller Components. This package contains a testbed for camera controller Components and various sample implementations. Duality Sample Plugin Camera - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/Compatibility.Core.nuspec b/Build/NuGetPackageSpecs/Compatibility.Core.nuspec index ad0a4ed09..c1e7224ba 100644 --- a/Build/NuGetPackageSpecs/Compatibility.Core.nuspec +++ b/Build/NuGetPackageSpecs/Compatibility.Core.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Plugins.Compatibility - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Backwards Compatibility @@ -16,7 +16,7 @@ Patch Version Update - + diff --git a/Build/NuGetPackageSpecs/CustomRenderingSetup.Sample.nuspec b/Build/NuGetPackageSpecs/CustomRenderingSetup.Sample.nuspec index 5757de840..a1083a08b 100644 --- a/Build/NuGetPackageSpecs/CustomRenderingSetup.Sample.nuspec +++ b/Build/NuGetPackageSpecs/CustomRenderingSetup.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.CustomRenderingSetup - 2.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Custom Rendering Setup Sample @@ -13,18 +13,18 @@ Demonstrates various custom rendering setups for post-processing or fixed-resolution rendering. This package demonstrates custom rendering setups with fullscreen post-processing effects or fixed-resolution rendering. Duality Sample Plugin Shaders RenderSetup Rendering Postprocessing - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/DefaultOpenTKBackend.Core.nuspec b/Build/NuGetPackageSpecs/DefaultOpenTKBackend.Core.nuspec index 28d80cf0f..ea0b5e8f7 100644 --- a/Build/NuGetPackageSpecs/DefaultOpenTKBackend.Core.nuspec +++ b/Build/NuGetPackageSpecs/DefaultOpenTKBackend.Core.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Backend.DefaultOpenTK - 3.2.0 + 4.0.0-alpha Fedja Adam Fedja Adam OpenTK Backend @@ -16,14 +16,14 @@ Added Support for Setting Hardware Cursors #ADD: It is now possible to adjust the hardware cursor on the game window through `INativeWindow`. - + - - + + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/DefaultOpenTKBackend.Editor.nuspec b/Build/NuGetPackageSpecs/DefaultOpenTKBackend.Editor.nuspec index e74c8ffff..39461b1e9 100644 --- a/Build/NuGetPackageSpecs/DefaultOpenTKBackend.Editor.nuspec +++ b/Build/NuGetPackageSpecs/DefaultOpenTKBackend.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor.Backend.DefaultOpenTK - 3.1.3 + 4.0.0-alpha Fedja Adam Fedja Adam OpenTK Editor Backend @@ -16,9 +16,9 @@ Patch Version Update - - - + + + diff --git a/Build/NuGetPackageSpecs/DotNetFrameworkBackend.Core.nuspec b/Build/NuGetPackageSpecs/DotNetFrameworkBackend.Core.nuspec index 1f4ceb93c..ed607502f 100644 --- a/Build/NuGetPackageSpecs/DotNetFrameworkBackend.Core.nuspec +++ b/Build/NuGetPackageSpecs/DotNetFrameworkBackend.Core.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Backend.DotNetFramework - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam DotNetFramework Backend @@ -14,7 +14,7 @@ The default system backend layer for Duality. It uses regular .Net Framework classes, as are available on desktop platforms. Duality Core Plugin Backend - + Patch Version Update diff --git a/Build/NuGetPackageSpecs/DualStickSpaceShooter.Sample.nuspec b/Build/NuGetPackageSpecs/DualStickSpaceShooter.Sample.nuspec index 810b7ec1d..9b5e42b32 100644 --- a/Build/NuGetPackageSpecs/DualStickSpaceShooter.Sample.nuspec +++ b/Build/NuGetPackageSpecs/DualStickSpaceShooter.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.DualStickSpaceShooter - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Dual Stick Space Shooter Sample @@ -13,18 +13,18 @@ A small dual stick space shooter made with Duality. This package contains a small coop game for one to two players, controlled with mouse / keyboard and gamepads. Recommended to play with stereo audio at full volume. Duality Sample Plugin Game Multiplayer Coop Shooter Topdown Minimalistic - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/Duality.Docs.nuspec b/Build/NuGetPackageSpecs/Duality.Docs.nuspec index c76e40d22..48c636adc 100644 --- a/Build/NuGetPackageSpecs/Duality.Docs.nuspec +++ b/Build/NuGetPackageSpecs/Duality.Docs.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Docs - 3.0.0 + 4.0.0-alpha Fedja Adam Fedja Adam Duality Documentation @@ -16,7 +16,7 @@ Major Version Update - + diff --git a/Build/NuGetPackageSpecs/Duality.Editor.nuspec b/Build/NuGetPackageSpecs/Duality.Editor.nuspec index d1b23e555..76548f88f 100644 --- a/Build/NuGetPackageSpecs/Duality.Editor.nuspec +++ b/Build/NuGetPackageSpecs/Duality.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor - 3.1.9 + 4.0.0-alpha Fedja Adam Fedja Adam Duality Editor @@ -13,15 +13,14 @@ The Duality editor. The Duality editor. Duality Editor - Patch Version Update + - + - diff --git a/Build/NuGetPackageSpecs/Duality.Launcher.nuspec b/Build/NuGetPackageSpecs/Duality.Launcher.nuspec index 0408ff81c..05180d499 100644 --- a/Build/NuGetPackageSpecs/Duality.Launcher.nuspec +++ b/Build/NuGetPackageSpecs/Duality.Launcher.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Launcher - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Duality Launcher @@ -16,7 +16,7 @@ Patch Version Update - + diff --git a/Build/NuGetPackageSpecs/Duality.Physics.nuspec b/Build/NuGetPackageSpecs/Duality.Physics.nuspec index dfef9084b..092f70ed2 100644 --- a/Build/NuGetPackageSpecs/Duality.Physics.nuspec +++ b/Build/NuGetPackageSpecs/Duality.Physics.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Physics - 3.0.4 + 4.0.0-alpha See original project authors Fedja Adam Duality Physics diff --git a/Build/NuGetPackageSpecs/Duality.Primitives.nuspec b/Build/NuGetPackageSpecs/Duality.Primitives.nuspec index 86660dbba..27d14031c 100644 --- a/Build/NuGetPackageSpecs/Duality.Primitives.nuspec +++ b/Build/NuGetPackageSpecs/Duality.Primitives.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Primitives - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Duality Primitives diff --git a/Build/NuGetPackageSpecs/Duality.nuspec b/Build/NuGetPackageSpecs/Duality.nuspec index edccda4e1..674919ab3 100644 --- a/Build/NuGetPackageSpecs/Duality.nuspec +++ b/Build/NuGetPackageSpecs/Duality.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality - 3.2.1 + 4.0.0-alpha Fedja Adam Fedja Adam Duality Core @@ -16,9 +16,9 @@ - + - + diff --git a/Build/NuGetPackageSpecs/DynamicLighting.Sample.nuspec b/Build/NuGetPackageSpecs/DynamicLighting.Sample.nuspec index 5cc123573..8c90deda5 100644 --- a/Build/NuGetPackageSpecs/DynamicLighting.Sample.nuspec +++ b/Build/NuGetPackageSpecs/DynamicLighting.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.DynamicLighting - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam DynamicLighting Sample @@ -13,23 +13,19 @@ Introduces a naive implementation of dynamic lighting Components. Introduces a naive implementation of dynamic lighting Components. Duality Sample Plugin Rendering Lighting Component - Patch Version Update - + Patch Version Update + + + - - + + - + - - - - - - \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/FlapOrDie.Sample.nuspec b/Build/NuGetPackageSpecs/FlapOrDie.Sample.nuspec index d571a811f..0dc579d50 100644 --- a/Build/NuGetPackageSpecs/FlapOrDie.Sample.nuspec +++ b/Build/NuGetPackageSpecs/FlapOrDie.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.FlapOrDie - 3.0.4 + 4.0.0-alpha Pilati Alessandro Pilati Alessandro Flap-Or-Die Sample @@ -13,18 +13,18 @@ A clone of a commonly known casual game in Duality. This package contains a simple implementation of a commonly known casual game. Duality Sample Plugin Game - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/HelpAdvisor.Editor.nuspec b/Build/NuGetPackageSpecs/HelpAdvisor.Editor.nuspec index 0ae7c07f8..0b19f2f5c 100644 --- a/Build/NuGetPackageSpecs/HelpAdvisor.Editor.nuspec +++ b/Build/NuGetPackageSpecs/HelpAdvisor.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor.Plugins.HelpAdvisor - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Help Advisor @@ -16,8 +16,8 @@ Patch Version Update - - + + diff --git a/Build/NuGetPackageSpecs/InputHandling.Sample.nuspec b/Build/NuGetPackageSpecs/InputHandling.Sample.nuspec index c54efb50d..4205957fb 100644 --- a/Build/NuGetPackageSpecs/InputHandling.Sample.nuspec +++ b/Build/NuGetPackageSpecs/InputHandling.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.InputHandling - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Input Handling Sample @@ -13,18 +13,18 @@ Demonstrates how to access user input in Duality. This package contains a testbed for user input handling. Duality Sample Plugin Input - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/LogView.Editor.nuspec b/Build/NuGetPackageSpecs/LogView.Editor.nuspec index 560b31081..5e0d2b7ea 100644 --- a/Build/NuGetPackageSpecs/LogView.Editor.nuspec +++ b/Build/NuGetPackageSpecs/LogView.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor.Plugins.LogView - 3.0.5 + 4.0.0-alpha Fedja Adam Fedja Adam Log View @@ -16,8 +16,8 @@ Patch Version Update - - + + diff --git a/Build/NuGetPackageSpecs/ObjectInspector.Editor.nuspec b/Build/NuGetPackageSpecs/ObjectInspector.Editor.nuspec index 3eacf08ee..30579a104 100644 --- a/Build/NuGetPackageSpecs/ObjectInspector.Editor.nuspec +++ b/Build/NuGetPackageSpecs/ObjectInspector.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor.Plugins.ObjectInspector - 3.0.5 + 4.0.0-alpha Fedja Adam Fedja Adam Object Inspector @@ -16,8 +16,8 @@ Inspector Auto Update Bugfix #FIX: Fixed Object Inspector auto refresh not working unless disabled and enabled again. - - + + diff --git a/Build/NuGetPackageSpecs/PackageManagerFrontend.Editor.nuspec b/Build/NuGetPackageSpecs/PackageManagerFrontend.Editor.nuspec deleted file mode 100644 index 48638d7fb..000000000 --- a/Build/NuGetPackageSpecs/PackageManagerFrontend.Editor.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - AdamsLair.Duality.Editor.Plugins.PackageManagerFrontend - 3.0.5 - Fedja Adam - Fedja Adam - Package Manager Frontend - https://github.com/AdamsLair/duality/raw/release/Build/NuGetPackageSpecs/Icons/PackageManager.png - https://github.com/AdamsLair/duality/raw/release/LICENSE - https://github.com/AdamsLair/duality - false - A user interface for conveniently managing Duality packages. - A user interface for conveniently managing Duality packages. - Duality Editor Plugin PackageManagerFrontend - Patch Version Update - - - - - - - - - - - - \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/ParticleSystem.Sample.nuspec b/Build/NuGetPackageSpecs/ParticleSystem.Sample.nuspec index a01e91fc6..f9232e820 100644 --- a/Build/NuGetPackageSpecs/ParticleSystem.Sample.nuspec +++ b/Build/NuGetPackageSpecs/ParticleSystem.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.ParticleSystem - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Custom ParticleSystem Sample @@ -13,18 +13,18 @@ Implements and showcases a custom Particle System in Duality. This package implements a custom Particle System in Duality and showcases its functionality in a sample Scene. Duality Sample Plugin Particles Rendering - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/Physics.Sample.nuspec b/Build/NuGetPackageSpecs/Physics.Sample.nuspec index a6258c9d0..082953b06 100644 --- a/Build/NuGetPackageSpecs/Physics.Sample.nuspec +++ b/Build/NuGetPackageSpecs/Physics.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.Physics - 2.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Physics Sample @@ -13,18 +13,18 @@ Demonstrates how to use physics simulation in Duality. This package contains a testbed for RigidBody physics simulation, showing various aspects of their configuration and interaction. Duality Sample Plugin Physics - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/ProjectView.Editor.nuspec b/Build/NuGetPackageSpecs/ProjectView.Editor.nuspec index 2e0857765..17231efb5 100644 --- a/Build/NuGetPackageSpecs/ProjectView.Editor.nuspec +++ b/Build/NuGetPackageSpecs/ProjectView.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor.Plugins.ProjectView - 3.0.5 + 4.0.0-alpha Fedja Adam Fedja Adam Project View @@ -16,8 +16,8 @@ Patch Version Update - - + + diff --git a/Build/NuGetPackageSpecs/SceneView.Editor.nuspec b/Build/NuGetPackageSpecs/SceneView.Editor.nuspec index a6babbe74..4f4e45192 100644 --- a/Build/NuGetPackageSpecs/SceneView.Editor.nuspec +++ b/Build/NuGetPackageSpecs/SceneView.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor.Plugins.SceneView - 3.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Scene View @@ -16,8 +16,8 @@ Patch Version Update - - + + diff --git a/Build/NuGetPackageSpecs/SmoothAnimation.Sample.nuspec b/Build/NuGetPackageSpecs/SmoothAnimation.Sample.nuspec index 11422893e..d6b914950 100644 --- a/Build/NuGetPackageSpecs/SmoothAnimation.Sample.nuspec +++ b/Build/NuGetPackageSpecs/SmoothAnimation.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.SmoothAnimation - 2.0.4 + 4.0.0-alpha Fedja Adam Fedja Adam Smooth Sprite Animation Blending Sample @@ -13,18 +13,18 @@ Demonstrates a smooth blending technique for sprite animations. This package implements a custom sprite renderer that is able to smoothly blend between two animation frames using a shader, rather than switching between the two frames instantaneously. Duality Sample Plugin Shaders Animation Rendering - Patch Version Update - + Patch Version Update + + + - - + + - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/Steering.Sample.nuspec b/Build/NuGetPackageSpecs/Steering.Sample.nuspec index f0ae94049..23fe548fa 100644 --- a/Build/NuGetPackageSpecs/Steering.Sample.nuspec +++ b/Build/NuGetPackageSpecs/Steering.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.Steering - 3.0.5 + 4.0.0-alpha Daniel Herb, Fedja Adam Daniel Herb, Fedja Adam Steering Behaviours Sample @@ -13,18 +13,17 @@ Introduces a Steering Agent Component that allows for objects to evade each other. Introduces a Steering Agent Component that allows for objects to evade each other. Duality Sample Plugin Steering Component AI - Patch Version Update - + Patch Version Update + + + - + - - - - + \ No newline at end of file diff --git a/Build/NuGetPackageSpecs/Tilemaps.Core.nuspec b/Build/NuGetPackageSpecs/Tilemaps.Core.nuspec index eaf42759e..d0cf0b21f 100644 --- a/Build/NuGetPackageSpecs/Tilemaps.Core.nuspec +++ b/Build/NuGetPackageSpecs/Tilemaps.Core.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Plugins.Tilemaps - 2.1.4 + 4.0.0-alpha Fedja Adam Fedja Adam Tilemaps (Core) @@ -16,7 +16,7 @@ Tilemap Editing Default Empty Tile #CHANGE: Use a default empty tile for all empty tiles. - + diff --git a/Build/NuGetPackageSpecs/Tilemaps.Editor.nuspec b/Build/NuGetPackageSpecs/Tilemaps.Editor.nuspec index bcbc0f47d..0d9899eb7 100644 --- a/Build/NuGetPackageSpecs/Tilemaps.Editor.nuspec +++ b/Build/NuGetPackageSpecs/Tilemaps.Editor.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Editor.Plugins.Tilemaps - 2.1.4 + 4.0.0-alpha Fedja Adam Fedja Adam Tilemaps (Editor) @@ -16,9 +16,9 @@ Tilemap Editing Default Empty Tile #CHANGE: Use a default empty tile for all empty tiles. - - - + + + diff --git a/Build/NuGetPackageSpecs/Tilemaps.Sample.nuspec b/Build/NuGetPackageSpecs/Tilemaps.Sample.nuspec index 656617d83..103cdd487 100644 --- a/Build/NuGetPackageSpecs/Tilemaps.Sample.nuspec +++ b/Build/NuGetPackageSpecs/Tilemaps.Sample.nuspec @@ -2,7 +2,7 @@ AdamsLair.Duality.Samples.Tilemaps - 2.0.9 + 4.0.0-alpha Fedja Adam Fedja Adam Tilemaps Sample @@ -15,17 +15,18 @@ Duality Sample Plugin Tilemaps Updated Dependencies #CHANGE: Updated AdamsLair.Duality.Editor.Plugins.Tilemaps dependency + + + - - - + + + - - - + \ No newline at end of file diff --git a/Duality.sln b/Duality.sln index 2730084e7..065e30c20 100644 --- a/Duality.sln +++ b/Duality.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27428.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29911.84 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Duality", "Source\Core\Duality\Duality.csproj", "{D821AFB9-BCC9-4025-9A9C-798E2BC546AB}" EndProject @@ -35,8 +35,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EditorModules", "EditorModu EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DualityUpdater", "Source\Editor\Updater\DualityUpdater.csproj", "{7BED6319-022E-4B62-8F64-F51DE9A2D7EF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackageManagerFrontend.Editor", "Source\Plugins\EditorModules\PackageManagerFrontend\PackageManagerFrontend.Editor.csproj", "{E771E45B-3EB3-4CD3-8483-7D8798D0F5F8}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DualStickSpaceShooter", "Samples\DualStickSpaceShooter\DualStickSpaceShooter.csproj", "{54376712-DBFA-4EF3-A8BA-B1D44A2DA97E}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DualityPrimitives", "Source\Core\Primitives\DualityPrimitives.csproj", "{C87A6A2F-E537-48FA-A789-3C54CF29CC09}" @@ -168,10 +166,6 @@ Global {7BED6319-022E-4B62-8F64-F51DE9A2D7EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {7BED6319-022E-4B62-8F64-F51DE9A2D7EF}.Release|Any CPU.ActiveCfg = Release|Any CPU {7BED6319-022E-4B62-8F64-F51DE9A2D7EF}.Release|Any CPU.Build.0 = Release|Any CPU - {E771E45B-3EB3-4CD3-8483-7D8798D0F5F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E771E45B-3EB3-4CD3-8483-7D8798D0F5F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E771E45B-3EB3-4CD3-8483-7D8798D0F5F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E771E45B-3EB3-4CD3-8483-7D8798D0F5F8}.Release|Any CPU.Build.0 = Release|Any CPU {54376712-DBFA-4EF3-A8BA-B1D44A2DA97E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {54376712-DBFA-4EF3-A8BA-B1D44A2DA97E}.Debug|Any CPU.Build.0 = Debug|Any CPU {54376712-DBFA-4EF3-A8BA-B1D44A2DA97E}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -281,7 +275,6 @@ Global {E67350ED-2676-492A-9FBE-A08B5FBF3726} = {1F9CE5E4-5E97-4813-9299-33064673D393} {1F9CE5E4-5E97-4813-9299-33064673D393} = {F7B868F5-0B5D-497C-BA40-FA08DD3EB07D} {7BED6319-022E-4B62-8F64-F51DE9A2D7EF} = {8425804A-7CFA-4E0B-9672-F979830DCC0F} - {E771E45B-3EB3-4CD3-8483-7D8798D0F5F8} = {1F9CE5E4-5E97-4813-9299-33064673D393} {54376712-DBFA-4EF3-A8BA-B1D44A2DA97E} = {9D215950-8E34-4070-914F-7B7D8A54ED6C} {C87A6A2F-E537-48FA-A789-3C54CF29CC09} = {FC08D0D6-612E-4AD2-950C-8E9BA895D5D1} {FDA91F3F-1621-4E41-A1FC-2C3F45754CE4} = {34618774-B865-4BAC-A890-925704761500} @@ -307,9 +300,6 @@ Global {165D83B8-EAE8-4CDC-9003-E595D4225B8F} = {9D215950-8E34-4070-914F-7B7D8A54ED6C} {5CA66347-C3DA-47DA-B07B-E2B89E6E712A} = {FC08D0D6-612E-4AD2-950C-8E9BA895D5D1} EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9A945D0B-5EF2-4D0D-BE86-3AEE6659F281} - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {74E2A280-F2F3-400D-9CC2-7A91D6D3D15C} EndGlobalSection diff --git a/Samples/AudioHandling/Properties/AssemblyInfo.cs b/Samples/AudioHandling/Properties/AssemblyInfo.cs index 47b46b5e7..72f8537d0 100644 --- a/Samples/AudioHandling/Properties/AssemblyInfo.cs +++ b/Samples/AudioHandling/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/BasicMenu/Properties/AssemblyInfo.cs b/Samples/BasicMenu/Properties/AssemblyInfo.cs index 35776cd86..5c1ce9572 100644 --- a/Samples/BasicMenu/Properties/AssemblyInfo.cs +++ b/Samples/BasicMenu/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/BasicShaders/Properties/AssemblyInfo.cs b/Samples/BasicShaders/Properties/AssemblyInfo.cs index 59e174f90..a4f5b96f4 100644 --- a/Samples/BasicShaders/Properties/AssemblyInfo.cs +++ b/Samples/BasicShaders/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/Benchmarks/Properties/AssemblyInfo.cs b/Samples/Benchmarks/Properties/AssemblyInfo.cs index fd7de07df..91b5fc4d7 100644 --- a/Samples/Benchmarks/Properties/AssemblyInfo.cs +++ b/Samples/Benchmarks/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("2.0.4")] -[assembly: AssemblyVersion("2.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/CameraController/Properties/AssemblyInfo.cs b/Samples/CameraController/Properties/AssemblyInfo.cs index 35776cd86..5c1ce9572 100644 --- a/Samples/CameraController/Properties/AssemblyInfo.cs +++ b/Samples/CameraController/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/CustomRenderingSetup/Properties/AssemblyInfo.cs b/Samples/CustomRenderingSetup/Properties/AssemblyInfo.cs index 74bcffeb1..5d03c6763 100644 --- a/Samples/CustomRenderingSetup/Properties/AssemblyInfo.cs +++ b/Samples/CustomRenderingSetup/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("2.0.4")] -[assembly: AssemblyVersion("2.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/DualStickSpaceShooter/Properties/AssemblyInfo.cs b/Samples/DualStickSpaceShooter/Properties/AssemblyInfo.cs index 4dc5611f1..4eb97b51a 100644 --- a/Samples/DualStickSpaceShooter/Properties/AssemblyInfo.cs +++ b/Samples/DualStickSpaceShooter/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/DynamicLighting/Core/Properties/AssemblyInfo.cs b/Samples/DynamicLighting/Core/Properties/AssemblyInfo.cs index 9865b94cd..065f7a5e5 100644 --- a/Samples/DynamicLighting/Core/Properties/AssemblyInfo.cs +++ b/Samples/DynamicLighting/Core/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/DynamicLighting/Editor/Properties/AssemblyInfo.cs b/Samples/DynamicLighting/Editor/Properties/AssemblyInfo.cs index 2220fe059..e59617b48 100644 --- a/Samples/DynamicLighting/Editor/Properties/AssemblyInfo.cs +++ b/Samples/DynamicLighting/Editor/Properties/AssemblyInfo.cs @@ -30,6 +30,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/FlapOrDie/Properties/AssemblyInfo.cs b/Samples/FlapOrDie/Properties/AssemblyInfo.cs index 3bd12f0b6..226ceab0e 100644 --- a/Samples/FlapOrDie/Properties/AssemblyInfo.cs +++ b/Samples/FlapOrDie/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/InputHandling/Properties/AssemblyInfo.cs b/Samples/InputHandling/Properties/AssemblyInfo.cs index caeeb5458..623d104d3 100644 --- a/Samples/InputHandling/Properties/AssemblyInfo.cs +++ b/Samples/InputHandling/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/ParticleSystem/Properties/AssemblyInfo.cs b/Samples/ParticleSystem/Properties/AssemblyInfo.cs index 70aecd78f..619f7001f 100644 --- a/Samples/ParticleSystem/Properties/AssemblyInfo.cs +++ b/Samples/ParticleSystem/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/Physics/Properties/AssemblyInfo.cs b/Samples/Physics/Properties/AssemblyInfo.cs index fd7de07df..91b5fc4d7 100644 --- a/Samples/Physics/Properties/AssemblyInfo.cs +++ b/Samples/Physics/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("2.0.4")] -[assembly: AssemblyVersion("2.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/SmoothAnimation/Properties/AssemblyInfo.cs b/Samples/SmoothAnimation/Properties/AssemblyInfo.cs index 74bcffeb1..5d03c6763 100644 --- a/Samples/SmoothAnimation/Properties/AssemblyInfo.cs +++ b/Samples/SmoothAnimation/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("2.0.4")] -[assembly: AssemblyVersion("2.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/Steering/Properties/AssemblyInfo.cs b/Samples/Steering/Properties/AssemblyInfo.cs index f9a307f52..b7e861844 100644 --- a/Samples/Steering/Properties/AssemblyInfo.cs +++ b/Samples/Steering/Properties/AssemblyInfo.cs @@ -32,5 +32,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.5")] -[assembly: AssemblyVersion("3.0.5")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Samples/Tilemaps/Properties/AssemblyInfo.cs b/Samples/Tilemaps/Properties/AssemblyInfo.cs index 9261bcba6..3b80e64c3 100644 --- a/Samples/Tilemaps/Properties/AssemblyInfo.cs +++ b/Samples/Tilemaps/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("2.0.9")] -[assembly: AssemblyVersion("2.0.9")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Core/Duality/Properties/AssemblyInfo.cs b/Source/Core/Duality/Properties/AssemblyInfo.cs index cf27e26a9..953d2a109 100644 --- a/Source/Core/Duality/Properties/AssemblyInfo.cs +++ b/Source/Core/Duality/Properties/AssemblyInfo.cs @@ -30,9 +30,6 @@ // Buildnummer // Revision // -// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.2.1")] -[assembly: AssemblyVersion("3.2.1")] +[assembly: AssemblyVersion("4.0.0")] [assembly: InternalsVisibleTo("DualityEditor")] [assembly: InternalsVisibleTo("DualityTests")] diff --git a/Source/Core/Physics/Properties/AssemblyInfo.cs b/Source/Core/Physics/Properties/AssemblyInfo.cs index 6b6276000..46df87e64 100644 --- a/Source/Core/Physics/Properties/AssemblyInfo.cs +++ b/Source/Core/Physics/Properties/AssemblyInfo.cs @@ -23,4 +23,4 @@ // Revision // -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Core/Primitives/Properties/AssemblyInfo.cs b/Source/Core/Primitives/Properties/AssemblyInfo.cs index 0c2dd1aa4..ae49d1625 100644 --- a/Source/Core/Primitives/Properties/AssemblyInfo.cs +++ b/Source/Core/Primitives/Properties/AssemblyInfo.cs @@ -25,5 +25,4 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Editor/DualityEditor/DualityEditor.csproj b/Source/Editor/DualityEditor/DualityEditor.csproj index ba6559552..574aefb1f 100644 --- a/Source/Editor/DualityEditor/DualityEditor.csproj +++ b/Source/Editor/DualityEditor/DualityEditor.csproj @@ -161,13 +161,6 @@ - - - - - - - @@ -214,13 +207,6 @@ - - - - - - - True True @@ -248,12 +234,6 @@ AppRunningDialog.cs - - Form - - - NewProjectDialog.cs - Form @@ -349,9 +329,6 @@ AppRunningDialog.cs - - NewProjectDialog.cs - ProcessingBigTaskDialog.cs @@ -401,7 +378,6 @@ - @@ -416,8 +392,6 @@ - - @@ -427,13 +401,11 @@ - - @@ -457,20 +429,17 @@ 2.1.1 - - 2.14.0 - + - - + + - @@ -478,7 +447,4 @@ - - - \ No newline at end of file diff --git a/Source/Editor/DualityEditor/DualityEditorApp.cs b/Source/Editor/DualityEditor/DualityEditorApp.cs index 7db538ded..d1e0f925c 100644 --- a/Source/Editor/DualityEditor/DualityEditorApp.cs +++ b/Source/Editor/DualityEditor/DualityEditorApp.cs @@ -21,7 +21,6 @@ using Duality.Editor.Backend; using Duality.Editor.Forms; using Duality.Editor.UndoRedoActions; -using Duality.Editor.PackageManagement; using Duality.Editor.AssetManagement; using WeifenLuo.WinFormsUI.Docking; @@ -65,7 +64,6 @@ public static class DualityEditorApp private static string launcherApp = null; private static ContentRef lastOpenScene = null; private static bool startWithLastScene = true; - private static PackageManager packageManager = null; private static EditorLogOutput memoryLogOutput = null; @@ -95,10 +93,6 @@ public static EditorLogOutput GlobalLogData { get { return memoryLogOutput; } } - public static PackageManager PackageManager - { - get { return packageManager; } - } public static MainForm MainForm { get { return mainForm; } @@ -167,7 +161,6 @@ public static string LauncherAppPath if (value != launcherApp) { launcherApp = value; - UpdatePluginSourceCode(); } } } @@ -222,9 +215,6 @@ public static void Init(MainForm mainForm, bool recover) if (!Directory.Exists(EditorHelper.SourceMediaDirectory)) Directory.CreateDirectory(EditorHelper.SourceMediaDirectory); if (!Directory.Exists(EditorHelper.SourceCodeDirectory)) Directory.CreateDirectory(EditorHelper.SourceCodeDirectory); - // Initialize Package Management system - packageManager = new PackageManager(); - // Initialize Duality EditorHintImageAttribute.ImageResolvers += EditorHintImageResolver; DualityApp.PluginManager.PluginsReady += DualityApp_PluginsReady; @@ -763,226 +753,6 @@ public static void BackupResource(string path) Logs.Editor.WriteError("Backup of file '{0}' failed: {1}", path, LogFormat.Exception(e)); } } - - public static void UpdatePluginSourceCode() - { - string sourceCodeSolutionFile = EditorHelper.SourceCodeSolutionFilePath; - // Initially generate source code, if not existing yet - if (!File.Exists(sourceCodeSolutionFile)) - { - InitPluginSourceCode(); - sourceCodeSolutionFile = EditorHelper.DefaultSourceCodeSolutionFile; - } - - // Replace exec path in project files to account for custom launcher settings - { - XDocument projectDoc; - string solutionDir = Path.GetFullPath(Path.GetDirectoryName(sourceCodeSolutionFile)); - - string startProgram = Path.GetFullPath(DualityEditorApp.LauncherAppPath); - string startProgramRelative = PathHelper.MakeFilePathRelative(startProgram, solutionDir); - if (startProgramRelative != null) - startProgramRelative = "$(SolutionDir)" + startProgramRelative; - else - startProgramRelative = startProgram; - - string startWorkingDir = Path.GetFullPath("."); - string startWorkingDirRelative = PathHelper.MakeDirectoryPathRelative(startWorkingDir, solutionDir); - if (startWorkingDirRelative != null) - startWorkingDirRelative = "$(SolutionDir)" + startWorkingDirRelative; - else - startWorkingDirRelative = startWorkingDir; - - // Adjust the game debugger startup parameters - string gameDebuggerProjectFile = EditorHelper.SourceCodeProjectGameDebuggerFile; - if (File.Exists(gameDebuggerProjectFile)) - { - bool anythingChanged = false; - - projectDoc = XDocument.Load(gameDebuggerProjectFile); - foreach (XElement element in projectDoc.Descendants("StartProgram", true)) - { - if (!string.Equals(element.Value, startProgramRelative)) - { - element.Value = startProgramRelative; - anythingChanged = true; - } - } - foreach (XElement element in projectDoc.Descendants("StartWorkingDirectory", true)) - { - if (!string.Equals(element.Value, startWorkingDirRelative)) - { - element.Value = startWorkingDirRelative; - anythingChanged = true; - } - } - if (anythingChanged) - { - projectDoc.Save(gameDebuggerProjectFile); - } - } - - // Legacy support 2019-07-27: - // Adjust the core plugin startup parameters - string corePluginProjectFile = EditorHelper.SourceCodeProjectCorePluginFile; - if (File.Exists(corePluginProjectFile)) - { - bool anythingChanged = false; - - projectDoc = XDocument.Load(corePluginProjectFile); - foreach (XElement element in projectDoc.Descendants("StartProgram", true)) - { - if (!string.Equals(element.Value, startProgramRelative)) - { - element.Value = startProgramRelative; - anythingChanged = true; - } - } - foreach (XElement element in projectDoc.Descendants("StartWorkingDirectory", true)) - { - if (!string.Equals(element.Value, startWorkingDirRelative)) - { - element.Value = startWorkingDirRelative; - anythingChanged = true; - } - } - if (anythingChanged) - { - projectDoc.Save(corePluginProjectFile); - } - } - } - } - public static void ReadPluginSourceCodeContentData(out string rootNamespace, out string desiredRootNamespace) - { - rootNamespace = null; - desiredRootNamespace = EditorHelper.GenerateClassNameFromPath(EditorHelper.CurrentProjectName); - - // Read root namespaces - if (File.Exists(EditorHelper.SourceCodeProjectCorePluginFile)) - { - XDocument projXml = XDocument.Load(EditorHelper.SourceCodeProjectCorePluginFile); - foreach (XElement element in projXml.Descendants("RootNamespace", true)) - { - if (rootNamespace == null) rootNamespace = element.Value; - } - } - } - public static void InitPluginSourceCode() - { - // Check if the solution file has to be created - if (!File.Exists(EditorHelper.SourceCodeSolutionFilePath)) - { - // Create solution file - using (MemoryStream gamePluginStream = new MemoryStream(Properties.GeneralRes.GamePluginTemplate)) - using (ZipArchive gamePluginZip = new ZipArchive(gamePluginStream)) - { - gamePluginZip.ExtractAll(EditorHelper.SourceCodeDirectory, false); - } - } - - string projectClassName = EditorHelper.GenerateClassNameFromPath(EditorHelper.CurrentProjectName); - string newRootNamespaceCore = projectClassName; - string newRootNamespaceEditor = newRootNamespaceCore + ".Editor"; - string pluginNameCore = projectClassName + "CorePlugin"; - string pluginNameEditor = projectClassName + "EditorPlugin"; - string oldRootNamespaceCore = null; - string oldRootNamespaceEditor = null; - - // Update root namespaces - if (File.Exists(EditorHelper.SourceCodeProjectCorePluginFile)) - { - XDocument projXml = XDocument.Load(EditorHelper.SourceCodeProjectCorePluginFile); - foreach (XElement element in projXml.Descendants("RootNamespace", true)) - { - if (oldRootNamespaceCore == null) oldRootNamespaceCore = element.Value; - element.Value = newRootNamespaceCore; - } - projXml.Save(EditorHelper.SourceCodeProjectCorePluginFile); - } - - if (File.Exists(EditorHelper.SourceCodeProjectEditorPluginFile)) - { - XDocument projXml = XDocument.Load(EditorHelper.SourceCodeProjectEditorPluginFile); - foreach (XElement element in projXml.Descendants("RootNamespace", true)) - { - if (oldRootNamespaceEditor == null) oldRootNamespaceEditor = element.Value; - element.Value = newRootNamespaceEditor; - } - projXml.Save(EditorHelper.SourceCodeProjectEditorPluginFile); - } - - // Guess old plugin class names - string oldPluginNameCore = oldRootNamespaceCore + "CorePlugin"; - string oldPluginNameEditor = oldRootNamespaceCore + "EditorPlugin"; - string regExpr; - string regExprReplace; - - // Replace namespace names: Core - if (Directory.Exists(EditorHelper.SourceCodeProjectCorePluginDir)) - { - regExpr = @"^(\s*namespace\s*)(.*)(" + oldRootNamespaceCore + @")(.*)(\s*{)"; - regExprReplace = @"$1$2" + newRootNamespaceCore + @"$4$5"; - foreach (string filePath in Directory.GetFiles(EditorHelper.SourceCodeProjectCorePluginDir, "*.cs", SearchOption.AllDirectories)) - { - string fileContent = File.ReadAllText(filePath); - fileContent = Regex.Replace(fileContent, regExpr, regExprReplace, RegexOptions.Multiline); - File.WriteAllText(filePath, fileContent, Encoding.UTF8); - } - } - - // Replace namespace names: Editor - if (Directory.Exists(EditorHelper.SourceCodeProjectEditorPluginDir)) - { - regExpr = @"^(\s*namespace\s*)(.*)(" + oldRootNamespaceEditor + @")(.*)(\s*{)"; - regExprReplace = @"$1$2" + newRootNamespaceEditor + @"$4$5"; - foreach (string filePath in Directory.GetFiles(EditorHelper.SourceCodeProjectEditorPluginDir, "*.cs", SearchOption.AllDirectories)) - { - string fileContent = File.ReadAllText(filePath); - fileContent = Regex.Replace(fileContent, regExpr, regExprReplace, RegexOptions.Multiline); - File.WriteAllText(filePath, fileContent, Encoding.UTF8); - } - } - - // Replace class names: Core - if (File.Exists(EditorHelper.SourceCodeCorePluginFile)) - { - string fileContent = File.ReadAllText(EditorHelper.SourceCodeCorePluginFile); - - // Replace class name - regExpr = @"(\bclass\b)(.*)(" + oldPluginNameCore + @")(.*)(\s*{)"; - regExprReplace = @"$1$2" + pluginNameCore + @"$4$5"; - fileContent = Regex.Replace(fileContent, regExpr, regExprReplace, RegexOptions.Multiline); - - regExpr = @"(\bclass\b)(.*)(" + @"__CorePluginClassName__" + @")(.*)(\s*{)"; - regExprReplace = @"$1$2" + pluginNameCore + @"$4$5"; - fileContent = Regex.Replace(fileContent, regExpr, regExprReplace, RegexOptions.Multiline); - - File.WriteAllText(EditorHelper.SourceCodeCorePluginFile, fileContent, Encoding.UTF8); - } - - // Replace class names: Editor - if (File.Exists(EditorHelper.SourceCodeEditorPluginFile)) - { - string fileContent = File.ReadAllText(EditorHelper.SourceCodeEditorPluginFile); - - // Replace class name - regExpr = @"(\bclass\b)(.*)(" + oldPluginNameEditor + @")(.*)(\s*{)"; - regExprReplace = @"$1$2" + pluginNameEditor + @"$4$5"; - fileContent = Regex.Replace(fileContent, regExpr, regExprReplace, RegexOptions.Multiline); - - regExpr = @"(\bclass\b)(.*)(" + @"__EditorPluginClassName__" + @")(.*)(\s*{)"; - regExprReplace = @"$1$2" + pluginNameEditor + @"$4$5"; - fileContent = Regex.Replace(fileContent, regExpr, regExprReplace, RegexOptions.Multiline); - - // Repalce Id property - regExpr = @"(\boverride\s*string\s*Id\s*{\s*get\s*{\s*return\s*" + '"' + @")(.*)(" + '"' + @"\s*;\s*}\s*})"; - regExprReplace = @"$1" + pluginNameEditor + @"$3"; - fileContent = Regex.Replace(fileContent, regExpr, regExprReplace, RegexOptions.Multiline); - - File.WriteAllText(EditorHelper.SourceCodeEditorPluginFile, fileContent, Encoding.UTF8); - } - } public static void NotifyObjPrefabApplied(object sender, ObjectSelection obj) { @@ -1429,9 +1199,7 @@ private static void mainForm_Activated(object sender, EventArgs e) } private static void mainForm_Deactivate(object sender, EventArgs e) { - // Update source code, in case the user is switching to his IDE without hitting the "open source code" button again - if (DualityApp.ExecContext != DualityApp.ExecutionContext.Terminated) - DualityEditorApp.UpdatePluginSourceCode(); + } private static void editorObjects_GameObjectsAdded(object sender, GameObjectGroupEventArgs e) diff --git a/Source/Editor/DualityEditor/EmbeddedResources/ErrorHandlersTemplate.txt b/Source/Editor/DualityEditor/EmbeddedResources/ErrorHandlersTemplate.txt deleted file mode 100644 index 62b3835db..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/ErrorHandlersTemplate.txt +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using Duality; -using Duality.Serialization; - -namespace ROOTNAMESPACE.ErrorHandlers -{ - public class NewProjectErrorHandler : SerializeErrorHandler - { - public override void HandleError(SerializeError error) - { - ResolveTypeError resolveTypeError = error as ResolveTypeError; - if (resolveTypeError != null) - { - string fixedTypeId = resolveTypeError.TypeId; - - if (fixedTypeId.StartsWith("OLDROOTNAMESPACE") && - fixedTypeId.Length > "OLDROOTNAMESPACE".Length && - (fixedTypeId["OLDROOTNAMESPACE".Length] == '.' || fixedTypeId["OLDROOTNAMESPACE".Length] == '+')) - { - fixedTypeId = "ROOTNAMESPACE" + fixedTypeId.Remove(0, "OLDROOTNAMESPACE".Length); - resolveTypeError.ResolvedType = ReflectionHelper.ResolveType(fixedTypeId); - } - } - - return; - } - } -} \ No newline at end of file diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/AggregateUserPlugins.targets b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/AggregateUserPlugins.targets deleted file mode 100644 index efd1a2b59..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/AggregateUserPlugins.targets +++ /dev/null @@ -1,11 +0,0 @@ - - - - $(SolutionDir)..\..\Plugins\ - - - - - - - \ No newline at end of file diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/CorePlugin.cs b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/CorePlugin.cs deleted file mode 100644 index 30cdc6cba..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/CorePlugin.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using Duality; - -namespace __Namespace__ -{ - /// - /// Defines a Duality core plugin. - /// - public class __CorePluginClassName__ : CorePlugin - { - // Override methods here for global logic - } -} diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/CorePlugin.csproj b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/CorePlugin.csproj deleted file mode 100644 index 3f9e6e26d..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/CorePlugin.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {AFE883F3-72B4-4C7C-A1D1-44EDC09C8F6E} - Library - Properties - __Namespace__ - GamePlugin.core - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile111 - v4.5 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - GamePlugin.core.xml - 1591,1592,1573,1571,1570,1572 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - GamePlugin.core.xml - 1591,1592,1573,1571,1570,1572 - false - - - - ..\..\..\Duality.dll - - - ..\..\..\DualityPrimitives.dll - - - - - - - - - - - - \ No newline at end of file diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/Properties/AssemblyInfo.cs b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/Properties/AssemblyInfo.cs deleted file mode 100644 index 75f174dcc..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("GamePlugin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GamePlugin")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar -// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von -// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("00c8792c-39b8-4558-acf9-03013402301a")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/YourCustomComponentType.cs b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/YourCustomComponentType.cs deleted file mode 100644 index e57232eb1..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/CorePlugin/YourCustomComponentType.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Duality; - -namespace __Namespace__ -{ - public class YourCustomComponentType : Component - { - - } -} diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/EditorPlugin/EditorPlugin.cs b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/EditorPlugin/EditorPlugin.cs deleted file mode 100644 index 1404de394..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/EditorPlugin/EditorPlugin.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using Duality.Editor; - -namespace __Namespace__.Editor -{ - /// - /// Defines a Duality editor plugin. - /// - public class __EditorPluginClassName__ : EditorPlugin - { - public override string Id - { - get { return ""; } - } - } -} diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/EditorPlugin/EditorPlugin.csproj b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/EditorPlugin/EditorPlugin.csproj deleted file mode 100644 index 844fe3f4a..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/EditorPlugin/EditorPlugin.csproj +++ /dev/null @@ -1,63 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {78DBC94D-EE9D-4AC0-95ED-91A0AE2F6652} - Library - Properties - __Namespace__.Editor - GamePlugin.editor - v4.7.2 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\..\..\Duality.dll - - - ..\..\..\DualityPrimitives.dll - - - ..\..\..\DualityEditor.exe - - - - - - ..\..\..\WeifenLuo.WinFormsUI.Docking.dll - - - ..\..\..\Aga.Controls.dll - - - - - - - - - - - \ No newline at end of file diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/EditorPlugin/Properties/AssemblyInfo.cs b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/EditorPlugin/Properties/AssemblyInfo.cs deleted file mode 100644 index cfe489d22..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/EditorPlugin/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("EditorPlugin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("EditorPlugin")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar -// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von -// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("97bf1f9a-a247-4620-8818-ba9d40d1822b")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/GameDebugger/GameDebugger.csproj b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/GameDebugger/GameDebugger.csproj deleted file mode 100644 index b11c9722e..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/GameDebugger/GameDebugger.csproj +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Program - (Dualiy_Placeholder) - (Dualiy_Placeholder) - - - Debug - AnyCPU - {61D53BD6-B088-4B39-BE2E-95034EDAAC3B} - Exe - GameDebugger - GameDebugger - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - \ No newline at end of file diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/GameDebugger/Program.cs b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/GameDebugger/Program.cs deleted file mode 100644 index 219c95405..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/GameDebugger/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace GameDebugger -{ - /// - /// This is a dummy project that serves as a debug target for the Duality launcher. - /// - /// It will not be included in a published game in any way and does not produce any - /// meaningful output itself. - /// - public static class Program - { - public static void Main(string[] args) - { - } - } -} diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/GameDebugger/Properties/AssemblyInfo.cs b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/GameDebugger/Properties/AssemblyInfo.cs deleted file mode 100644 index 67a0bc3f4..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/GameDebugger/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("GameDebugger")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GameDebugger")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("61d53bd6-b088-4b39-be2e-95034edaac3b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/ProjectPlugins.sln b/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/ProjectPlugins.sln deleted file mode 100644 index 6e0f73636..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GamePluginTemplate/ProjectPlugins.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameDebugger", "GameDebugger\GameDebugger.csproj", "{61D53BD6-B088-4B39-BE2E-95034EDAAC3B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorePlugin", "CorePlugin\CorePlugin.csproj", "{AFE883F3-72B4-4C7C-A1D1-44EDC09C8F6E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {61D53BD6-B088-4B39-BE2E-95034EDAAC3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {61D53BD6-B088-4B39-BE2E-95034EDAAC3B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {61D53BD6-B088-4B39-BE2E-95034EDAAC3B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {61D53BD6-B088-4B39-BE2E-95034EDAAC3B}.Release|Any CPU.Build.0 = Release|Any CPU - {AFE883F3-72B4-4C7C-A1D1-44EDC09C8F6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AFE883F3-72B4-4C7C-A1D1-44EDC09C8F6E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AFE883F3-72B4-4C7C-A1D1-44EDC09C8F6E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AFE883F3-72B4-4C7C-A1D1-44EDC09C8F6E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Source/Editor/DualityEditor/EmbeddedResources/GameResTemplate.txt b/Source/Editor/DualityEditor/EmbeddedResources/GameResTemplate.txt deleted file mode 100644 index 555383356..000000000 --- a/Source/Editor/DualityEditor/EmbeddedResources/GameResTemplate.txt +++ /dev/null @@ -1,9 +0,0 @@ -/* - * A set of static helper classes that provide easy runtime access to the games resources. - * This file is auto-generated. Any changes made to it are lost as soon as Duality decides - * to regenerate it. - */ -namespace GameRes -{ -CONTENT -} diff --git a/Source/Editor/DualityEditor/EmbeddedResources/template_current.png b/Source/Editor/DualityEditor/EmbeddedResources/template_current.png deleted file mode 100644 index b67ae389b..000000000 Binary files a/Source/Editor/DualityEditor/EmbeddedResources/template_current.png and /dev/null differ diff --git a/Source/Editor/DualityEditor/EmbeddedResources/template_empty.png b/Source/Editor/DualityEditor/EmbeddedResources/template_empty.png deleted file mode 100644 index 69d6132f8..000000000 Binary files a/Source/Editor/DualityEditor/EmbeddedResources/template_empty.png and /dev/null differ diff --git a/Source/Editor/DualityEditor/Forms/MainForm.cs b/Source/Editor/DualityEditor/Forms/MainForm.cs index dc8fc063e..236166af1 100644 --- a/Source/Editor/DualityEditor/Forms/MainForm.cs +++ b/Source/Editor/DualityEditor/Forms/MainForm.cs @@ -97,14 +97,6 @@ public void InitMenus() { new MenuModelItem { Name = GeneralRes.MenuName_File, SortValue = MenuModelItem.SortValue_Top, Items = new[] { - new MenuModelItem - { - Name = GeneralRes.MenuItemName_NewProject, - SortValue = MenuModelItem.SortValue_Top, - Icon = Properties.GeneralResCache.ImageAppCreate, - Tag = HelpInfo.FromText(GeneralRes.MenuItemName_NewProject, GeneralRes.MenuItemInfo_NewProject), - ActionHandler = this.newProjectItem_Click - }, new MenuModelItem { Name = GeneralRes.MenuItemName_PublishGame, @@ -565,7 +557,6 @@ private void actionSaveAll_Click(object sender, EventArgs e) } private void actionOpenCode_Click(object sender, EventArgs e) { - DualityEditorApp.UpdatePluginSourceCode(); System.Diagnostics.Process.Start(EditorHelper.SourceCodeSolutionFilePath); } private void actionPublishGame_Click(object sender, EventArgs e) { @@ -634,24 +625,6 @@ private void welcomeDialog_Disposed(object sender, EventArgs e) this.welcomeDialog.Disposed -= this.welcomeDialog_Disposed; this.welcomeDialog = null; } - private void newProjectItem_Click(object sender, EventArgs e) - { - NewProjectDialog newProject = new NewProjectDialog(); - DialogResult result = newProject.ShowDialog(this); - - // Project successfully created? - if (result == DialogResult.OK) - { - // Open new project - var startInfo = new System.Diagnostics.ProcessStartInfo(newProject.ResultEditorBinary); - startInfo.WorkingDirectory = Path.GetDirectoryName(startInfo.FileName); - startInfo.UseShellExecute = false; - System.Diagnostics.Process.Start(startInfo); - - // Don't need this DualityEditor anymore - close it! - this.CloseNonUser(); - } - } private void formatSetDefault_Click(object sender, EventArgs e) { diff --git a/Source/Editor/DualityEditor/Forms/NewProjectDialog.Designer.cs b/Source/Editor/DualityEditor/Forms/NewProjectDialog.Designer.cs deleted file mode 100644 index a97c98c8e..000000000 --- a/Source/Editor/DualityEditor/Forms/NewProjectDialog.Designer.cs +++ /dev/null @@ -1,382 +0,0 @@ -namespace Duality.Editor.Forms -{ - partial class NewProjectDialog - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewProjectDialog)); - this.folderView = new Aga.Controls.Tree.TreeViewAdv(); - this.folderViewControlIcon = new Aga.Controls.Tree.NodeControls.NodeStateIcon(); - this.folderViewControlName = new Aga.Controls.Tree.NodeControls.NodeTextBox(); - this.imageListTemplateView = new System.Windows.Forms.ImageList(this.components); - this.splitFolderTemplate = new System.Windows.Forms.SplitContainer(); - this.templateView = new Duality.Editor.Controls.ExplorerListView(); - this.columnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnDesc = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.buttonCancel = new System.Windows.Forms.Button(); - this.buttonOk = new System.Windows.Forms.Button(); - this.labelProjectName = new System.Windows.Forms.Label(); - this.labelProjectFolder = new System.Windows.Forms.Label(); - this.buttonBrowseFolder = new System.Windows.Forms.Button(); - this.labelLowerArea = new System.Windows.Forms.Label(); - this.labelDialogDesc = new System.Windows.Forms.Label(); - this.labelProjectTemplate = new System.Windows.Forms.Label(); - this.buttonBrowseTemplate = new System.Windows.Forms.Button(); - this.pictureBoxLogo = new System.Windows.Forms.PictureBox(); - this.labelHeader = new System.Windows.Forms.Label(); - this.textBoxTemplate = new Duality.Editor.Controls.CueTextBox(); - this.textBoxName = new Duality.Editor.Controls.CueTextBox(); - this.textBoxFolder = new Duality.Editor.Controls.CueTextBox(); - ((System.ComponentModel.ISupportInitialize)(this.splitFolderTemplate)).BeginInit(); - this.splitFolderTemplate.Panel1.SuspendLayout(); - this.splitFolderTemplate.Panel2.SuspendLayout(); - this.splitFolderTemplate.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxLogo)).BeginInit(); - this.SuspendLayout(); - // - // folderView - // - this.folderView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(196)))), ((int)(((byte)(196))))); - this.folderView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.folderView.ColumnHeaderHeight = 0; - this.folderView.DefaultToolTipProvider = null; - this.folderView.Dock = System.Windows.Forms.DockStyle.Fill; - this.folderView.DragDropMarkColor = System.Drawing.Color.Black; - this.folderView.FullRowSelect = true; - this.folderView.FullRowSelectActiveColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.folderView.FullRowSelectInactiveColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(212)))), ((int)(((byte)(212))))); - this.folderView.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(92)))), ((int)(((byte)(92)))), ((int)(((byte)(92))))); - this.folderView.LoadOnDemand = true; - this.folderView.Location = new System.Drawing.Point(0, 0); - this.folderView.Model = null; - this.folderView.Name = "folderView"; - this.folderView.NodeControls.Add(this.folderViewControlIcon); - this.folderView.NodeControls.Add(this.folderViewControlName); - this.folderView.NodeFilter = null; - this.folderView.SelectedNode = null; - this.folderView.Size = new System.Drawing.Size(158, 176); - this.folderView.TabIndex = 0; - this.folderView.Text = "Installed Templates"; - this.folderView.SelectionChanged += new System.EventHandler(this.folderView_SelectionChanged); - // - // folderViewControlIcon - // - this.folderViewControlIcon.DataPropertyName = "Icon"; - this.folderViewControlIcon.LeftMargin = 1; - this.folderViewControlIcon.ParentColumn = null; - this.folderViewControlIcon.ScaleMode = Aga.Controls.Tree.ImageScaleMode.Clip; - // - // folderViewControlName - // - this.folderViewControlName.DataPropertyName = "Name"; - this.folderViewControlName.IncrementalSearchEnabled = true; - this.folderViewControlName.LeftMargin = 3; - this.folderViewControlName.ParentColumn = null; - // - // imageListTemplateView - // - this.imageListTemplateView.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; - this.imageListTemplateView.ImageSize = new System.Drawing.Size(32, 32); - this.imageListTemplateView.TransparentColor = System.Drawing.Color.Transparent; - // - // splitFolderTemplate - // - this.splitFolderTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.splitFolderTemplate.Location = new System.Drawing.Point(-1, 60); - this.splitFolderTemplate.Name = "splitFolderTemplate"; - // - // splitFolderTemplate.Panel1 - // - this.splitFolderTemplate.Panel1.Controls.Add(this.folderView); - this.splitFolderTemplate.Panel1MinSize = 150; - // - // splitFolderTemplate.Panel2 - // - this.splitFolderTemplate.Panel2.Controls.Add(this.templateView); - this.splitFolderTemplate.Panel2MinSize = 250; - this.splitFolderTemplate.Size = new System.Drawing.Size(486, 176); - this.splitFolderTemplate.SplitterDistance = 158; - this.splitFolderTemplate.TabIndex = 0; - this.splitFolderTemplate.TabStop = false; - // - // templateView - // - this.templateView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(196)))), ((int)(((byte)(196))))); - this.templateView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.templateView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnName, - this.columnDesc}); - this.templateView.Dock = System.Windows.Forms.DockStyle.Fill; - this.templateView.FullRowSelect = true; - this.templateView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.templateView.LargeImageList = this.imageListTemplateView; - this.templateView.Location = new System.Drawing.Point(0, 0); - this.templateView.MultiSelect = false; - this.templateView.Name = "templateView"; - this.templateView.ShowItemToolTips = true; - this.templateView.Size = new System.Drawing.Size(324, 176); - this.templateView.Sorting = System.Windows.Forms.SortOrder.Ascending; - this.templateView.StateImageList = this.imageListTemplateView; - this.templateView.TabIndex = 1; - this.templateView.TileSize = new System.Drawing.Size(100, 48); - this.templateView.UseCompatibleStateImageBehavior = false; - this.templateView.View = System.Windows.Forms.View.Tile; - this.templateView.SelectedIndexChanged += new System.EventHandler(this.templateView_SelectedIndexChanged); - this.templateView.Resize += new System.EventHandler(this.templateView_Resize); - // - // columnName - // - this.columnName.Text = "Name"; - // - // columnDesc - // - this.columnDesc.Text = "Description"; - // - // buttonCancel - // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(398, 332); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(75, 23); - this.buttonCancel.TabIndex = 8; - this.buttonCancel.Text = "Cancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); - // - // buttonOk - // - this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOk.Location = new System.Drawing.Point(317, 332); - this.buttonOk.Name = "buttonOk"; - this.buttonOk.Size = new System.Drawing.Size(75, 23); - this.buttonOk.TabIndex = 7; - this.buttonOk.Text = "Ok"; - this.buttonOk.UseVisualStyleBackColor = true; - this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click); - // - // labelProjectName - // - this.labelProjectName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.labelProjectName.AutoSize = true; - this.labelProjectName.Location = new System.Drawing.Point(12, 273); - this.labelProjectName.Name = "labelProjectName"; - this.labelProjectName.Size = new System.Drawing.Size(71, 13); - this.labelProjectName.TabIndex = 5; - this.labelProjectName.Text = "Project Name"; - // - // labelProjectFolder - // - this.labelProjectFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.labelProjectFolder.AutoSize = true; - this.labelProjectFolder.Location = new System.Drawing.Point(12, 299); - this.labelProjectFolder.Name = "labelProjectFolder"; - this.labelProjectFolder.Size = new System.Drawing.Size(72, 13); - this.labelProjectFolder.TabIndex = 6; - this.labelProjectFolder.Text = "Project Folder"; - // - // buttonBrowseFolder - // - this.buttonBrowseFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonBrowseFolder.Location = new System.Drawing.Point(402, 293); - this.buttonBrowseFolder.Name = "buttonBrowseFolder"; - this.buttonBrowseFolder.Size = new System.Drawing.Size(71, 23); - this.buttonBrowseFolder.TabIndex = 6; - this.buttonBrowseFolder.Text = "Browse..."; - this.buttonBrowseFolder.UseVisualStyleBackColor = true; - this.buttonBrowseFolder.Click += new System.EventHandler(this.buttonBrowseFolder_Click); - // - // labelLowerArea - // - this.labelLowerArea.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelLowerArea.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(196)))), ((int)(((byte)(196))))); - this.labelLowerArea.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.labelLowerArea.Location = new System.Drawing.Point(-1, 324); - this.labelLowerArea.Margin = new System.Windows.Forms.Padding(3, 5, 3, 3); - this.labelLowerArea.Name = "labelLowerArea"; - this.labelLowerArea.Size = new System.Drawing.Size(486, 39); - this.labelLowerArea.TabIndex = 9; - // - // labelDialogDesc - // - this.labelDialogDesc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelDialogDesc.Location = new System.Drawing.Point(68, 24); - this.labelDialogDesc.Margin = new System.Windows.Forms.Padding(3, 5, 3, 3); - this.labelDialogDesc.Name = "labelDialogDesc"; - this.labelDialogDesc.Size = new System.Drawing.Size(407, 30); - this.labelDialogDesc.TabIndex = 11; - this.labelDialogDesc.Text = "After selecting a suitable project template, destination and name, a new project " + - "folder will be automatically created."; - this.labelDialogDesc.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelProjectTemplate - // - this.labelProjectTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.labelProjectTemplate.AutoSize = true; - this.labelProjectTemplate.Location = new System.Drawing.Point(12, 247); - this.labelProjectTemplate.Name = "labelProjectTemplate"; - this.labelProjectTemplate.Size = new System.Drawing.Size(87, 13); - this.labelProjectTemplate.TabIndex = 12; - this.labelProjectTemplate.Text = "Project Template"; - // - // buttonBrowseTemplate - // - this.buttonBrowseTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonBrowseTemplate.Location = new System.Drawing.Point(402, 242); - this.buttonBrowseTemplate.Name = "buttonBrowseTemplate"; - this.buttonBrowseTemplate.Size = new System.Drawing.Size(71, 23); - this.buttonBrowseTemplate.TabIndex = 3; - this.buttonBrowseTemplate.Text = "Browse..."; - this.buttonBrowseTemplate.UseVisualStyleBackColor = true; - this.buttonBrowseTemplate.Click += new System.EventHandler(this.buttonBrowseTemplate_Click); - // - // pictureBoxLogo - // - this.pictureBoxLogo.Image = global::Duality.Editor.Properties.Resources.DualityIcon48; - this.pictureBoxLogo.Location = new System.Drawing.Point(9, 6); - this.pictureBoxLogo.Margin = new System.Windows.Forms.Padding(0); - this.pictureBoxLogo.Name = "pictureBoxLogo"; - this.pictureBoxLogo.Size = new System.Drawing.Size(48, 48); - this.pictureBoxLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBoxLogo.TabIndex = 15; - this.pictureBoxLogo.TabStop = false; - // - // labelHeader - // - this.labelHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelHeader.Location = new System.Drawing.Point(68, 3); - this.labelHeader.Margin = new System.Windows.Forms.Padding(0); - this.labelHeader.Name = "labelHeader"; - this.labelHeader.Size = new System.Drawing.Size(407, 22); - this.labelHeader.TabIndex = 0; - this.labelHeader.Text = "Create new Duality Project"; - this.labelHeader.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // textBoxTemplate - // - this.textBoxTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxTemplate.CueText = "Select project template"; - this.textBoxTemplate.Location = new System.Drawing.Point(105, 244); - this.textBoxTemplate.Name = "textBoxTemplate"; - this.textBoxTemplate.Size = new System.Drawing.Size(291, 20); - this.textBoxTemplate.TabIndex = 2; - this.textBoxTemplate.TextChanged += new System.EventHandler(this.textBoxTemplate_TextChanged); - // - // textBoxName - // - this.textBoxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxName.CueText = "Enter project name here"; - this.textBoxName.Location = new System.Drawing.Point(105, 270); - this.textBoxName.Name = "textBoxName"; - this.textBoxName.Size = new System.Drawing.Size(291, 20); - this.textBoxName.TabIndex = 4; - // - // textBoxFolder - // - this.textBoxFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxFolder.CueText = "Select a project folder"; - this.textBoxFolder.Location = new System.Drawing.Point(105, 296); - this.textBoxFolder.Name = "textBoxFolder"; - this.textBoxFolder.Size = new System.Drawing.Size(291, 20); - this.textBoxFolder.TabIndex = 5; - // - // NewProjectDialog - // - this.AcceptButton = this.buttonOk; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(212)))), ((int)(((byte)(212))))); - this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(484, 362); - this.Controls.Add(this.labelHeader); - this.Controls.Add(this.pictureBoxLogo); - this.Controls.Add(this.buttonBrowseTemplate); - this.Controls.Add(this.textBoxTemplate); - this.Controls.Add(this.labelProjectTemplate); - this.Controls.Add(this.labelDialogDesc); - this.Controls.Add(this.textBoxName); - this.Controls.Add(this.textBoxFolder); - this.Controls.Add(this.buttonBrowseFolder); - this.Controls.Add(this.labelProjectFolder); - this.Controls.Add(this.labelProjectName); - this.Controls.Add(this.buttonOk); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.splitFolderTemplate); - this.Controls.Add(this.labelLowerArea); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(500, 400); - this.Name = "NewProjectDialog"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "New Project..."; - this.splitFolderTemplate.Panel1.ResumeLayout(false); - this.splitFolderTemplate.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitFolderTemplate)).EndInit(); - this.splitFolderTemplate.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxLogo)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private Aga.Controls.Tree.TreeViewAdv folderView; - private Duality.Editor.Controls.ExplorerListView templateView; - private System.Windows.Forms.ColumnHeader columnName; - private System.Windows.Forms.ColumnHeader columnDesc; - private System.Windows.Forms.SplitContainer splitFolderTemplate; - private System.Windows.Forms.Button buttonCancel; - private System.Windows.Forms.Button buttonOk; - private System.Windows.Forms.Label labelProjectName; - private System.Windows.Forms.Label labelProjectFolder; - private System.Windows.Forms.Button buttonBrowseFolder; - private Duality.Editor.Controls.CueTextBox textBoxFolder; - private System.Windows.Forms.Label labelLowerArea; - private Duality.Editor.Controls.CueTextBox textBoxName; - private System.Windows.Forms.Label labelDialogDesc; - private System.Windows.Forms.Label labelProjectTemplate; - private Duality.Editor.Controls.CueTextBox textBoxTemplate; - private System.Windows.Forms.Button buttonBrowseTemplate; - private Aga.Controls.Tree.NodeControls.NodeStateIcon folderViewControlIcon; - private Aga.Controls.Tree.NodeControls.NodeTextBox folderViewControlName; - private System.Windows.Forms.PictureBox pictureBoxLogo; - private System.Windows.Forms.Label labelHeader; - private System.Windows.Forms.ImageList imageListTemplateView; - } -} \ No newline at end of file diff --git a/Source/Editor/DualityEditor/Forms/NewProjectDialog.cs b/Source/Editor/DualityEditor/Forms/NewProjectDialog.cs deleted file mode 100644 index 04d58aebc..000000000 --- a/Source/Editor/DualityEditor/Forms/NewProjectDialog.cs +++ /dev/null @@ -1,306 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using System.IO; -using System.Xml.Linq; - -using Aga.Controls; -using Aga.Controls.Tree; -using Aga.Controls.Tree.NodeControls; - -using Duality; -using Duality.IO; - -using Duality.Editor.Controls.TreeModels.FileSystem; -using Duality.Editor.Properties; - -namespace Duality.Editor.Forms -{ - public partial class NewProjectDialog : Form - { - private FolderBrowserTreeModel folderModel = null; - private string selectedTemplatePath = null; - private ProjectTemplateInfo selectedTemplate = null; - private ProjectTemplateInfo templateEmpty = null; - private ProjectTemplateInfo templateCurrent = null; - private string resultEditorBinary = null; - private Color defaultTextBoxBackColor; - - public string ResultEditorBinary - { - get { return this.resultEditorBinary; } - } - - public NewProjectDialog() - { - this.InitializeComponent(); - this.templateView_Resize(this, EventArgs.Empty); // Trigger update tile size - - this.defaultTextBoxBackColor = this.textBoxFolder.BackColor; - - this.folderModel = new FolderBrowserTreeModel(EditorHelper.GlobalProjectTemplateDirectory); - this.folderModel.Filter = s => Directory.Exists(s); // Only show directories - this.folderView.Model = this.folderModel; - this.folderViewControlName.DrawText += this.folderViewControlName_DrawText; - - this.selectedTemplatePath = this.folderModel.BasePath; - - // Create hardcoded templates - this.templateEmpty = new ProjectTemplateInfo(); - this.templateEmpty.Icon = GeneralResCache.ImageTemplateEmpty; - this.templateEmpty.Name = GeneralRes.Template_Empty_Name; - this.templateEmpty.Description = GeneralRes.Template_Empty_Desc; - this.templateEmpty.SpecialTag = ProjectTemplateInfo.SpecialInfo.Empty; - - this.templateCurrent = new ProjectTemplateInfo(); - this.templateCurrent.Icon = GeneralResCache.ImageTemplateCurrent; - this.templateCurrent.Name = GeneralRes.Template_Current_Name; - this.templateCurrent.Description = GeneralRes.Template_Current_Desc; - this.templateCurrent.SpecialTag = ProjectTemplateInfo.SpecialInfo.Current; - - // Hilde folder selector, if empty - if (!Directory.Exists(this.folderModel.BasePath) || Directory.GetDirectories(this.folderModel.BasePath).Length == 0) - { - this.folderView.Enabled = false; - this.splitFolderTemplate.Panel1Collapsed = true; - } - - this.UpdateTemplateList(); - } - - protected void UpdateTemplateList() - { - this.templateView.BeginUpdate(); - this.templateView.Items.Clear(); - this.imageListTemplateView.Images.Clear(); - - // Scan for template files - string[] templateFiles = Directory.Exists(this.selectedTemplatePath) ? Directory.GetFiles(this.selectedTemplatePath, "*.zip", SearchOption.TopDirectoryOnly) : new string[0]; - List templateEntries = new List(); - foreach (string templateFile in templateFiles) - { - try - { - ProjectTemplateInfo entry = new ProjectTemplateInfo(templateFile); - templateEntries.Add(entry); - } - catch (Exception e) - { - Logs.Editor.WriteError("Can't load project template {0} because an error occurred in the process: {1}", templateFile, LogFormat.Exception(e)); - } - } - - // Add hardcoded templates - if (this.selectedTemplatePath == this.folderModel.BasePath) - { - templateEntries.Insert(0, this.templateCurrent); - templateEntries.Insert(0, this.templateEmpty); - } - - // Add template entries to view - foreach (ProjectTemplateInfo entry in templateEntries) - { - Bitmap icon = entry.Icon; - if (icon != null) - { - if (icon.Size != this.imageListTemplateView.ImageSize) - icon = icon.Rescale(this.imageListTemplateView.ImageSize.Width, this.imageListTemplateView.ImageSize.Height); - this.imageListTemplateView.Images.Add(entry.FilePath ?? entry.Name, icon); - } - - ListViewItem item = new ListViewItem(new string[] { entry.Name, entry.Description }, entry.FilePath ?? entry.Name); - item.Tag = entry; - item.ToolTipText = entry.Description; - this.templateView.Items.Add(item); - } - - this.templateView.Sort(); - this.templateView.EndUpdate(); - } - protected bool CheckInputValid() - { - Color errorColor = this.defaultTextBoxBackColor.MixWith(Color.Red, 0.25f, true); - - this.textBoxFolder.BackColor = this.defaultTextBoxBackColor; - this.textBoxTemplate.BackColor = this.defaultTextBoxBackColor; - this.textBoxName.BackColor = this.defaultTextBoxBackColor; - - if (this.selectedTemplate == null) - { - this.textBoxTemplate.BackColor = errorColor; - return false; - } - if (string.IsNullOrWhiteSpace(this.textBoxName.Text) || !PathHelper.IsPathValid(this.textBoxName.Text)) - { - this.textBoxName.BackColor = errorColor; - return false; - } - if (string.IsNullOrWhiteSpace(this.textBoxFolder.Text) || !PathHelper.IsPathValid(this.textBoxFolder.Text)) - { - this.textBoxFolder.BackColor = errorColor; - return false; - } - - string targetDir = Path.Combine(this.textBoxFolder.Text, this.textBoxName.Text); - if (Directory.Exists(targetDir)) - { - if (Directory.EnumerateFiles(targetDir, "*", SearchOption.AllDirectories).Any()) - { - this.textBoxFolder.BackColor = errorColor; - MessageBox.Show( - GeneralRes.Msg_CreateProjectErrorTargetExists_Desc, - GeneralRes.Msg_CreateProjectErrorTargetExists_Caption, - MessageBoxButtons.OK, - MessageBoxIcon.Warning); - return false; - } - } - if (File.Exists(targetDir)) - { - this.textBoxFolder.BackColor = errorColor; - MessageBox.Show( - GeneralRes.Msg_CreateProjectErrorTargetIsFilePath_Desc, - GeneralRes.Msg_CreateProjectErrorTargetExists_Caption, - MessageBoxButtons.OK, - MessageBoxIcon.Warning); - return false; - } - if (PathOp.IsPathLocatedIn(targetDir, Environment.CurrentDirectory)) - { - this.textBoxFolder.BackColor = errorColor; - MessageBox.Show( - GeneralRes.Msg_CreateProjectErrorNestedFolder_Desc, - GeneralRes.Msg_CreateProjectErrorNestedFolder_Caption, - MessageBoxButtons.OK, - MessageBoxIcon.Warning); - return false; - } - - return true; - } - - private void folderViewControlName_DrawText(object sender, DrawTextEventArgs e) - { - e.TextColor = Color.Black; - } - - private void templateView_Resize(object sender, EventArgs e) - { - this.templateView.TileSize = new Size(this.templateView.ClientSize.Width, this.templateView.TileSize.Height); - } - private void templateView_SelectedIndexChanged(object sender, EventArgs e) - { - ProjectTemplateInfo entry = this.templateView.SelectedItems.Count > 0 ? this.templateView.SelectedItems[0].Tag as ProjectTemplateInfo : null; - if (entry == null) return; - - if (entry.FilePath == null) - this.textBoxTemplate.Text = entry.Name; - else - this.textBoxTemplate.Text = entry.FilePath; - } - private void buttonCancel_Click(object sender, EventArgs e) - { - this.DialogResult = DialogResult.Cancel; - this.Close(); - } - private void buttonOk_Click(object sender, EventArgs e) - { - // Make sure the input is valid and display an error if not - if (!this.CheckInputValid()) return; - - // Ask if the selected template should be copied to the template directory, if not located there (auto-install) - if (this.selectedTemplate.SpecialTag == ProjectTemplateInfo.SpecialInfo.None && - !PathOp.IsPathLocatedIn(this.selectedTemplate.FilePath, EditorHelper.GlobalProjectTemplateDirectory)) - { - DialogResult result = MessageBox.Show( - Properties.GeneralRes.Msg_InstallNewTemplate_Desc, - Properties.GeneralRes.Msg_InstallNewTemplate_Caption, - MessageBoxButtons.YesNoCancel, - MessageBoxIcon.Question); - if (result == System.Windows.Forms.DialogResult.Cancel) return; - if (result == System.Windows.Forms.DialogResult.Yes) - { - if (!Directory.Exists(EditorHelper.GlobalProjectTemplateDirectory)) - Directory.CreateDirectory(EditorHelper.GlobalProjectTemplateDirectory); - File.Copy( - this.selectedTemplate.FilePath, - Path.Combine(EditorHelper.GlobalProjectTemplateDirectory, Path.GetFileName(this.selectedTemplate.FilePath))); - } - } - - // Create a new project - try - { - this.resultEditorBinary = EditorHelper.CreateNewProject(this.textBoxName.Text, this.textBoxFolder.Text, this.selectedTemplate); - } - catch (Exception exception) - { - this.resultEditorBinary = null; - MessageBox.Show( - string.Format(Properties.GeneralRes.Msg_ErrorCantCreateProject_Desc, LogFormat.Exception(exception), Environment.NewLine), - Properties.GeneralRes.Msg_ErrorCantCreateProject_Caption, - MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - // Close successfully - this.DialogResult = this.resultEditorBinary != null ? DialogResult.OK : DialogResult.Cancel; - this.Close(); - } - - private void buttonBrowseTemplate_Click(object sender, EventArgs e) - { - OpenFileDialog fileDialog = new OpenFileDialog(); - fileDialog.CheckFileExists = true; - fileDialog.CheckPathExists = true; - fileDialog.Multiselect = false; - fileDialog.Title = Properties.GeneralRes.OpenTemplateDialog_Title; - fileDialog.RestoreDirectory = true; - fileDialog.InitialDirectory = Environment.CurrentDirectory; - fileDialog.AddExtension = true; - fileDialog.Filter = Properties.GeneralRes.OpenTemplateDialog_Filters; - - DialogResult result = fileDialog.ShowDialog(); - if (result == DialogResult.OK) - { - this.textBoxTemplate.Text = Path.GetFullPath(fileDialog.FileName); - } - } - private void buttonBrowseFolder_Click(object sender, EventArgs e) - { - FolderBrowserDialog folderDialog = new FolderBrowserDialog(); - folderDialog.ShowNewFolderButton = true; - folderDialog.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); - folderDialog.Description =Properties.GeneralRes.SelectNewProjectFolderDialog_Desc; - - DialogResult result = folderDialog.ShowDialog(); - if (result == DialogResult.OK) - { - this.textBoxFolder.Text = Path.GetFullPath(folderDialog.SelectedPath); - } - } - - private void textBoxTemplate_TextChanged(object sender, EventArgs e) - { - if (this.textBoxTemplate.Text == this.templateEmpty.Name) - this.selectedTemplate = this.templateEmpty; - else if (this.textBoxTemplate.Text == this.templateCurrent.Name) - this.selectedTemplate = this.templateCurrent; - else - { - try { this.selectedTemplate = new ProjectTemplateInfo(this.textBoxTemplate.Text); } - catch (Exception) { this.selectedTemplate = null; } - } - } - - private void folderView_SelectionChanged(object sender, EventArgs e) - { - FolderItem folderItem = this.folderView.SelectedNode != null ? this.folderView.SelectedNode.Tag as FolderItem : null; - this.selectedTemplatePath = folderItem != null ? folderItem.ItemPath : this.folderModel.BasePath; - this.UpdateTemplateList(); - } - } -} diff --git a/Source/Editor/DualityEditor/Forms/NewProjectDialog.resx b/Source/Editor/DualityEditor/Forms/NewProjectDialog.resx deleted file mode 100644 index b82877e56..000000000 --- a/Source/Editor/DualityEditor/Forms/NewProjectDialog.resx +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - - - AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/zPZdL8f1hyDA9RIevfMSHLfzhxq0 - 8V0AAAAAAAAAAKlxUanDjmj/wItm/76IZP+7hWH/uYNf/7R+XP+yfFr/k5KF/03P9/8swO7/Jrzs/zPD - 9P+BhH7/qXFRqQAAAADIkmz//////////////////////////////////////+D3/f9M0Pf/g975/3rZ - +f8swfT/1/L9/6lyUf8AAAAAypRu///////////////+/////f/+/v3//v78//z+/P+H3/n/dNr4/4zg - +v+D3fn/VND2/2HQ9/+odFX/AAAAAMyXb//////////8/////f/+/vz//v78//7++/+g5/n/atj5/3Pa - +P+L4Pr/gt35/1HO9/8yw/T/Vp2z/wAAAADRnHP///////7+/P/+/vz//v78//39+//9/fv/+Pz6/9X0 - +P+k5vj/Ztf4/1nS+P+K3PX/yO/8/6t8Xf8AAAAA1J51///////+/vz//f37//39/P/9/fv//f35//z8 - +P/7+ff/+/n1/3LY9v9n1fX/+/Xy//////+yfFr/AAAAANWgdv///////f38//39+//9/fr//Pz5//z7 - 9//7+fX/+/j0//v38//P7PT/y+nx//jy7P//////tX5c/wAAAADYonn///////39+v/8/Pr//Pv5//v6 - 9v/7+PX/+/f0//v28f/49O7/9/Lr//fw6v/27Oj//////7eBXv8AAAAA2aN5///////8+/n//Pv4//v5 - 9//79/T/+vfy//n18P/38+3/9u/q//Xr5//z6uT/8ufe//////+6hWD/AAAAANukev////////////// - ////////////////////////////////////////////////////////vYdj/wAAAADcp3v/3Kd7/9yn - e//cp3v/3Kd7/9yne//cp3v/3Kd7/9yne//cp3v/3Kd7/9yne//cp3v/3Kd7/8CLZv8AAAAA3ayF/ei5 - kv/ouZL/6LmS/+i5kv/ouZL/6LmS/+i5kv/ouZL/6LmS/+i5kv/ouZL/6LmS/+i5kv/BkG/9AAAAAKlx - UWvdsY303Kd7/9ymev/apHr/2KJ5/9Wgdv/UnnX/0p1z/8+acv/OmXD/y5Zv/8mUbP/Emnr0qXFRawAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAA//+sQf8DrEEAAaxBAAGsQQABrEEAAaxBAAGsQQABrEEAAaxBAAGsQQABrEEAAaxBAAGsQQAB - rEEAAaxB//+sQQ== - - - \ No newline at end of file diff --git a/Source/Editor/DualityEditor/PackageManagement/Internal/NuGetTargetedPackageManager.cs b/Source/Editor/DualityEditor/PackageManagement/Internal/NuGetTargetedPackageManager.cs deleted file mode 100644 index f1a90000f..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/Internal/NuGetTargetedPackageManager.cs +++ /dev/null @@ -1,228 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Versioning; - -using NuGet; -using NuGet.Resources; - -namespace Duality.Editor.PackageManagement.Internal -{ - /// - /// A custom version of the NuGet based on a cleaned up decompile. - /// This was necessary in order to add support for framework-dependent dependencies via target framework - /// parameter in its internal package dependency walkers. - /// - public class NuGetTargetedPackageManager - { - private ILogger logger; - private readonly FrameworkName targetFrameWork; - - - public event EventHandler PackageInstalling; - public event EventHandler PackageInstalled; - public event EventHandler PackageUninstalling; - public event EventHandler PackageUninstalled; - - - public DependencyVersion DependencyVersion { get; set; } - public bool WhatIf { get; set; } - public IFileSystem FileSystem { get; set; } - public IPackageRepository SourceRepository { get; private set; } - public IPackageRepository LocalRepository { get; private set; } - public IPackagePathResolver PathResolver { get; private set; } - public ILogger Logger - { - get { return this.logger ?? NullLogger.Instance; } - set { this.logger = value; } - } - - - public NuGetTargetedPackageManager(FrameworkName targetFrameWork, IPackageRepository sourceRepository, string path) : this( - sourceRepository, - path) - { - this.targetFrameWork = targetFrameWork; - } - public NuGetTargetedPackageManager(IPackageRepository sourceRepository, string path) : this( - sourceRepository, - new DefaultPackagePathResolver(path), - new PhysicalFileSystem(path)) { } - public NuGetTargetedPackageManager(IPackageRepository sourceRepository, IPackagePathResolver pathResolver, IFileSystem fileSystem) : this( - sourceRepository, - pathResolver, - fileSystem, - new LocalPackageRepository(pathResolver, fileSystem)) { } - public NuGetTargetedPackageManager(IPackageRepository sourceRepository, IPackagePathResolver pathResolver, IFileSystem fileSystem, IPackageRepository localRepository) - { - if (sourceRepository == null) throw new ArgumentNullException("sourceRepository"); - if (pathResolver == null) throw new ArgumentNullException("pathResolver"); - if (fileSystem == null) throw new ArgumentNullException("fileSystem"); - if (localRepository == null) throw new ArgumentNullException("localRepository"); - - this.SourceRepository = sourceRepository; - this.PathResolver = pathResolver; - this.FileSystem = fileSystem; - this.LocalRepository = localRepository; - this.DependencyVersion = DependencyVersion.Lowest; - } - - public void InstallPackage(IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions) - { - this.Execute(package, new InstallWalker( - this.LocalRepository, - this.SourceRepository, - this.targetFrameWork, - this.Logger, - ignoreDependencies, - allowPrereleaseVersions, - this.DependencyVersion)); - } - public void UninstallPackage(IPackage package, bool forceRemove, bool removeDependencies = false) - { - this.Execute(package, new UninstallWalker( - this.LocalRepository, - new DependentsWalker(this.LocalRepository, this.targetFrameWork), - this.targetFrameWork, - this.Logger, - removeDependencies, - forceRemove)); - } - public void UpdatePackage(IPackage newPackage, bool updateDependencies, bool allowPrereleaseVersions) - { - this.Execute(newPackage, new UpdateWalker( - this.LocalRepository, - this.SourceRepository, - new DependentsWalker(this.LocalRepository, this.targetFrameWork), - NullConstraintProvider.Instance, - this.targetFrameWork, - this.Logger, updateDependencies, - allowPrereleaseVersions)); - } - - - private void Execute(IPackage package, IPackageOperationResolver resolver) - { - IEnumerable source = resolver.ResolveOperations(package); - if (source.Any()) - { - foreach (PackageOperation operation in source) - { - this.Execute(operation); - } - } - else - { - if (!this.LocalRepository.Exists(package)) - return; - this.Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageAlreadyInstalled, (object)package.GetFullName()); - } - } - private void Execute(PackageOperation operation) - { - bool isPackageInstalled = this.LocalRepository.Exists(operation.Package); - if (operation.Action == PackageAction.Install) - { - if (isPackageInstalled) - this.Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageAlreadyInstalled, (object)operation.Package.GetFullName()); - else if (this.WhatIf) - this.Logger.Log(MessageLevel.Info, NuGetResources.Log_InstallPackage, (object)operation.Package); - else - this.ExecuteInstall(operation.Package); - } - else - { - if (!isPackageInstalled) - return; - if (this.WhatIf) - this.Logger.Log(MessageLevel.Info, NuGetResources.Log_UninstallPackage, (object)operation.Package); - else - this.ExecuteUninstall(operation.Package); - } - } - - private void ExecuteInstall(IPackage package) - { - string fullName = package.GetFullName(); - this.Logger.Log(MessageLevel.Info, NuGetResources.Log_BeginInstallPackage, (object)fullName); - PackageOperationEventArgs operation = this.CreateOperation(package); - this.OnInstalling(operation); - if (operation.Cancel) - return; - this.ExpandFiles(operation.Package); - this.LocalRepository.AddPackage(package); - this.Logger.Log(MessageLevel.Info, NuGetResources.Log_PackageInstalledSuccessfully, (object)fullName); - this.OnInstalled(operation); - } - private void ExecuteUninstall(IPackage package) - { - string fullName = package.GetFullName(); - this.Logger.Log(MessageLevel.Info, NuGetResources.Log_BeginUninstallPackage, (object)fullName); - PackageOperationEventArgs operation = this.CreateOperation(package); - this.OnUninstalling(operation); - if (operation.Cancel) - return; - this.RemoveFiles(operation.Package); - this.LocalRepository.RemovePackage(package); - this.Logger.Log(MessageLevel.Info, NuGetResources.Log_SuccessfullyUninstalledPackage, (object)fullName); - this.OnUninstalled(operation); - } - - private void ExpandFiles(IPackage package) - { - IBatchProcessor fileSystem = this.FileSystem as IBatchProcessor; - try - { - List list = package.GetFiles().ToList(); - if (fileSystem != null) - fileSystem.BeginProcessing( - list.Select(p => p.Path), - PackageAction.Install); - string packageDirectory = this.PathResolver.GetPackageDirectory(package); - this.FileSystem.AddFiles(list, packageDirectory); - IPackage runtimePackage; - if (!PackageHelper.IsSatellitePackage(package, this.LocalRepository, this.targetFrameWork, out runtimePackage)) - return; - this.FileSystem.AddFiles(package.GetSatelliteFiles(), this.PathResolver.GetPackageDirectory(runtimePackage)); - } - finally - { - if (fileSystem != null) fileSystem.EndProcessing(); - } - } - private void RemoveFiles(IPackage package) - { - string packageDirectory = this.PathResolver.GetPackageDirectory(package); - IPackage runtimePackage; - if (PackageHelper.IsSatellitePackage(package, this.LocalRepository, this.targetFrameWork, out runtimePackage)) - this.FileSystem.DeleteFiles(package.GetSatelliteFiles(), this.PathResolver.GetPackageDirectory(runtimePackage)); - this.FileSystem.DeleteFiles(package.GetFiles(), packageDirectory); - } - - private void OnInstalling(PackageOperationEventArgs e) - { - if (this.PackageInstalling != null) - this.PackageInstalling(this, e); - } - private void OnInstalled(PackageOperationEventArgs e) - { - if (this.PackageInstalled != null) - this.PackageInstalled(this, e); - } - private void OnUninstalling(PackageOperationEventArgs e) - { - if (this.PackageUninstalling != null) - this.PackageUninstalling(this, e); - } - private void OnUninstalled(PackageOperationEventArgs e) - { - if (this.PackageUninstalled != null) - this.PackageUninstalled(this, e); - } - - private PackageOperationEventArgs CreateOperation(IPackage package) - { - return new PackageOperationEventArgs(package, this.FileSystem, this.PathResolver.GetInstallPath(package)); - } - } -} \ No newline at end of file diff --git a/Source/Editor/DualityEditor/PackageManagement/LocalPackage.cs b/Source/Editor/DualityEditor/PackageManagement/LocalPackage.cs deleted file mode 100644 index 4ce6f3b99..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/LocalPackage.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Duality.Editor.PackageManagement -{ - /// - /// Describes a Duality package that is part of the local . - /// - public sealed class LocalPackage - { - private PackageName name = PackageName.None; - private PackageInfo info = null; - - - /// - /// [GET] The name of the package, including ID and version number. - /// Note that a local package may be version-invariant to flag itself - /// for an update to the newest available version during package verify. - /// - public PackageName Name - { - get { return this.name; } - } - /// - /// [GET] The ID of the package. - /// - public string Id - { - get { return this.name.Id; } - } - /// - /// [GET] The version of the package. Can be null, in which case the - /// package will be treated as version-invariant. - /// - public Version Version - { - get { return this.name.Version; } - } - /// - /// [GET] A representing the locally installed - /// version of the package. - /// - public PackageInfo Info - { - get { return this.info; } - internal set { this.info = value; } - } - - - internal LocalPackage(PackageInfo info) - { - this.name = info.Name; - this.info = info; - } - internal LocalPackage(PackageName package) - { - this.name = package; - this.info = null; - } - - public override string ToString() - { - return string.Format("Local Package '{0}'", this.name); - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageCache.cs b/Source/Editor/DualityEditor/PackageManagement/PackageCache.cs deleted file mode 100644 index 80b3bd30f..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageCache.cs +++ /dev/null @@ -1,278 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Xml; -using System.Xml.Linq; -using System.Windows.Forms; -using System.Diagnostics; - -using NuGet; - -using Duality.IO; -using Duality.Editor.Properties; -using Duality.Editor.Forms; - -namespace Duality.Editor.PackageManagement -{ - /// - /// Caches information about remote package repositories. - /// - internal class PackageCache - { - private NuGet.IPackageRepository repository = null; - private bool hasLocalRepo = false; - - private object cacheLock = new object(); - private Dictionary nameToPackage = new Dictionary(); - private Dictionary nameToNuGetPackage = new Dictionary(); - private Dictionary uniquePackageWrap = new Dictionary(); - private List latestDuality = null; - private Dictionary> repositoryPackages = new Dictionary>(); - - - public PackageCache(NuGet.IPackageRepository repository, bool isPartiallyLocalRepo) - { - this.repository = repository; - this.hasLocalRepo = isPartiallyLocalRepo; - } - - /// - /// Clears the cache to allow querying updated information from the repository. - /// - /// Does not clear the internal mapping from fully qualified package names to - /// actual packages, as the repository is still the same and NuGet packages - /// are read-only after publish. - /// - public void Clear() - { - lock (this.cacheLock) - { - this.latestDuality = null; - this.nameToPackage.Clear(); - this.nameToNuGetPackage.Clear(); - this.repositoryPackages.Clear(); - - // Don't clear the unique wrap cache, see XML docs comment about - // read-only NuGet packages after publish. - } - } - - /// - /// Enumerates the latest available Duality packages in the remote repository. - /// - /// - public IEnumerable GetLatestDualityPackages() - { - lock (this.cacheLock) - { - if (this.latestDuality != null) - return this.latestDuality; - } - - return this.QueryLatestDualityPackages(); - } - /// - /// Retrieves information about the specified package. - /// - /// - /// - public PackageInfo GetPackage(PackageName name) - { - PackageInfo result; - lock (this.cacheLock) - { - if (this.nameToPackage.TryGetValue(name, out result)) - return result; - - NuGet.IPackage nugetPackage = this.GetNuGetPackage(name); - if (nugetPackage == null) - result = null; - else - result = this.WrapPackage(nugetPackage); - - this.nameToPackage[name] = result; - } - return result; - } - /// - /// Retrieves a NuGet package based on the specified name. - /// - /// - /// - public NuGet.IPackage GetNuGetPackage(PackageName name) - { - NuGet.IPackage result; - lock (this.cacheLock) - { - if (this.nameToNuGetPackage.TryGetValue(name, out result)) - return result; - - result = this.FindPackage(name); - - this.nameToNuGetPackage[name] = result; - } - return result; - } - - - private IEnumerable QueryLatestDualityPackages() - { - // Query all NuGet packages - IQueryable query = this.repository.GetPackages(); - - // Filter out old packages - query = query.Where(p => p.IsLatestVersion); - - // Only look at NuGet packages tagged with "Duality" and "Plugin" - query = query.Where(p => - p.Tags != null && - p.Tags.Contains(PackageManager.DualityTag)); - - // If there is a local package repository, IsLatest isn't set. Need to emulate this - if (this.hasLocalRepo) - { - List packages = query.ToList(); - for (int i = packages.Count - 1; i >= 0; i--) - { - IPackage current = packages[i]; - bool isLatest = !packages.Any(p => p.Id == current.Id && p.Version > current.Version); - if (!isLatest) - { - packages.RemoveAt(i); - } - } - query = packages.AsQueryable(); - } - - // Cache every result item as it arrives, validate the cache only - // after the qurey has finished - List results = new List(); - - // Transform results into Duality package representation - foreach (NuGet.IPackage package in query) - { - // Filter out all packages that shouldn't be presented to the user. This - // includes pre-release and unlisted packages. - if (!this.IsUserAvailable(package)) continue; - - // Create a Duality package representation for all query hits - PackageInfo info = this.WrapPackage(package); - results.Add(info); - yield return info; - } - - lock (this.cacheLock) - { - this.latestDuality = results; - } - } - private NuGet.IPackage FindPackage(PackageName packageRef) - { - try - { - // Find a specific version. We're not looking for listed packages only. - if (packageRef.Version != null) - { - // First try an indexed lookup. This may fail for freshly released packages. - foreach (NuGet.IPackage package in this.GetRemotePackages(packageRef.Id)) - { - if (!package.IsReleaseVersion()) continue; - if (package.Version.Version != packageRef.Version) continue; - return package; - } - - // If that fails, enumerate all packages and select the one we need. - // - // Note: Make sure to include OrderByDescending. Without it, non-indexed - // packages will not be returned from the query. - IQueryable query = - this.repository.GetPackages() - .Where(p => p.Id == packageRef.Id) - .OrderByDescending(p => p.Version); - foreach (NuGet.IPackage package in query) - { - if (!package.IsReleaseVersion()) continue; - if (package.Version.Version != packageRef.Version) continue; - return package; - } - - // No matching package was found - return null; - } - // Find the newest available, listed version online. - else - { - // Do an indexed lookup. This may fail for freshly released packages, - // but turns out to be more robust otherwise. Our previous approach - // of querying non-indexed NuGet API via search sometimes failed with - // the server returning no results on the n-th query. - Version latestVersion = new Version(0, 0); - NuGet.IPackage latestPackage = null; - foreach (NuGet.IPackage package in this.GetRemotePackages(packageRef.Id)) - { - if (!this.IsUserAvailable(package)) continue; - if (package.Version.Version > latestVersion) - { - latestVersion = package.Version.Version; - latestPackage = package; - } - } - return latestPackage; - } - } - catch (Exception e) - { - Logs.Editor.WriteWarning("Error querying NuGet package repository: {0}", LogFormat.Exception(e)); - return null; - } - } - private List GetRemotePackages(string id) - { - // Quickly check if we have this result in our cache already - List result; - lock (this.cacheLock) - { - if (this.repositoryPackages.TryGetValue(id, out result)) - return result; - } - - // Otherwise, query the repository for all packages with this id - result = this.repository - .FindPackagesById(id) - .ToList(); - - // Update the cache with our new results - lock (this.cacheLock) - { - this.repositoryPackages[id] = result; - } - return result; - } - - private PackageInfo WrapPackage(NuGet.IPackage package) - { - PackageName name = new PackageName(package.Id, package.Version.Version); - lock (this.cacheLock) - { - PackageInfo info; - if (this.uniquePackageWrap.TryGetValue(name, out info)) - return info; - - info = new PackageInfo(package); - - this.uniquePackageWrap.Add(name, info); - return info; - } - } - private bool IsUserAvailable(NuGet.IPackage package) - { - // Filter unlisted, non-release and special versions - if (!package.IsReleaseVersion()) return false; - if (!package.IsListed()) return false; - if (package.Version != new SemanticVersion(package.Version.Version)) return false; - return true; - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageCompatibility.cs b/Source/Editor/DualityEditor/PackageManagement/PackageCompatibility.cs deleted file mode 100644 index 3ec812836..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageCompatibility.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Duality.Editor.PackageManagement -{ - public enum PackageCompatibility - { - Unknown, - - None, - Unlikely, - Likely, - Definite - } - - public static class ExtMethodsPackageCompatibility - { - public static PackageCompatibility Combine(this PackageCompatibility self, PackageCompatibility other) - { - if (self == PackageCompatibility.Unknown || other == PackageCompatibility.Unknown) - return PackageCompatibility.Unknown; - else - return (PackageCompatibility)MathF.Min((int)self, (int)other); - } - public static bool IsAtLeast(this PackageCompatibility self, PackageCompatibility other) - { - if (self == PackageCompatibility.Unknown) return false; - return (int)self >= (int)other; - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageDependencyWalker.cs b/Source/Editor/DualityEditor/PackageManagement/PackageDependencyWalker.cs deleted file mode 100644 index ba228a042..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageDependencyWalker.cs +++ /dev/null @@ -1,204 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Xml; -using System.Xml.Linq; -using System.Windows.Forms; -using System.Diagnostics; - -using NuGet; - -using Duality.IO; -using Duality.Editor.Properties; -using Duality.Editor.Forms; - -namespace Duality.Editor.PackageManagement -{ - /// - /// Implements an algorithm to walk a package dependency graph and determine - /// a packages transitive dependencies. - /// - public class PackageDependencyWalker - { - private Func packageResolver = null; - private HashSet skipPackageIds = new HashSet(); - private Dictionary resolveCache = new Dictionary(); - private HashSet resolveCacheTemp = new HashSet(); - private Dictionary dependencyCount = new Dictionary(); - private HashSet visitedPackages = new HashSet(); - - - /// - /// [GET] Enumerates all packages that were visited in all walk operations - /// since the last . - /// - public IEnumerable VisitedPackages - { - get { return this.visitedPackages; } - } - - - public PackageDependencyWalker(Func packageResolver) - { - this.packageResolver = packageResolver; - } - - /// - /// Resets the algorithm and clears all previous results, as well as the - /// internal blacklist. - /// - public void Clear() - { - this.skipPackageIds.Clear(); - this.dependencyCount.Clear(); - this.visitedPackages.Clear(); - - // Clear temporary items from the resolve cache - foreach (PackageName name in this.resolveCacheTemp) - { - this.resolveCache.Remove(name); - } - this.resolveCacheTemp.Clear(); - } - - /// - /// Configures the algorithm to not visit packages with the specified ID while - /// exploring the graph. - /// - /// - public void IgnorePackage(string id) - { - if (this.skipPackageIds.Add(id)) - { - this.dependencyCount.Clear(); - this.visitedPackages.Clear(); - } - } - - /// - /// Walks the specified packages dependency graph and adds - /// new findings to the result list. - /// - /// - public void WalkGraph(PackageInfo package) - { - this.WalkGraph(new [] { package }); - } - /// - /// Walks the specified packages dependency graph and adds - /// new findings to the result list. - /// - /// - public void WalkGraph(PackageName packageName) - { - this.WalkGraph(new [] { packageName }); - } - /// - /// Walks the specified packages dependency graphs and adds - /// new findings to the result list. - /// - /// - public void WalkGraph(IEnumerable packages) - { - foreach (PackageInfo package in packages) - { - if (package == null) continue; - this.resolveCache[package.Name] = package; - } - - this.WalkGraph(packages.Select(p => p.Name)); - } - /// - /// Walks the specified packages dependency graphs and adds - /// new findings to the result list. - /// - /// - public void WalkGraph(IEnumerable packageNames) - { - // If there are no packages in the arguments that we didn't already - // walk before, do nothing. We already have the result. - bool anyNewInput = false; - foreach (PackageName packageName in packageNames) - { - if (this.dependencyCount.ContainsKey(packageName)) continue; - anyNewInput = true; - break; - } - if (!anyNewInput) return; - - // Determine the dependency graph of each package - foreach (PackageName packageName in packageNames) - { - PackageInfo package = this.ResolvePackage(packageName); - if (package == null) continue; - - VisitPackage(package); - } - } - - /// - /// Retrieves the transitive dependency count of the specified package. - /// - /// - /// - public int GetDependencyCount(PackageName name) - { - int count; - if (this.dependencyCount.TryGetValue(name, out count)) - return count; - else - return 0; - } - - private PackageInfo ResolvePackage(PackageName name) - { - PackageInfo package; - if (!this.resolveCache.TryGetValue(name, out package)) - { - // Resolve the dependency using the exact name first, then - // the newest version if that fails. - package = this.packageResolver(name); - if (package == null) - package = this.packageResolver(name.VersionInvariant); - - // Cache the results for later - this.resolveCache[name] = package; - - // If we resolved to a different version, remove that item - // from the cache on the next Clear to allow it to re-resolve - // differently in the future - if (package.Version != name.Version) - this.resolveCacheTemp.Add(name); - } - return package; - } - private void VisitPackage(PackageInfo package) - { - if (!this.visitedPackages.Add(package)) return; - - // Improve cyclic dependency handling by counting direct dependencies early - int count = package.Dependencies.Count; - this.dependencyCount[package.Name] = count; - - // Iterate over dependencies and count theirs as well - foreach (PackageName dependencyName in package.Dependencies) - { - // If this dependency is part of the set of skipped packages, skip it - if (this.skipPackageIds.Contains(dependencyName.Id)) continue; - - // Resolve the dependency name to get a hold on the actual info - PackageInfo dependency = this.ResolvePackage(dependencyName); - if (dependency == null) continue; - - // Add secondary dependencies - VisitPackage(dependency); - count += this.dependencyCount[dependency.Name]; - } - - // Update the previous count value - this.dependencyCount[package.Name] = count; - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageEventArgs.cs b/Source/Editor/DualityEditor/PackageManagement/PackageEventArgs.cs deleted file mode 100644 index 1832ef1a6..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageEventArgs.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Duality.Editor.PackageManagement -{ - public class PackageEventArgs : EventArgs - { - private PackageName packageName = PackageName.None; - - public PackageName PackageName - { - get { return this.packageName; } - } - public string Id - { - get { return this.packageName.Id; } - } - public Version Version - { - get { return this.packageName.Version; } - } - - public PackageEventArgs(PackageName package) - { - this.packageName = package; - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageInfo.cs b/Source/Editor/DualityEditor/PackageManagement/PackageInfo.cs deleted file mode 100644 index d599743ff..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageInfo.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Versioning; -using System.Text; - -namespace Duality.Editor.PackageManagement -{ - public class PackageInfo - { - private PackageName name = PackageName.None; - private string title = null; - private string summary = null; - private string description = null; - private string releaseNotes = null; - private bool requireLicense = false; - private Uri projectUrl = null; - private Uri licenseUrl = null; - private Uri iconUrl = null; - private int downloadCount = 0; - private DateTime publishDate = DateTime.MinValue; - private List authors = new List(); - private List tags = new List(); - private List dependencies = new List(); - - - public bool IsDualityPackage - { - get { return this.tags.Contains(PackageManager.DualityTag); } - } - public bool IsSamplePackage - { - get { return this.tags.Contains(PackageManager.SampleTag); } - } - public bool IsEditorPackage - { - get { return this.tags.Contains(PackageManager.EditorTag); } - } - public bool IsCorePackage - { - get { return this.tags.Contains(PackageManager.CoreTag); } - } - public PackageName Name - { - get { return this.name; } - } - public string Id - { - get { return this.name.Id; } - } - public Version Version - { - get { return this.name.Version; } - } - public string Title - { - get { return this.title; } - internal set { this.title = value; } - } - public string Summary - { - get { return this.summary; } - internal set { this.summary = value; } - } - public string Description - { - get { return this.description; } - internal set { this.description = value; } - } - public string ReleaseNotes - { - get { return this.releaseNotes; } - internal set { this.releaseNotes = value; } - } - public bool RequireLicenseAcceptance - { - get { return this.requireLicense; } - internal set { this.requireLicense = value; } - } - public Uri ProjectUrl - { - get { return this.projectUrl; } - internal set { this.projectUrl = value; } - } - public Uri LicenseUrl - { - get { return this.licenseUrl; } - internal set { this.licenseUrl = value; } - } - public Uri IconUrl - { - get { return this.iconUrl; } - internal set { this.iconUrl = value; } - } - public int DownloadCount - { - get { return this.downloadCount; } - internal set { this.downloadCount = value; } - } - public DateTime PublishDate - { - get { return this.publishDate; } - internal set { this.publishDate = value; } - } - public IReadOnlyList Authors - { - get { return this.authors; } - internal set - { - this.authors.Clear(); - if (value != null) this.authors.AddRange(value); - } - } - public IReadOnlyList Tags - { - get { return this.tags; } - internal set - { - this.tags.Clear(); - if (value != null) this.tags.AddRange(value); - } - } - public IReadOnlyList Dependencies - { - get { return this.dependencies; } - internal set - { - this.dependencies.Clear(); - if (value != null) this.dependencies.AddRange(value); - } - } - - - internal PackageInfo(PackageName package) - { - this.name = package; - } - internal PackageInfo(NuGet.IPackage nuGetPackage) - { - // Retrieve package data - this.name = new PackageName(nuGetPackage.Id, nuGetPackage.Version.Version); - this.title = nuGetPackage.Title; - this.summary = nuGetPackage.Summary; - this.description = nuGetPackage.Description; - this.releaseNotes = nuGetPackage.ReleaseNotes; - this.requireLicense = nuGetPackage.RequireLicenseAcceptance; - this.projectUrl = nuGetPackage.ProjectUrl; - this.licenseUrl = nuGetPackage.LicenseUrl; - this.iconUrl = nuGetPackage.IconUrl; - this.downloadCount = nuGetPackage.DownloadCount; - this.publishDate = nuGetPackage.Published.HasValue ? nuGetPackage.Published.Value.DateTime : DateTime.MinValue; - - if (nuGetPackage.Authors != null) - this.authors.AddRange(nuGetPackage.Authors); - if (nuGetPackage.Tags != null) - this.tags.AddRange(nuGetPackage.Tags.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)); - - // Retrieve the matching set of dependencies. - IEnumerable dependencySets = nuGetPackage.DependencySets; - if (dependencySets != null) - { - List availableTargetFrameworks = dependencySets.Select(item => item.TargetFramework).ToList(); - FrameworkName matchingTargetFramework = PackageManager.SelectBestFrameworkMatch(availableTargetFrameworks); - - NuGet.PackageDependencySet matchingDependencySet = dependencySets.FirstOrDefault(item => item.TargetFramework == matchingTargetFramework); - if (matchingDependencySet != null) - { - foreach (NuGet.PackageDependency dependency in matchingDependencySet.Dependencies) - { - if (dependency.VersionSpec != null && dependency.VersionSpec.MinVersion != null) - this.dependencies.Add(new PackageName(dependency.Id, dependency.VersionSpec.MinVersion.Version)); - else - this.dependencies.Add(new PackageName(dependency.Id, null)); - } - } - } - } - - public override string ToString() - { - return string.Format("Package Info '{0}'", this.name); - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageLicenseAgreementEventArgs.cs b/Source/Editor/DualityEditor/PackageManagement/PackageLicenseAgreementEventArgs.cs deleted file mode 100644 index aa6c16c40..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageLicenseAgreementEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Duality.Editor.PackageManagement -{ - public class PackageLicenseAgreementEventArgs : PackageEventArgs - { - private Uri licenseUrl = null; - private bool requireLicenseAcceptance = false; - private bool isLicenseAccepted = false; - - public Uri LicenseUrl - { - get { return this.licenseUrl; } - } - public bool RequireLicenseAcceptance - { - get { return this.requireLicenseAcceptance; } - } - public bool IsLicenseAccepted - { - get { return this.isLicenseAccepted; } - } - - public PackageLicenseAgreementEventArgs(PackageName package, Uri licenseUrl, bool requireAccept) : base(package) - { - this.licenseUrl = licenseUrl; - this.requireLicenseAcceptance = requireAccept; - } - - /// - /// Marks the license as accepted. Only ever call this when the end user has seen and explicitly accepted the license terms. - /// - public void AcceptLicense() - { - this.isLicenseAccepted = true; - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageManager.cs b/Source/Editor/DualityEditor/PackageManagement/PackageManager.cs deleted file mode 100644 index 96ce8b827..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageManager.cs +++ /dev/null @@ -1,1158 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using System.Windows.Forms; -using System.Diagnostics; -using System.Runtime.Versioning; - -using NuGet; - -using Duality.IO; -using Duality.Editor.Properties; -using Duality.Editor.Forms; -using Duality.Editor.PackageManagement.Internal; - -namespace Duality.Editor.PackageManagement -{ - /// - /// Allows to install, uninstall, update and query local and remote Duality packages. - /// - public class PackageManager - { - public const string DualityTag = "Duality"; - public const string PluginTag = "Plugin"; - public const string SampleTag = "Sample"; - public const string CoreTag = "Core"; - public const string EditorTag = "Editor"; - public const string LauncherTag = "Launcher"; - - /// - /// A list of package names that are considered "core" Duality packages. - /// If none of these show up anywhere in the deep dependency graph of a Duality package, - /// it will be assumed that dependencies are simply not specified properly. - /// - private static readonly string[] DualityPackageNames = new string[] - { - "AdamsLair.Duality", - "AdamsLair.Duality.Editor", - "AdamsLair.Duality.Launcher" - }; - - - private PackageSetup setup = new PackageSetup(); - private PackageManagerEnvironment env = null; - private PackageCache cache = null; - - private Dictionary licenseAccepted = new Dictionary(); - private List dependencyWalkerPool = new List(); - private object dependencyWalkerLock = new object(); - - private NuGetTargetedPackageManager manager = null; - private NuGet.IPackageRepository repository = null; - private PackageManagerLogger logger = null; - - public event EventHandler PackageLicenseAcceptRequired = null; - public event EventHandler PackageInstalled = null; - public event EventHandler PackageUninstalled = null; - - - /// - /// [GET] Whether the local and the actually installed packages - /// are currently out of sync. - /// - public bool IsPackageSyncRequired - { - get - { - IPackage[] allInstalledPackages = this.manager - .LocalRepository - .GetPackages() - .ToArray(); - - // Do we have installed packages that are not registered, i.e. need to be uninstalled? - foreach (IPackage package in allInstalledPackages) - { - if (!IsDualityPackage(package)) continue; - if (this.setup.GetPackage(package.Id, package.Version.Version) == null) - return true; - } - - // Do we have registered packages that are not installed or don't have a specific version? - // Also, are any of them not actually installed yet? - foreach (LocalPackage package in this.setup.Packages) - { - if (package.Id == null) return true; - if (package.Version == null) return true; - if (!allInstalledPackages.Any(n => - n.Id == package.Id && - n.Version == new SemanticVersion(package.Version))) - return true; - } - - return false; - } - } - /// - /// [GET] The local file system environment in which this operates. - /// - public PackageManagerEnvironment LocalEnvironment - { - get { return this.env; } - } - /// - /// [GET / SET] A data class representing the local package setup. Do not change these - /// values manually, but use API instead. - /// - public PackageSetup LocalSetup - { - get { return this.setup; } - } - - - public PackageManager() : this(new PackageManagerEnvironment(null)) { } - public PackageManager(string rootPath) : this(new PackageManagerEnvironment(rootPath)) { } - public PackageManager(PackageManagerEnvironment workEnvironment) : this(workEnvironment, null) { } - public PackageManager(PackageManagerEnvironment workEnvironment, PackageSetup packageSetup) - { - // If no external package setup is provided, load it from the config file - if (packageSetup == null) - { - string configFilePath = workEnvironment.ConfigFilePath; - if (!File.Exists(configFilePath)) - { - packageSetup = new PackageSetup(); - packageSetup.Save(configFilePath); - } - else - { - try - { - packageSetup = PackageSetup.Load(configFilePath); - } - catch (Exception e) - { - Logs.Editor.WriteError( - "Failed to load PackageManager config file '{0}': {1}", - configFilePath, - LogFormat.Exception(e)); - } - } - } - - // Assign work environment and package setup to work with - this.env = workEnvironment; - this.setup = packageSetup; - - // Create internal package management objects - IPackageRepository[] repositories = this.setup.RepositoryUrls - .Select(x => this.CreateRepository(x)) - .Where(x => x != null) - .ToArray(); - this.repository = new AggregateRepository(repositories); - this.manager = new NuGetTargetedPackageManager( - new FrameworkName(".NETFramework", new Version(4, 5, 2)), - this.repository, - this.env.RepositoryPath); - this.manager.PackageInstalling += this.manager_PackageInstalling; - this.manager.PackageInstalled += this.manager_PackageInstalled; - this.manager.PackageUninstalled += this.manager_PackageUninstalled; - this.cache = new PackageCache( - this.repository, - repositories.OfType().Any() || repositories.OfType().Any()); - - this.logger = new PackageManagerLogger(); - this.manager.Logger = this.logger; - - // Retrieve information about local packages - this.RetrieveLocalPackageInfo(); - } - - - /// - /// Installs the specified package if it wasn't installed yet and synchronizes - /// the registered Duality package version number with the one that is present - /// in the local cache. - /// - /// - public void VerifyPackage(LocalPackage localPackage) - { - Version oldPackageVersion = localPackage.Version; - - // Determine the exact version that will be installed - PackageInfo packageInfo = this.GetPackage(localPackage.Name); - if (packageInfo == null) - { - throw new Exception(string.Format( - "Can't resolve version of package '{0}'. There seems to be no compatible version available.", - localPackage.Id)); - } - - // Prepare a listener to determine whether we actually installed something - EventHandler installListener = null; - bool packageInstalled = false; - installListener = delegate(object sender, PackageOperationEventArgs args) - { - if (args.Package.Id == localPackage.Id) - { - packageInstalled = true; - } - }; - - // Install the package. Won't do anything if the package is already installed. - this.manager.PackageInstalled += installListener; - this.InstallPackage(localPackage.Name, true); - this.manager.PackageInstalled -= installListener; - - // If we didn't install anything, that package was already in the local repo. - // Update the local setup to match its specific version. - if (!packageInstalled && oldPackageVersion == null) - { - // Add the explicit version to the PackageConfig file - this.setup.Packages.RemoveAll(p => p.Id == packageInfo.Id); - this.setup.Packages.Add(new LocalPackage(packageInfo)); - } - - // In case we've just retrieved an explicit version for the first time, save the config file. - if (oldPackageVersion == null) - { - this.setup.Save(this.env.ConfigFilePath); - } - } - /// - /// Uninstalls all Duality packages that are installed, but not registered. This - /// usually happens when a user manually edits the package config file and either - /// removes package entries explicitly, or changes their version numbers. - /// - /// Due to the nature of this operation, it is possible that package dependencies - /// are removed even though they might still be required by some installed packages. - /// To make sure this state doesn't persist, it is recommended to perform a package - /// verification step afterwards, which will re-install dependencies that might have - /// been accidentally removed. - /// - public void UninstallNonRegisteredPackages() - { - IPackage[] allInstalledPackages = this.manager - .LocalRepository - .GetPackages() - .ToArray(); - LocalPackage[] registeredPackages = this.setup.Packages - .ToArray(); - - foreach (IPackage package in allInstalledPackages) - { - // Skip non-Duality packages. They're not registered anyway and not expected to. - if (!IsDualityPackage(package)) continue; - - // Skip packages that are registered in the exact same version - bool isRegistered = registeredPackages.Any(p => - p.Id == package.Id && - p.Version == package.Version.Version); - if (isRegistered) continue; - - // Uninstall all others with a force-uninstall. If we happen to remove - // a package that is actually still needed, an additional package verification - // step afterwards will fix this. - this.UninstallPackage( - new PackageName(package.Id, package.Version.Version), - true); - } - } - - /// - /// Installs the specified package. - /// - /// - public void InstallPackage(PackageName packageName) - { - this.InstallPackage(packageName, false); - } - private void InstallPackage(PackageName packageName, bool skipLicense) - { - NuGet.IPackage installPackage = this.cache.GetNuGetPackage(packageName); - if (installPackage == null) - { - throw new InvalidOperationException(string.Format( - "Unable to install package '{0}', because no matching package could be found.", - packageName)); - } - - // Check license terms - if (!skipLicense && !this.CheckDeepLicenseAgreements(installPackage)) - { - return; - } - - Logs.Editor.Write("Installing package '{0}'...", packageName); - Logs.Editor.PushIndent(); - try - { - // Request NuGet to install the package - this.manager.InstallPackage(installPackage, false, false); - } - finally - { - Logs.Editor.PopIndent(); - } - } - /// - /// Uninstalls the specified package. - /// - /// - public void UninstallPackage(PackageName packageName) - { - this.UninstallPackage(packageName, false); - } - private void UninstallPackage(PackageName packageName, bool force) - { - Logs.Editor.Write("Uninstalling package '{0}'...", packageName); - Logs.Editor.PushIndent(); - try - { - // Find the local package that we'll uninstall - NuGet.IPackage uninstallPackage = this.manager.LocalRepository - .FindPackagesById(packageName.Id) - .FirstOrDefault(p => p.Version.Version == packageName.Version); - if (uninstallPackage == null) return; - - // Find all dependencies of the package we want to uninstall - PackageName uninstallPackageName = new PackageName(uninstallPackage.Id, uninstallPackage.Version.Version); - PackageInfo uninstallPackageInfo = this.GetPackage(uninstallPackageName); - List uninstallDependencies = new List(); - if (uninstallPackageInfo != null) - { - PackageDependencyWalker dependencyWalker = this.RentDependencyWalker(); - dependencyWalker.IgnorePackage("NETStandard.Library"); // Avoid dependency explosion, treat as opaque - dependencyWalker.WalkGraph(uninstallPackageInfo); - uninstallDependencies.AddRange(dependencyWalker.VisitedPackages); - uninstallDependencies.RemoveAll(package => package.Id == uninstallPackageInfo.Id); - this.ReturnDependencyWalker(ref dependencyWalker); - } - - // Filter out all dependencies that are used by other Duality packages - foreach (LocalPackage otherPackage in this.LocalSetup.Packages) - { - if (otherPackage.Id == uninstallPackage.Id) continue; - - PackageInfo otherPackageInfo = otherPackage.Info ?? this.GetPackage(otherPackage.Name); - if (otherPackageInfo == null) continue; - - PackageDependencyWalker dependencyWalker = this.RentDependencyWalker(); - dependencyWalker.IgnorePackage(uninstallPackage.Id); - dependencyWalker.IgnorePackage("NETStandard.Library"); // Avoid dependency explosion, treat as opaque - dependencyWalker.WalkGraph(otherPackageInfo); - foreach (PackageInfo dependency in dependencyWalker.VisitedPackages) - { - // Don't check versions, as dependencies are usually not resolved - // with an exact version match. - uninstallDependencies.RemoveAll(item => item.Id == dependency.Id); - } - this.ReturnDependencyWalker(ref dependencyWalker); - } - - // Uninstall the package itself - this.manager.UninstallPackage( - uninstallPackage, - force); - - // Uninstall its dependencies that are no longer used, in reverse dependency order - // to avoid stumbling over dependencies that they might have between each other. - this.OrderByDependencies(uninstallDependencies); - uninstallDependencies.Reverse(); - foreach (PackageInfo package in uninstallDependencies) - { - List matchingNuGetPackages = this.manager.LocalRepository - .FindPackagesById(package.Id) - .ToList(); - - foreach (NuGet.IPackage nugetPackage in matchingNuGetPackages) - { - this.manager.UninstallPackage(nugetPackage, force, false); - } - } - } - finally - { - Logs.Editor.PopIndent(); - } - } - /// - /// Determines whether the specified package can be uninstalled. Returns - /// false when other packages still depend on it. - /// - /// - /// - [DebuggerNonUserCode] - public bool CanUninstallPackage(PackageName packageName) - { - NuGet.IPackage uninstallPackage = this.manager.LocalRepository - .FindPackagesById(packageName.Id) - .FirstOrDefault(p => p.Version.Version == packageName.Version); - if (uninstallPackage == null) return false; - - bool allowed = true; - this.manager.WhatIf = true; - this.manager.Logger = null; - try - { - this.manager.UninstallPackage( - uninstallPackage, - false, - true); - } - catch (Exception) - { - allowed = false; - } - this.manager.Logger = this.logger; - this.manager.WhatIf = false; - return allowed; - } - /// - /// Updates the specified package to the latest available version. - /// - /// - public void UpdatePackage(PackageName packageName) - { - if (!this.manager.LocalRepository.FindPackagesById(packageName.Id).Any()) - { - throw new InvalidOperationException(string.Format( - "Can't update package '{0}', because it is not installed.", - packageName)); - } - - NuGet.IPackage latestPackage = this.cache.GetNuGetPackage(packageName.VersionInvariant); - if (latestPackage == null) - { - throw new InvalidOperationException(string.Format( - "Unable to update package '{0}', because no matching package could be found.", - packageName)); - } - - // Check license terms - if (!this.CheckDeepLicenseAgreements(latestPackage)) - { - return; - } - - Logs.Editor.Write("Updating package '{0}'...", packageName); - Logs.Editor.PushIndent(); - try - { - this.manager.UpdatePackage(latestPackage, true, false); - } - finally - { - Logs.Editor.PopIndent(); - } - } - - /// - /// Starts applying any pending package updates and returns true when it is required - /// to shut down the current editor instance in order to complete them. - /// - /// - /// Whether the current editor instance should be restarted after the update has been applied. - /// - /// - public bool ApplyUpdate(bool restartEditor = true) - { - if (!File.Exists(this.env.UpdateFilePath)) return false; - - Logs.Editor.Write("Applying package update..."); - Logs.Editor.PushIndent(); - try - { - // Manually perform update operations on the updater itself - try - { - Logs.Editor.Write("Preparing updater..."); - PackageUpdateSchedule schedule = this.PrepareUpdateSchedule(); - schedule.ApplyUpdaterChanges(this.env.UpdaterExecFilePath); - this.SaveUpdateSchedule(schedule); - } - catch (Exception e) - { - Logs.Editor.WriteError( - "Can't update '{0}', because an error occurred: {1}", - this.env.UpdaterExecFilePath, - LogFormat.Exception(e)); - return false; - } - - // Run the updater application - Logs.Editor.Write("Running updater..."); - Process.Start(this.env.UpdaterExecFilePath, string.Format("\"{0}\" \"{1}\" \"{2}\"", - this.env.UpdateFilePath, - restartEditor ? typeof(DualityEditorApp).Assembly.Location : "", - restartEditor ? Environment.CurrentDirectory : "")); - } - finally - { - Logs.Editor.PopIndent(); - } - - return true; - } - - /// - /// Clears the internal cache for remote repository packages, allowing - /// to retrieve updated information about the latest available packages - /// and package versions. - /// - public void ClearCache() - { - this.cache.Clear(); - } - /// - /// Enumerates the latest versions of all available Duality packages from - /// the remote repository. - /// - /// - public IEnumerable GetLatestDualityPackages() - { - return this.cache.GetLatestDualityPackages(); - } - /// - /// Retrieves detailed information about the specified package from the - /// local or remote repository. - /// - /// - /// - public PackageInfo GetPackage(PackageName name) - { - return this.cache.GetPackage(name); - } - - /// - /// Enumerates all target packages for local installs that could be updated. - /// - /// - public IEnumerable GetUpdatablePackages() - { - List updatePackages = new List(); - LocalPackage[] targetPackages = this.setup.Packages.ToArray(); - for (int i = 0; i < targetPackages.Length; i++) - { - PackageInfo update = this.GetPackage(targetPackages[i].Name.VersionInvariant); - if (update.Version <= targetPackages[i].Version) continue; - updatePackages.Add(update); - } - return updatePackages; - } - /// - /// Determines compatibility between the current package installs and the specified target package. - /// Works for both updates and new installs. - /// - /// - /// - public PackageCompatibility GetCompatibilityLevel(PackageInfo target) - { - // If the target package is already installed in the matching version, assume compatibility - if (this.setup.GetPackage(target.Id, target.Version) != null) - return PackageCompatibility.Definite; - - // Determine all packages that might be updated or installed - PackageDependencyWalker dependencyWalker = this.RentDependencyWalker(); - dependencyWalker.IgnorePackage("NETStandard.Library"); // Avoid dependency explosion, doesn't matter for Duality compatibility anyway - dependencyWalker.WalkGraph(target); - List touchedPackages = dependencyWalker.VisitedPackages.ToList(); - this.ReturnDependencyWalker(ref dependencyWalker); - - // Verify properly specified dependencies for Duality packages - if (target.IsDualityPackage) - { - // If none of the targets deep dependencies is anyhow related to Duality, assume they're incomplete and potentially incompatible - bool anyDualityDependency = false; - foreach (PackageInfo package in touchedPackages) - { - if (DualityPackageNames.Any(name => string.Equals(name, package.Id))) - { - anyDualityDependency = true; - break; - } - } - if (!anyDualityDependency) - return PackageCompatibility.None; - } - - // Generate a mapping to already installed packages - Dictionary localMap = new Dictionary(); - foreach (PackageInfo package in touchedPackages) - { - LocalPackage local = this.setup.GetPackage(package.Id); - if (local == null) continue; - - localMap.Add(package, local); - } - - // Determine the maximum version difference between target and installed - PackageCompatibility compatibility = PackageCompatibility.Definite; - foreach (var pair in localMap) - { - Version targetVersion = pair.Key.Version; - Version localVersion = pair.Value.Version; - - if (localVersion.Major != targetVersion.Major) - compatibility = compatibility.Combine(PackageCompatibility.Unlikely); - else if (localVersion.Minor != targetVersion.Minor) - compatibility = compatibility.Combine(PackageCompatibility.Likely); - } - - return compatibility; - } - - /// - /// Sorts the specified list of packages according to their dependencies, guaranteeing that no package - /// is listed before its dependencies. Use this to determine the order of batch updates and installs - /// to prevent conflicts from having different versions of the same packages. - /// - public void OrderByDependencies(IList packages) - { - if (packages.Count < 2) return; - - // Determine the number of deep dependencies for each package - PackageDependencyWalker dependencyWalker = this.RentDependencyWalker(); - dependencyWalker.IgnorePackage("NETStandard.Library"); // Avoid dependency explosion, treat as opaque - dependencyWalker.WalkGraph(packages); - - // Sort packages according to their deep dependency counts - packages.StableSort((a, b) => - { - int countA = (a == null) ? 0 : dependencyWalker.GetDependencyCount(a.Name); - int countB = (b == null) ? 0 : dependencyWalker.GetDependencyCount(b.Name); - return countA - countB; - }); - - this.ReturnDependencyWalker(ref dependencyWalker); - } - /// - /// Sorts the specified list of packages according to their dependencies, guaranteeing that no package - /// is listed before its dependencies. Use this to determine the order of batch updates and installs - /// to prevent conflicts from having different versions of the same packages. - /// - public void OrderByDependencies(IList packages) - { - // Map each list entry to its PackageInfo - PackageInfo[] localInfo = packages - .Select(p => p.Info ?? this.GetPackage(p.Name)) - .NotNull() - .ToArray(); - - // Sort the mapped list - this.OrderByDependencies(localInfo); - - // Now sort the original list to match the sorted mapped list - LocalPackage[] originalPackages = packages.ToArray(); - int nonSortedCount = 0; - for (int i = 0; i < originalPackages.Length; i++) - { - LocalPackage localPackage = originalPackages[i]; - - int newIndex = localInfo.IndexOfFirst(p => p.Id == localPackage.Id && p.Version == localPackage.Version); - if (newIndex == -1) - newIndex = localInfo.IndexOfFirst(p => p.Id == localPackage.Id); - - // Unresolved packages are always last in the sorted list - if (newIndex == -1) - { - newIndex = packages.Count - nonSortedCount - 1; - nonSortedCount++; - } - - packages[newIndex] = localPackage; - } - } - - private void RetrieveLocalPackageInfo() - { - foreach (LocalPackage setupItem in this.setup.Packages) - { - if (setupItem.Version == null) continue; - if (string.IsNullOrEmpty(setupItem.Id)) continue; - - foreach (NuGet.IPackage localPackage in this.manager.LocalRepository.FindPackagesById(setupItem.Id)) - { - if (localPackage.Version.Version != setupItem.Version) continue; - - setupItem.Info = new PackageInfo(localPackage); - break; - } - } - } - private IPackageRepository CreateRepository(string repositoryUrl) - { - if (string.IsNullOrWhiteSpace(repositoryUrl)) - return null; - - try - { - string schemeName = null; - if (repositoryUrl.Contains(Uri.SchemeDelimiter)) - { - schemeName = repositoryUrl.Split(new[] { Uri.SchemeDelimiter }, StringSplitOptions.RemoveEmptyEntries)[0]; - } - - if (schemeName != null && Uri.CheckSchemeName(schemeName)) - repositoryUrl = new Uri(repositoryUrl).AbsoluteUri; - else - repositoryUrl = Path.GetFullPath(Path.Combine(this.env.RootPath, repositoryUrl)); - } - catch (UriFormatException) - { - Logs.Editor.WriteError("NuGet repository URI '{0}' has an incorrect format and will be skipped.", repositoryUrl); - return null; - } - - return PackageRepositoryFactory.Default.CreateRepository(repositoryUrl); - } - - /// - /// Rents a pooled instance, or allocates a new one when required. - /// Not returning a rented instance will harm efficiency, but not cause a leak. - /// - /// - private PackageDependencyWalker RentDependencyWalker() - { - lock (this.dependencyWalkerLock) - { - if (this.dependencyWalkerPool.Count == 0) - { - return new PackageDependencyWalker(this.GetPackage); - } - else - { - int lastWalkerIndex = this.dependencyWalkerPool.Count - 1; - PackageDependencyWalker walker = this.dependencyWalkerPool[lastWalkerIndex]; - this.dependencyWalkerPool.RemoveAt(lastWalkerIndex); - return walker; - } - } - } - /// - /// Returns a previously rented instance, and nullifies the - /// provided reference to it afterwards to avoid further use. - /// - /// - private void ReturnDependencyWalker(ref PackageDependencyWalker walker) - { - walker.Clear(); - lock (this.dependencyWalkerLock) - { - this.dependencyWalkerPool.Add(walker); - walker = null; - } - } - - private bool CheckDeepLicenseAgreements(NuGet.IPackage package) - { - PackageDependencyWalker dependencyWalker = this.RentDependencyWalker(); - dependencyWalker.IgnorePackage("NETStandard.Library"); // Avoid dependency explosion, doesn't require license acceptance anyway - dependencyWalker.WalkGraph(new PackageName(package.Id, package.Version.Version)); - - List packageGraph = dependencyWalker.VisitedPackages.ToList(); - List installedPackages = this.manager.LocalRepository.GetPackages().ToList(); - - this.ReturnDependencyWalker(ref dependencyWalker); - - foreach (PackageInfo visitedPackage in packageGraph) - { - // Skip the ones that are already installed - if (installedPackages.Any(installed => - installed.Id == visitedPackage.Id && - installed.Version.Version >= visitedPackage.Version)) - continue; - - if (!this.CheckLicenseAgreement(visitedPackage)) - return false; - } - - return true; - } - private bool CheckLicenseAgreement(PackageInfo package) - { - if (package.RequireLicenseAcceptance) - { - // On the very first install, do not display additional license agreement dialogs - // because all the packages being installed are the default ones. - if (this.setup.IsFirstInstall) - return true; - - bool agreed; - if (!this.licenseAccepted.TryGetValue(package.Name, out agreed) || !agreed) - { - PackageLicenseAgreementEventArgs args = new PackageLicenseAgreementEventArgs( - package.Name, - package.LicenseUrl, - package.RequireLicenseAcceptance); - - if (this.PackageLicenseAcceptRequired != null) - this.PackageLicenseAcceptRequired(this, args); - else - DisplayDefaultLicenseAcceptDialog(args); - - agreed = args.IsLicenseAccepted; - this.licenseAccepted[package.Name] = agreed; - } - - if (!agreed) - { - return false; - } - } - - return true; - } - - private PackageUpdateSchedule PrepareUpdateSchedule() - { - // Load existing update schedule in order to extend it - string updateFilePath = this.env.UpdateFilePath; - PackageUpdateSchedule updateSchedule = null; - if (File.Exists(updateFilePath)) - { - try - { - updateSchedule = PackageUpdateSchedule.Load(updateFilePath); - } - catch (Exception exception) - { - updateSchedule = null; - Logs.Editor.WriteError("Error parsing existing package update schedule '{0}': {1}", - Path.GetFileName(updateFilePath), - LogFormat.Exception(exception)); - } - } - - // If none existed yet, create a fresh update schedule - if (updateSchedule == null) - updateSchedule = new PackageUpdateSchedule(); - - return updateSchedule; - } - private void SaveUpdateSchedule(PackageUpdateSchedule schedule) - { - string updateFilePath = this.env.UpdateFilePath; - schedule.Save(updateFilePath); - } - - private Dictionary CreateFileMapping(NuGet.IPackage package) - { - Dictionary fileMapping = new Dictionary(); - - bool isDualityPackage = IsDualityPackage(package); - bool isPluginPackage = isDualityPackage && package.Tags.Contains(PluginTag); - - string folderFriendlyPackageName = package.Id; - string binaryBaseDir = this.env.TargetPluginPath; - string contentBaseDir = this.env.TargetDataPath; - string sourceBaseDir = Path.Combine(this.env.TargetSourcePath, folderFriendlyPackageName); - if (!isPluginPackage || !isDualityPackage) - { - binaryBaseDir = this.env.RootPath; - contentBaseDir = this.env.RootPath; - } - - List applicableFiles = new List(); - try - { - // Separate package files in to framework-dependent lib files and framework-independent - // non-lib files. Those include content and source files, but also any other folder structure - // that isn't specifically a lib binary. - List files = package.GetFiles().ToList(); - List libFiles = new List(); - List nonLibFiles = new List(); - foreach (IPackageFile file in files) - { - string path = file.Path.Replace('/', '\\'); - bool isLibFile = path.StartsWith("lib\\"); - if (isLibFile) - libFiles.Add(file); - else - nonLibFiles.Add(file); - } - List applicableLibFiles = new List(); - - // Determine which frameworks are available in this package. - // Note that due to the NuGet version we're using, .NETStandard target frameworks - // are unknown and will be returned as "Unsupported, Version 0.0". - List availableFrameworks = libFiles.Select(f => f.TargetFramework).Distinct().ToList(); - - // Select the closest matching framework this package has and use all of its files, - // and none of the others - FrameworkName matchingFramework = SelectBestFrameworkMatch(availableFrameworks); - applicableLibFiles.AddRange(libFiles.Where(f => f.TargetFramework == matchingFramework)); - - // Check if we have files without a target framework that do not have an equivalent - // in the files from the selected match. To support legacy packages, we'll use them - // as a fallback. Packages that do this are for example AdamsLair.OpenTK, AdamsLair.WinForms - // and others which have a set of explicit root files and a subset of implicit framework files. - if (matchingFramework != null) - { - List rootFiles = libFiles.Where(f => f.TargetFramework == null).ToList(); - foreach (IPackageFile file in rootFiles) - { - string fileName = Path.GetFileName(file.Path); - bool hasOverride = applicableLibFiles.Any(f => Path.GetFileName(f.Path) == fileName); - if (!hasOverride) - { - applicableLibFiles.Add(file); - } - } - } - - // Non-lib files (content, source) are treated differently and used as-is, since they are - // not dependent on any target framework and just carried over. - applicableFiles.AddRange(applicableLibFiles); - applicableFiles.AddRange(nonLibFiles); - } - catch (DirectoryNotFoundException) - { - // We'll run into this exception when uninstalling a package without any files. - return fileMapping; - } - - foreach (IPackageFile f in applicableFiles) - { - // Determine where the file needs to go - string targetPath = f.EffectivePath; - string baseDir = f.Path; - while (baseDir.Contains(Path.DirectorySeparatorChar) || baseDir.Contains(Path.AltDirectorySeparatorChar)) - { - baseDir = Path.GetDirectoryName(baseDir); - } - if (string.Equals(baseDir, "lib", StringComparison.InvariantCultureIgnoreCase)) - targetPath = Path.Combine(binaryBaseDir, targetPath); - else if (string.Equals(baseDir, "content", StringComparison.InvariantCultureIgnoreCase)) - targetPath = Path.Combine(contentBaseDir, targetPath); - else if (string.Equals(baseDir, "source", StringComparison.InvariantCultureIgnoreCase)) - { - if (targetPath.StartsWith("source") && targetPath.Length > "source".Length) - targetPath = targetPath.Remove(0, "source".Length + 1); - targetPath = Path.Combine(sourceBaseDir, targetPath); - } - else - continue; - - // Add a file mapping entry linking target path to package path - if (fileMapping.ContainsKey(targetPath)) continue; - fileMapping[targetPath] = f.Path; - } - - return fileMapping; - } - - private void OnPackageInstalled(PackageEventArgs args) - { - if (this.PackageInstalled != null) - this.PackageInstalled(this, args); - } - private void OnPackageUninstalled(PackageEventArgs args) - { - if (this.PackageUninstalled != null) - this.PackageUninstalled(this, args); - } - - private void manager_PackageUninstalled(object sender, PackageOperationEventArgs e) - { - Logs.Editor.Write("Integrating uninstall of package '{0} {1}'...", e.Package.Id, e.Package.Version); - - // Determine all files that are referenced by a package, and the ones referenced by this one - IEnumerable localFiles = this.CreateFileMapping(e.Package).Select(p => p.Key); - - // Schedule files for removal - PackageUpdateSchedule updateSchedule = this.PrepareUpdateSchedule(); - foreach (string packageFile in localFiles) - { - // Don't remove any file that is still referenced by a local package - bool stillInUse = false; - foreach (NuGet.IPackage localNugetPackage in this.manager.LocalRepository.GetPackages()) - { - Dictionary localMapping = this.CreateFileMapping(localNugetPackage); - if (localMapping.Any(p => PathHelper.Equals(p.Key, packageFile))) - { - stillInUse = true; - break; - } - } - if (stillInUse) continue; - - // Append the scheduled operation to the updater config file. - updateSchedule.AppendDeleteFile(packageFile); - if (Path.GetExtension(packageFile) == ".csproj") - { - updateSchedule.AppendSeparateProject( - packageFile, - this.env.TargetSolutionPathRelative); - } - } - this.SaveUpdateSchedule(updateSchedule); - - // Update local package configuration file - PackageName packageName = new PackageName(e.Package.Id, e.Package.Version.Version); - this.setup.Packages.RemoveAll(p => p.Name == packageName); - this.setup.Save(this.env.ConfigFilePath); - - this.OnPackageUninstalled(new PackageEventArgs(new PackageName(e.Package.Id, e.Package.Version.Version))); - } - private void manager_PackageInstalling(object sender, PackageOperationEventArgs e) - { - // Duality does, by design, not support multiple versions of the same package to be - // installed at the same time. Enforce this constraint by double-checking every install - // for already installed versions of the same package. - List previousPackages = this.manager.LocalRepository - .FindPackagesById(e.Package.Id) - .ToList(); - foreach (NuGet.IPackage package in previousPackages) - { - // Installing a newer version? Make sure to uninstall any older versions of it. - if (package.Version < e.Package.Version) - { - this.manager.UninstallPackage( - package, - true, - false); - } - // Installing an older version? Cancel the operation. We'll prefer the newer - // version and if a downgrade is really desired, it should be done by explicitly - // uninstalling the newer package first. - else if (package.Version > e.Package.Version) - { - e.Cancel = true; - } - } - } - private void manager_PackageInstalled(object sender, PackageOperationEventArgs e) - { - Logs.Editor.Write("Integrating install of package '{0} {1}'...", e.Package.Id, e.Package.Version); - - // Update package entries from local config - PackageInfo packageInfo = this.GetPackage(new PackageName(e.Package.Id, e.Package.Version.Version)); - if (packageInfo.IsDualityPackage) - { - this.setup.Packages.RemoveAll(p => p.Id == e.Package.Id); - this.setup.Packages.Add(new LocalPackage(packageInfo)); - this.setup.Save(this.env.ConfigFilePath); - } - - // Schedule files for updating / copying - PackageUpdateSchedule updateSchedule = this.PrepareUpdateSchedule(); - Dictionary fileMapping = this.CreateFileMapping(e.Package); - foreach (var pair in fileMapping) - { - // Don't overwrite files from a newer version of this package with their old one (think of dependencies) - bool isOldVersion = false; - foreach (NuGet.IPackage localNugetPackage in this.manager.LocalRepository.GetPackages()) - { - if (localNugetPackage.Id != e.Package.Id) continue; - - Dictionary localMapping = this.CreateFileMapping(localNugetPackage); - if (localMapping.Any(p => string.Equals(p.Value, pair.Value, StringComparison.InvariantCultureIgnoreCase))) - { - if (localNugetPackage.Version > e.Package.Version) - { - isOldVersion = true; - break; - } - } - } - if (isOldVersion) continue; - - // Append the scheduled operation to the updater config file. - updateSchedule.AppendCopyFile(Path.Combine(e.InstallPath, pair.Value), pair.Key); - if (Path.GetExtension(pair.Key) == ".csproj") - { - updateSchedule.AppendIntegrateProject( - pair.Key, - this.env.TargetSolutionPathRelative, - this.env.TargetPluginPathRelative); - } - } - this.SaveUpdateSchedule(updateSchedule); - - this.OnPackageInstalled(new PackageEventArgs(new PackageName(e.Package.Id, e.Package.Version.Version))); - } - - private static bool IsDualityPackage(NuGet.IPackage package) - { - return - package.Tags != null && - package.Tags.Contains(DualityTag); - } - private static void DisplayDefaultLicenseAcceptDialog(PackageLicenseAgreementEventArgs args) - { - LicenseAcceptDialog licenseDialog = new LicenseAcceptDialog - { - DescriptionText = string.Format(GeneralRes.LicenseAcceptDialog_PackageDesc, args.PackageName), - LicenseUrl = args.LicenseUrl - }; - - Form invokeForm = DualityEditorApp.MainForm ?? Application.OpenForms.OfType
().FirstOrDefault(); - DialogResult result = invokeForm.InvokeEx(main => licenseDialog.ShowDialog()); - if (result == DialogResult.OK) - { - args.AcceptLicense(); - } - } - - /// - /// From the given list of target frameworks, this methods selects the one that best matches - /// the one we want for installed packages. - /// - /// - /// - internal static FrameworkName SelectBestFrameworkMatch(List frameworks) - { - int highestScore = -1; - FrameworkName bestMatch = null; - foreach (FrameworkName framework in frameworks) - { - int score = GetFrameworkMatchScore(framework); - if (score > highestScore) - { - highestScore = score; - bestMatch = framework; - } - } - return bestMatch; - } - /// - /// Determines a score value for the given target framework representing how well it - /// matches the one we want for installed packages. - /// - /// - /// - private static int GetFrameworkMatchScore(FrameworkName framework) - { - // A null framework is a valid value, as it represents NuGet package files - // that are not associated with any specific target framework. For legacy - // reasons, we score them slightly higher than defined, but completely unknown - // frameworks. - if (framework == null) return 1; - - // Since the context of our package selection is editor and desktop deployment - // we'll prefer .NET Framework 4.5 binaries over others. - switch (framework.Identifier) - { - case ".NETPortable": - if (framework.Profile == "net45+win8+wpa81") // Profile 111 - return 50; - else if (framework.Profile.Contains("net45")) - return 49; - else if (framework.Profile.Contains("net40")) - return 48; - else - return 40; - case ".NETFramework": - if (framework.Version == new Version(4, 5)) - return 100; - else if (framework.Version < new Version(4, 5)) - return 90; - else - return 80; - default: - return 0; - } - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageManagerEnvironment.cs b/Source/Editor/DualityEditor/PackageManagement/PackageManagerEnvironment.cs deleted file mode 100644 index c11b44cd7..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageManagerEnvironment.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Xml; -using System.Xml.Linq; -using System.Windows.Forms; -using System.Diagnostics; - -using NuGet; - -using Duality.IO; -using Duality.Editor.Properties; -using Duality.Editor.Forms; - -namespace Duality.Editor.PackageManagement -{ - /// - /// Describes the local working environment of a . - /// - public class PackageManagerEnvironment - { - private string rootPath = null; - private string targetDataPath = null; - private string targetSourcePath = null; - private string targetPluginPath = null; - private string localRepoPath = null; - private string configFilePath = null; - private string updateFilePath = null; - private string updaterExecFilePath = null; - - - /// - /// [GET] The root path to work in, which is usually the Duality project folder. - /// - public string RootPath - { - get { return this.rootPath; } - } - /// - /// [GET] The path where package contents are copied to after installation. - /// - public string TargetDataPath - { - get { return this.targetDataPath; } - } - /// - /// [GET] The path where source code package contents are copied to after installation. - /// - public string TargetSourcePath - { - get { return this.targetSourcePath; } - } - /// - /// [GET] The path where plugin package contents are copied to after installation. - /// - public string TargetPluginPath - { - get { return this.targetPluginPath; } - } - /// - /// [GET] The path of the local package repository where packages will be installed to by NuGet. - /// After NuGet completed its installation, Duality will take care of copying each file to - /// its intended destination. - /// - public string RepositoryPath - { - get { return this.localRepoPath; } - } - /// - /// [GET] The path where the local config file is located. - /// - public string ConfigFilePath - { - get { return this.configFilePath; } - } - /// - /// [GET] The path where the file is located. - /// - public string UpdateFilePath - { - get { return this.updateFilePath; } - } - /// - /// [GET] The path of the binary that will be executed in order to apply a pending - /// update as scheduled in the at the . - /// - public string UpdaterExecFilePath - { - get { return this.updaterExecFilePath; } - } - - /// - /// [GET] The (-)relative path where plugin package contents are copied to after installation. - /// See for a non-relative version. - /// - public string TargetPluginPathRelative - { - get { return DualityApp.PluginDirectory; } - } - /// - /// [GET] The (-)relative path of the source code solution file where source code - /// project files from packages will be integrated after installation. - /// - public string TargetSolutionPathRelative - { - get { return EditorHelper.SourceCodeSolutionFilePath; } - } - - - public PackageManagerEnvironment(string rootPath) - { - this.rootPath = rootPath ?? string.Empty; - this.UpdateFromRootPath(); - } - - private void UpdateFromRootPath() - { - this.targetDataPath = Path.Combine(this.rootPath, DualityApp.DataDirectory); - this.targetSourcePath = Path.Combine(this.rootPath, EditorHelper.SourceCodeDirectory); - this.targetPluginPath = Path.Combine(this.rootPath, this.TargetPluginPathRelative); - this.localRepoPath = Path.Combine(this.rootPath, EditorHelper.SourceDirectory + @"\Packages"); - this.configFilePath = Path.Combine(this.rootPath, "PackageConfig.xml"); - this.updateFilePath = Path.Combine(this.rootPath, "ApplyUpdate.xml"); - this.updaterExecFilePath = Path.Combine(this.rootPath, "DualityUpdater.exe"); - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageManagerLogger.cs b/Source/Editor/DualityEditor/PackageManagement/PackageManagerLogger.cs deleted file mode 100644 index 464007ff0..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageManagerLogger.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Xml; -using System.Xml.Linq; -using System.Windows.Forms; -using System.Diagnostics; - -using Duality.IO; -using Duality.Editor.Properties; -using Duality.Editor.Forms; - -namespace Duality.Editor.PackageManagement -{ - internal class PackageManagerLogger : NuGet.ILogger - { - void NuGet.ILogger.Log(NuGet.MessageLevel level, string message, params object[] args) - { - switch (level) - { - case NuGet.MessageLevel.Debug: - #if DEBUG - Logs.Editor.Write(message, args); - #endif - break; - default: - case NuGet.MessageLevel.Info: - Logs.Editor.Write(message, args); - break; - case NuGet.MessageLevel.Warning: - Logs.Editor.WriteWarning(message, args); - break; - case NuGet.MessageLevel.Error: - Logs.Editor.WriteError(message, args); - break; - } - } - NuGet.FileConflictResolution NuGet.IFileConflictResolver.ResolveFileConflict(string message) - { - Logs.Editor.Write("Package File Conflict: {0}", message); - return NuGet.FileConflictResolution.Overwrite; - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageName.cs b/Source/Editor/DualityEditor/PackageManagement/PackageName.cs deleted file mode 100644 index b35212ab2..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageName.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Duality.Editor.PackageManagement -{ - public struct PackageName : IEquatable - { - public static readonly PackageName None = new PackageName(null, null); - - public string Id; - public Version Version; - - public PackageName VersionInvariant - { - get { return new PackageName(this.Id); } - } - - public PackageName(string id) - { - this.Id = id; - this.Version = null; - } - public PackageName(string id, Version version) - { - this.Id = id; - this.Version = version; - } - - public bool Equals(PackageName other) - { - return - this.Id == other.Id && - this.Version == other.Version; - } - public override bool Equals(object obj) - { - if (obj is PackageName) - return this.Equals((PackageName)obj); - else - return false; - } - public override int GetHashCode() - { - unchecked - { - int hashCode = (this.Id ?? string.Empty).GetHashCode(); - if (this.Version != null) - { - hashCode = 1019 * hashCode + this.Version.Major; - hashCode = 1021 * hashCode + this.Version.Minor; - hashCode = 1031 * hashCode + this.Version.Revision; - hashCode = 1033 * hashCode + this.Version.Build; - } - return hashCode; - } - } - public override string ToString() - { - return string.Format("{0} {1}", this.Id, this.Version); - } - - public static bool operator == (PackageName a, PackageName b) - { - return a.Equals(b); - } - public static bool operator != (PackageName a, PackageName b) - { - return !a.Equals(b); - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageSetup.cs b/Source/Editor/DualityEditor/PackageManagement/PackageSetup.cs deleted file mode 100644 index 6ee350c05..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageSetup.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Xml; -using System.Xml.Linq; -using System.Windows.Forms; -using System.Diagnostics; - -using NuGet; - -using Duality.IO; -using Duality.Editor.Properties; -using Duality.Editor.Forms; - -namespace Duality.Editor.PackageManagement -{ - /// - /// Describes the package setup that is required by a Duality project, including - /// repository URLs, package Ids and versions. It is a data representation of what's - /// usually stored in the package config file. - /// - public class PackageSetup - { - private const string DefaultRepositoryUrl = @"https://packages.nuget.org/api/v2"; - - private List repositoryUrls = new List{ DefaultRepositoryUrl }; - private bool firstInstall = false; - private List localPackages = new List(); - - - /// - /// [GET] A list of URLs to remote package repositories that will be used to pull packages from. - /// For convenience reasons, it is allowed to specify regular file paths instead of URLs when referring - /// to machine local repositories. - /// - public List RepositoryUrls - { - get { return this.repositoryUrls; } - } - /// - /// [GET / SET] Whether the next startup of the Duality editor will consider restoring packages - /// to be the very first installation. This affects how license agreement requirements are handled. - /// - public bool IsFirstInstall - { - get { return this.firstInstall; } - set { this.firstInstall = value; } - } - /// - /// [GET] A list of packages that are required by this project. If a package does not specify a - /// specific version, the latest available version will be installed. - /// - public List Packages - { - get { return this.localPackages; } - } - - - /// - /// Retrieves a local project package by its Id, ignoring version numbers. - /// Returns null if no such package is referenced. - /// - /// - /// - public LocalPackage GetPackage(string id) - { - return this.GetPackage(new PackageName(id)); - } - /// - /// Retrieves a local project package by its Id and version. - /// Returns null if no such package is referenced. - /// - /// - /// - /// - public LocalPackage GetPackage(string id, Version version) - { - return this.GetPackage(new PackageName(id, version)); - } - /// - /// Retrieves a local project package by its name, optionally requiring a specific version number. - /// Returns null if no such package is referenced. - /// - /// - /// - public LocalPackage GetPackage(PackageName name) - { - foreach (LocalPackage localPackage in this.localPackages) - { - if (localPackage.Id == name.Id) - { - if (localPackage.Version == name.Version) - return localPackage; - else if (name.Version == null) - return localPackage; - } - } - return null; - } - - /// - /// Updates an existing using information from the - /// config file at the specified path. Settings that are not specified in the - /// config file will remain as they were. - /// - /// - public void Populate(string configFilePath) - { - XDocument doc = XDocument.Load(configFilePath); - - // Parse primitive values - doc.Root.TryGetElementValue("FirstDualityInstall", ref this.firstInstall); - - // Parse repository URLs - IEnumerable repoUrlElements = doc.Root.Elements("RepositoryUrl"); - if (repoUrlElements.Any()) - { - this.repositoryUrls.Clear(); - this.repositoryUrls.AddRange(repoUrlElements.Select(x => x.Value)); - if (this.repositoryUrls.Count == 0) - { - this.repositoryUrls.Add(DefaultRepositoryUrl); - } - } - - // Parse package list - XElement packagesElement = doc.Root.Element("Packages"); - if (packagesElement != null) - { - this.localPackages.Clear(); - foreach (XElement packageElement in packagesElement.Elements("Package")) - { - PackageName package = PackageName.None; - package.Id = packageElement.GetAttributeValue("id"); - string versionString = packageElement.GetAttributeValue("version"); - if (versionString != null) Version.TryParse(versionString, out package.Version); - - // Skip invalid package references - if (string.IsNullOrWhiteSpace(package.Id)) continue; - - // Create local package entry - this.localPackages.Add(new LocalPackage(package)); - } - } - } - /// - /// Saves the to a config file at the specified path. - /// - /// - public void Save(string configFilePath) - { - XDocument doc = new XDocument( - new XElement("PackageConfig", - this.repositoryUrls.Select(x => new XElement("RepositoryUrl", x)), - new XElement("Packages", this.localPackages.Select(p => - new XElement("Package", - new XAttribute("id", p.Id), - p.Version != null ? new XAttribute("version", p.Version) : null - ) - )) - )); - doc.Save(configFilePath); - } - - /// - /// Loads an existing from the config file at the - /// specified path. - /// - /// - /// - public static PackageSetup Load(string configFilePath) - { - PackageSetup setup = new PackageSetup(); - setup.Populate(configFilePath); - return setup; - } - } -} diff --git a/Source/Editor/DualityEditor/PackageManagement/PackageUpdateSchedule.cs b/Source/Editor/DualityEditor/PackageManagement/PackageUpdateSchedule.cs deleted file mode 100644 index 438bbe1a5..000000000 --- a/Source/Editor/DualityEditor/PackageManagement/PackageUpdateSchedule.cs +++ /dev/null @@ -1,238 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Xml; -using System.Xml.Linq; -using System.Windows.Forms; -using System.Diagnostics; - -using NuGet; - -using Duality.IO; -using Duality.Editor.Properties; -using Duality.Editor.Forms; - -namespace Duality.Editor.PackageManagement -{ - /// - /// Describes the required operations to apply a previously performed package operation. - /// - /// The schedule is what's usually stored in a file at the , - /// which is read and executed by the updater application. - /// - public class PackageUpdateSchedule - { - /// - /// Element name of copy file update instructions. See . - /// - public static readonly string CopyItem = "Update"; - /// - /// Element name of delete file update instructions. See . - /// - public static readonly string DeleteItem = "Remove"; - /// - /// Element name of project integration update instructions. See . - /// - public static readonly string IntegrateProjectItem = "IntegrateProject"; - /// - /// Element name of project separation update instructions. See . - /// - public static readonly string SeparateProjectItem = "SeparateProject"; - - - private XDocument document; - - /// - /// [GET] Enumerates all update instruction items in the schedule. - /// The type of each instruction can be derived from the element names, - /// but be aware that both names and attributes are an implementation - /// detail that can be subject to change in future versions. - /// - public IEnumerable Items - { - get { return this.document.Root.Elements(); } - } - - public PackageUpdateSchedule() - { - this.document = new XDocument(new XElement("UpdateConfig")); - } - - /// - /// Appends a copy file instruction to the update schedule. - /// - /// - /// - public void AppendCopyFile(string copySource, string copyTarget) - { - // Remove previous deletion schedules referring to the copy target - this.RemoveItems(DeleteItem, copyTarget); - - // Append the copy entry - this.document.Root.Add(new XElement(CopyItem, - new XAttribute("source", copySource), - new XAttribute("target", copyTarget))); - } - /// - /// Appends a delete file instruction to the update schedule. - /// - /// - public void AppendDeleteFile(string deleteTarget) - { - // Remove previous elements referring to the yet-to-delete file - this.RemoveItems(CopyItem, deleteTarget); - this.RemoveItems(IntegrateProjectItem, deleteTarget); - - // Append the delete entry - this.document.Root.Add(new XElement(DeleteItem, - new XAttribute("target", deleteTarget))); - } - /// - /// Appends a project integration instruction to the update schedule. - /// This instruction type will make sure that the specified source code project file - /// is referenced in the Duality project's primary source code solution file. - /// - /// - /// - /// - public void AppendIntegrateProject(string projectFile, string solutionFile, string pluginDirectory) - { - // Remove previous deletion schedules referring to the copy target - this.RemoveItems(DeleteItem, projectFile); - this.RemoveItems(DeleteItem, solutionFile); - this.RemoveItems(SeparateProjectItem, solutionFile); - - // Append the integrate entry - this.document.Root.Add(new XElement(IntegrateProjectItem, - new XAttribute("project", projectFile), - new XAttribute("solution", solutionFile), - new XAttribute("pluginDirectory", pluginDirectory))); - } - /// - /// Appends a project separation instruction to the update schedule. - /// This instruction type will make sure that the specified source code project file - /// is no longer referenced in the Duality project's primary source code solution file. - /// - /// - /// - public void AppendSeparateProject(string projectFile, string solutionFile) - { - this.RemoveItems(IntegrateProjectItem, projectFile); - - // Append the integrate entry - this.document.Root.Add(new XElement(SeparateProjectItem, - new XAttribute("project", projectFile), - new XAttribute("solution", solutionFile))); - } - private void RemoveItems(string itemType, string referringToFile) - { - IEnumerable query = string.IsNullOrEmpty(itemType) ? - this.document.Root.Elements() : - this.document.Root.Elements(itemType); - List queryResults = query.ToList(); - - foreach (XElement element in queryResults) - { - bool anyReference = false; - foreach (XAttribute attribute in element.Attributes()) - { - if (string.Equals(attribute.Value, referringToFile, StringComparison.InvariantCultureIgnoreCase)) - { - anyReference = true; - break; - } - } - if (anyReference) - { - element.Remove(); - } - } - } - - /// - /// Applies all changes that affect the Duality updater itself, which for that - /// reason can't be done by the updater. The applied items will be removed from - /// the schedule. - /// - /// - public void ApplyUpdaterChanges(string updaterPath) - { - List updaterItems = new List(); - - // Gather all items that are affecting the updater - foreach (XElement element in this.Items) - { - XAttribute attribTarget = element.Attribute("target"); - string target = (attribTarget != null) ? attribTarget.Value : null; - - if (string.Equals(target, updaterPath, StringComparison.InvariantCultureIgnoreCase)) - updaterItems.Add(element); - } - - this.ApplyChanges(updaterItems); - } - /// - /// Applies a set of scheduled update instructions immediately and removes them from the schedule. - /// - /// Note that this method only supports copy and delete operations. More complex operations are only - /// implemented in the updater application, as this is the one usually performing them. This method - /// exists only for applying updates to the updater itself, as well as for testing purposes. - /// - /// - public void ApplyChanges(IEnumerable items) - { - List updateItems = items.ToList(); - foreach (XElement element in updateItems) - { - XAttribute attribTarget = element.Attribute("target"); - XAttribute attribSource = element.Attribute("source"); - string target = (attribTarget != null) ? attribTarget.Value : null; - string source = (attribSource != null) ? attribSource.Value : null; - - // Apply updates that affect the updater itself - bool applied = false; - if (string.Equals(element.Name.LocalName, DeleteItem, StringComparison.InvariantCultureIgnoreCase)) - { - File.Delete(target); - applied = true; - } - else if (string.Equals(element.Name.LocalName, CopyItem, StringComparison.InvariantCultureIgnoreCase)) - { - string directory = Path.GetDirectoryName(target); - if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory)) - Directory.CreateDirectory(directory); - - File.Copy(source, target, true); - applied = true; - } - - // Remove applied elements from the schedule - if (applied) - element.Remove(); - } - } - - /// - /// Saves the update schedule to the specified file path. - /// - /// - public void Save(string updateFilePath) - { - this.document.Save(updateFilePath); - } - - /// - /// Loads an existing update schedule from the specified file path. - /// - /// - /// - public static PackageUpdateSchedule Load(string updateFilePath) - { - PackageUpdateSchedule schedule = new PackageUpdateSchedule(); - schedule.document = XDocument.Load(updateFilePath); - return schedule; - } - } -} diff --git a/Source/Editor/DualityEditor/Program.cs b/Source/Editor/DualityEditor/Program.cs index 493b63e31..b8c5e4307 100644 --- a/Source/Editor/DualityEditor/Program.cs +++ b/Source/Editor/DualityEditor/Program.cs @@ -10,7 +10,6 @@ using Duality; using Duality.Editor.Properties; using Duality.Editor.Forms; -using Duality.Editor.PackageManagement; namespace Duality.Editor { @@ -40,13 +39,6 @@ private static void Main(string[] args) // Winforms Setup PrepareWinFormsApplication(); - // Restore or remove packages to match package config - if (!VerifyPackageSetup()) - { - Application.Exit(); - return; - } - // Run the editor SplashScreen splashScreen = new SplashScreen(recoverFromPluginReload); splashScreen.Show(); @@ -75,112 +67,6 @@ private static void PrepareWinFormsApplication() Application.ThreadException += Application_ThreadException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; } - private static bool VerifyPackageSetup() - { - PackageManager packageManager = new PackageManager(); - - // On the first install startup, display a generic license agreement for Duality - if (packageManager.LocalSetup.IsFirstInstall) - { - LicenseAcceptDialog licenseDialog = new LicenseAcceptDialog - { - DescriptionText = GeneralRes.LicenseAcceptDialog_FirstStartGeneric, - LicenseUrl = new Uri(DualityMainLicenseUrl) - }; - DialogResult result = licenseDialog.ShowDialog(); - if (result != DialogResult.OK) - return false; - } - - // Perform the initial package update - even before initializing the editor - if (packageManager.IsPackageSyncRequired) - { - Logs.Editor.Write("Synchronizing Local Package Setup..."); - Logs.Editor.PushIndent(); - ProcessingBigTaskDialog setupDialog = new ProcessingBigTaskDialog( - GeneralRes.TaskInstallPackages_Caption, - GeneralRes.TaskInstallPackages_Desc, - SynchronizePackages, - packageManager); - setupDialog.ShowInTaskbar = true; - setupDialog.MainThreadRequired = false; - setupDialog.ShowDialog(); - Logs.Editor.PopIndent(); - } - - // Restart to apply the update. This will also trigger when there is a pending - // update from before that wasn't applied yet. - if (packageManager.ApplyUpdate()) - { - return false; - } - // If we have nothing to apply, but still require a sync, something went wrong. - // Should this happen on our first start, we'll remind the user that the install - // requires an internet connection and refuse to start. - else if (packageManager.IsPackageSyncRequired && packageManager.LocalSetup.IsFirstInstall) - { - DialogResult result = MessageBox.Show( - GeneralRes.Msg_ErrorFirstDualityInstall_Desc, - GeneralRes.Msg_ErrorFirstDualityInstall_Caption, - MessageBoxButtons.OK, MessageBoxIcon.Information); - return false; - } - - return true; - } - private static IEnumerable SynchronizePackages(ProcessingBigTaskDialog.WorkerInterface workerInterface) - { - PackageManager manager = workerInterface.Data as PackageManager; - - // Set the working state and yield, so the UI can update properly in case we're in the main thread - workerInterface.Progress = 0.0f; - workerInterface.StateDesc = GeneralRes.TaskPrepareInfo; - yield return null; - - // Retrieve all registered Duality packages and sort them so we don't accidentally install an old dependency - LocalPackage[] packagesToVerify = manager.LocalSetup.Packages.ToArray(); - manager.OrderByDependencies(packagesToVerify); - yield return null; - - // Uninstall all "shadow" Duality packages that are installed, but not registered - Logs.Editor.Write("Removing unregistered packages..."); - Logs.Editor.PushIndent(); - manager.UninstallNonRegisteredPackages(); - Logs.Editor.PopIndent(); - yield return null; - - // Iterate over previously reigstered local packages and verify / install them. - Logs.Editor.Write("Verifying registered packages..."); - Logs.Editor.PushIndent(); - foreach (LocalPackage package in packagesToVerify) - { - // Update the task dialog's UI - if (package.Version != null) - workerInterface.StateDesc = string.Format("Package '{0}', Version {1}...", package.Id, package.Version); - else - workerInterface.StateDesc = string.Format("Package '{0}'...", package.Id); - workerInterface.Progress += 0.5f / packagesToVerify.Length; - yield return null; - - // Verify / Install the local package as needed - try - { - manager.VerifyPackage(package); - } - catch (Exception e) - { - Logs.Editor.WriteError("An error occurred verifying Package '{0}', Version {1}: {2}", - package.Id, - package.Version, - LogFormat.Exception(e)); - } - workerInterface.Progress += 0.5f / packagesToVerify.Length; - yield return null; - } - Logs.Editor.PopIndent(); - - yield break; - } private static void ArchiveOldLogfile() { diff --git a/Source/Editor/DualityEditor/Properties/AssemblyInfo.cs b/Source/Editor/DualityEditor/Properties/AssemblyInfo.cs index f8a571af3..7029b3505 100644 --- a/Source/Editor/DualityEditor/Properties/AssemblyInfo.cs +++ b/Source/Editor/DualityEditor/Properties/AssemblyInfo.cs @@ -32,6 +32,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.1.9")] -[assembly: AssemblyVersion("3.1.9")] +[assembly: AssemblyVersion("4.0.0")] [assembly: InternalsVisibleTo("DualityEditorTests")] diff --git a/Source/Editor/DualityEditor/Properties/GeneralRes.Designer.cs b/Source/Editor/DualityEditor/Properties/GeneralRes.Designer.cs index de1dbcf0c..dfedd0d88 100644 --- a/Source/Editor/DualityEditor/Properties/GeneralRes.Designer.cs +++ b/Source/Editor/DualityEditor/Properties/GeneralRes.Designer.cs @@ -289,16 +289,6 @@ public static string ErrorHandlersTemplate { } } - /// - /// Looks up a localized resource of type System.Byte[]. - /// - public static byte[] GamePluginTemplate { - get { - object obj = ResourceManager.GetObject("GamePluginTemplate", resourceCulture); - return ((byte[])(obj)); - } - } - /// /// Looks up a localized string similar to /* /// * A set of static helper classes that provide easy runtime access to the games resources. @@ -450,15 +440,6 @@ public static string MenuItemInfo_DebugGame { } } - /// - /// Looks up a localized string similar to Duality always works locally in a project folder. The New Project dialog will help you set up a new one.. - /// - public static string MenuItemInfo_NewProject { - get { - return ResourceManager.GetString("MenuItemInfo_NewProject", resourceCulture); - } - } - /// /// Looks up a localized string similar to The project source code is where your game logic happens. To help you get started, Duality will create and open a suitable Visual Studio solution for you.. /// @@ -594,15 +575,6 @@ public static string MenuItemName_ConfigureLauncher { } } - /// - /// Looks up a localized string similar to New Project.... - /// - public static string MenuItemName_NewProject { - get { - return ResourceManager.GetString("MenuItemName_NewProject", resourceCulture); - } - } - /// /// Looks up a localized string similar to Profile Game. /// @@ -1164,15 +1136,6 @@ public static string PropertyGrid_N_Objects { } } - /// - /// Looks up a localized string similar to Select the folder in which a new project will be created below.. - /// - public static string SelectNewProjectFolderDialog_Desc { - get { - return ResourceManager.GetString("SelectNewProjectFolderDialog_Desc", resourceCulture); - } - } - /// /// Looks up a localized string similar to Reloading core plugins.... /// diff --git a/Source/Editor/DualityEditor/Properties/GeneralRes.resx b/Source/Editor/DualityEditor/Properties/GeneralRes.resx index 2a71bb9ca..02552be38 100644 --- a/Source/Editor/DualityEditor/Properties/GeneralRes.resx +++ b/Source/Editor/DualityEditor/Properties/GeneralRes.resx @@ -160,12 +160,6 @@ ..\EmbeddedResources\CursorHandGrabbing.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\EmbeddedResources\GamePluginTemplate.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\EmbeddedResources\GameResTemplate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - No information available. @@ -178,21 +172,12 @@ ..\EmbeddedResources\application_create.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\EmbeddedResources\template_current.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\template_empty.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - English If you're using a professional version of Visual Studio, this action will run the Duality launcher and trigger a debug event that allows you to attach the debugger to your game before anything happens. You can achieve the same by clicking the "Run" button of your Core Plugin in Visual Studio itself. - - Duality always works locally in a project folder. The New Project dialog will help you set up a new one. - The project source code is where your game logic happens. To help you get started, Duality will create and open a suitable Visual Studio solution for you. @@ -223,9 +208,6 @@ About - - New Project... - Quit @@ -346,9 +328,6 @@ {0} objects - - Select the folder in which a new project will be created below. - Reloading core plugins... @@ -487,9 +466,6 @@ ..\EmbeddedResources\namespace.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\EmbeddedResources\ErrorHandlersTemplate.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - Creates a version of the game ready to distribute to others, with all necessary files diff --git a/Source/Editor/DualityEditor/Properties/GeneralResCache.cs b/Source/Editor/DualityEditor/Properties/GeneralResCache.cs index 728fefd4a..2784412ea 100644 --- a/Source/Editor/DualityEditor/Properties/GeneralResCache.cs +++ b/Source/Editor/DualityEditor/Properties/GeneralResCache.cs @@ -24,9 +24,6 @@ public static class GeneralResCache public static readonly Bitmap CursorArrowActionScale = GeneralRes.CursorArrowActionScale; public static readonly Bitmap CursorHandGrab = GeneralRes.CursorHandGrab; public static readonly Bitmap CursorHandGrabbing = GeneralRes.CursorHandGrabbing; - public static readonly Bitmap ImageAppCreate = GeneralRes.ImageAppCreate; - public static readonly Bitmap ImageTemplateCurrent = GeneralRes.ImageTemplateCurrent; - public static readonly Bitmap ImageTemplateEmpty = GeneralRes.ImageTemplateEmpty; public static readonly Icon IconCog = GeneralRes.IconCog; public static readonly Icon IconWorkingFolder = GeneralRes.IconWorkingFolder; } diff --git a/Source/Editor/DualityEditor/Utility/EditorHelper.cs b/Source/Editor/DualityEditor/Utility/EditorHelper.cs index a62b7882a..af66bee07 100644 --- a/Source/Editor/DualityEditor/Utility/EditorHelper.cs +++ b/Source/Editor/DualityEditor/Utility/EditorHelper.cs @@ -25,24 +25,12 @@ public static class EditorHelper public static readonly string SourceMediaDirectory = Path.Combine(SourceDirectory, "Media"); public static readonly string SourceCodeDirectory = Path.Combine(SourceDirectory, "Code"); - public static readonly string SourceCodeProjectCorePluginDir = Path.Combine(SourceCodeDirectory, "CorePlugin"); - public static readonly string SourceCodeProjectEditorPluginDir = Path.Combine(SourceCodeDirectory, "EditorPlugin"); - public static readonly string SourceCodeProjectGameDebuggerDir = Path.Combine(SourceCodeDirectory, "GameDebugger"); - public static readonly string DefaultSourceCodeSolutionFile = Path.Combine(SourceCodeDirectory, "ProjectPlugins.sln"); - public static readonly string SourceCodeProjectCorePluginFile = Path.Combine(SourceCodeProjectCorePluginDir, "CorePlugin.csproj"); - public static readonly string SourceCodeProjectEditorPluginFile = Path.Combine(SourceCodeProjectEditorPluginDir, "EditorPlugin.csproj"); - public static readonly string SourceCodeProjectGameDebuggerFile = Path.Combine(SourceCodeProjectGameDebuggerDir, "GameDebugger.csproj"); - public static readonly string SourceCodeErrorHandlerFile = Path.Combine(SourceCodeProjectCorePluginDir, "Properties", "ErrorHandlers.cs"); - public static readonly string SourceCodeCorePluginFile = Path.Combine(SourceCodeProjectCorePluginDir, "CorePlugin.cs"); - public static readonly string SourceCodeComponentExampleFile = Path.Combine(SourceCodeProjectCorePluginDir, "YourCustomComponentType.cs"); - public static readonly string SourceCodeEditorPluginFile = Path.Combine(SourceCodeProjectEditorPluginDir, "EditorPlugin.cs"); public static readonly string GlobalUserDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Duality"); - public static readonly string GlobalProjectTemplateDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Duality", "ProjectTemplates"); /// - /// The path to the *.sln solution file. Will return if the solution file has not yet been created. + /// The path to the *.sln solution file. Will throw a if the solution file cannot be found. /// public static string SourceCodeSolutionFilePath { @@ -57,7 +45,7 @@ public static string SourceCodeSolutionFilePath SearchOption.AllDirectories) .FirstOrDefault(); } - return sourceCodeSolutionFilePath ?? DefaultSourceCodeSolutionFile; + return sourceCodeSolutionFilePath ?? throw new FileNotFoundException($"Could not find a solution file in {SourceCodeDirectory}"); } } public static string CurrentProjectName @@ -70,183 +58,6 @@ public static string CurrentProjectName } } - - public static string GenerateClassNameFromPath(string path) - { - // Replace chars that aren't allowed as class name - char[] pathChars = path.ToCharArray(); - for (int i = 0; i < pathChars.Length; i++) - { - if (!char.IsLetterOrDigit(pathChars[i])) - pathChars[i] = '_'; - } - // Do not allow beginning digit - if (char.IsDigit(pathChars[0])) - path = "_" + new string(pathChars); - else - path = new string(pathChars); - - // Avoid certain ambiguity - if (path == "System") path = "System_"; - else if (path == "Duality") path = "Duality_"; - else if (path == "OpenTK") path = "OpenTK_"; - - return path; - } - public static string GenerateErrorHandlersSrcFile(string oldRootNamespace, string rootNamespace) - { - string source = Properties.GeneralRes.ErrorHandlersTemplate; - source = source.Replace("OLDROOTNAMESPACE", oldRootNamespace); - source = source.Replace("ROOTNAMESPACE", rootNamespace); - return source; - } - - public static string CreateNewProject(string projName, string projFolder, ProjectTemplateInfo template) - { - // Determine the current executing directory, in addition to Environment.CurrentDirectory - Assembly execAssembly = Assembly.GetEntryAssembly() ?? typeof(DualityEditorApp).Assembly; - string execDirectory = Path.GetFullPath(Path.GetDirectoryName(execAssembly.Location)); - - // Create project folder - projFolder = Path.Combine(projFolder, projName); - if (!Directory.Exists(projFolder)) Directory.CreateDirectory(projFolder); - - // Extract template - if (template.SpecialTag == ProjectTemplateInfo.SpecialInfo.None) - { - template.ExtractTo(projFolder); - - // Update main directory - foreach (string srcFile in Directory.GetFiles(Environment.CurrentDirectory, "*", SearchOption.TopDirectoryOnly)) - { - if (Path.GetFileName(srcFile) == "appdata.dat") continue; - if (Path.GetFileName(srcFile) == "defaultuserdata.dat") continue; - string dstFile = Path.Combine(projFolder, Path.GetFileName(srcFile)); - File.Copy(srcFile, dstFile, true); - } - - // Update plugin directory - foreach (string dstFile in Directory.GetFiles(Path.Combine(projFolder, DualityApp.PluginDirectory), "*", SearchOption.AllDirectories)) - { - string srcFileWorking = Path.Combine(DualityApp.PluginDirectory, Path.GetFileName(dstFile)); - string srcFileExec = Path.Combine(PathHelper.ExecutingAssemblyDir, DualityApp.PluginDirectory, Path.GetFileName(dstFile)); - if (File.Exists(srcFileWorking)) - { - File.Copy(srcFileWorking, dstFile, true); - } - else if (File.Exists(srcFileExec)) - { - File.Copy(srcFileExec, dstFile, true); - } - } - } - else if (template.SpecialTag == ProjectTemplateInfo.SpecialInfo.Current) - { - DualityEditorApp.SaveAllProjectData(); - - Predicate copyPredicate = delegate(string path) - { - bool isDir = Directory.Exists(path); - string fullPath = Path.GetFullPath(path); - if (isDir) - { - return - !PathOp.ArePathsEqual(fullPath, EditorHelper.BackupDirectory) && - !PathOp.ArePathsEqual(fullPath, Path.Combine(execDirectory, EditorHelper.BackupDirectory)); - } - else - { - return true; - } - }; - - if (!PathOp.ArePathsEqual(execDirectory, Environment.CurrentDirectory)) - PathHelper.CopyDirectory(execDirectory, projFolder, true, copyPredicate); - PathHelper.CopyDirectory(Environment.CurrentDirectory, projFolder, true, copyPredicate); - } - else - { - Predicate copyPredicate = delegate(string path) - { - bool isDir = Directory.Exists(path); - string fullPath = Path.GetFullPath(path); - if (isDir) - { - return - !PathOp.ArePathsEqual(fullPath, DualityApp.DataDirectory) && - !PathOp.ArePathsEqual(fullPath, EditorHelper.SourceDirectory) && - !PathOp.ArePathsEqual(fullPath, EditorHelper.BackupDirectory) && - !PathOp.ArePathsEqual(fullPath, Path.Combine(execDirectory, DualityApp.DataDirectory)) && - !PathOp.ArePathsEqual(fullPath, Path.Combine(execDirectory, EditorHelper.SourceDirectory)) && - !PathOp.ArePathsEqual(fullPath, Path.Combine(execDirectory, EditorHelper.BackupDirectory)); - } - else - { - string fileName = Path.GetFileName(fullPath); - return fileName != "appdata.dat" && fileName != "defaultuserdata.dat" && fileName != "designtimedata.dat"; - } - }; - - if (!PathOp.ArePathsEqual(execDirectory, Environment.CurrentDirectory)) - PathHelper.CopyDirectory(execDirectory, projFolder, true, copyPredicate); - PathHelper.CopyDirectory(Environment.CurrentDirectory, projFolder, true, copyPredicate); - } - - // Adjust current directory and perform init operations in the new project folder - string oldPath = Environment.CurrentDirectory; - Environment.CurrentDirectory = projFolder; - try - { - // Initialize AppData - DualityAppData data; - data = Serializer.TryReadObject(DualityApp.AppDataPath) ?? new DualityAppData(); - data.AppName = projName; - data.Version = 0; - Serializer.WriteObject(data, DualityApp.AppDataPath, typeof(XmlSerializer)); - - // Read content source code data (needed to rename classes / namespaces) - string oldRootNamespaceNameCore; - string newRootNamespaceNameCore; - DualityEditorApp.ReadPluginSourceCodeContentData(out oldRootNamespaceNameCore, out newRootNamespaceNameCore); - - // Initialize source code - DualityEditorApp.InitPluginSourceCode(); // Force re-init to update namespaces, etc. - DualityEditorApp.UpdatePluginSourceCode(); - - // Add SerializeErrorHandler class to handle renamed Types - if (Directory.Exists(DualityApp.DataDirectory)) - { - // Add error handler source file to project - XDocument coreProject = XDocument.Load(SourceCodeProjectCorePluginFile); - string relErrorHandlerPath = PathHelper.MakeFilePathRelative( - SourceCodeErrorHandlerFile, - Path.GetDirectoryName(SourceCodeProjectCorePluginFile)); - if (!coreProject.Descendants("Compile", true).Any(c => string.Equals(c.GetAttributeValue("Include"), relErrorHandlerPath))) - { - XElement compileElement = coreProject.Descendants("Compile", true).FirstOrDefault(); - XElement newCompileElement = new XElement( - XName.Get("Compile", compileElement.Name.NamespaceName), - new XAttribute("Include", relErrorHandlerPath)); - compileElement.AddAfterSelf(newCompileElement); - } - coreProject.Save(SourceCodeProjectCorePluginFile); - - // Generate and save error handler source code - File.WriteAllText( - EditorHelper.SourceCodeErrorHandlerFile, - EditorHelper.GenerateErrorHandlersSrcFile(oldRootNamespaceNameCore, newRootNamespaceNameCore)); - } - - // Compile plugins - BuildHelper.BuildSolutionFile(EditorHelper.SourceCodeSolutionFilePath, "Release"); - } - finally - { - Environment.CurrentDirectory = oldPath; - } - return Path.Combine(projFolder, "DualityEditor.exe"); - } - public static void ShowInExplorer(string filePath) { string fullPath = Path.GetFullPath(filePath); @@ -353,131 +164,4 @@ public static Image GetImageWithOverlay(Image baseImage, Image overlayImage) return overlaySet.GetOverlay(overlayImage); } } - - public enum VisualStudioEdition - { - Unknown, - Express, - Standard - } - - public class ProjectTemplateInfo - { - public enum SpecialInfo - { - None, - Empty, - Current - } - - private string file; - private Bitmap icon; - private string name; - private string desc; - private SpecialInfo specialTag; - - public string FilePath - { - get { return this.file; } - set { this.file = value; } - } - public Bitmap Icon - { - get { return this.icon; } - set { this.icon = value; } - } - public string Name - { - get { return this.name; } - set { this.name = value; } - } - public string Description - { - get { return this.desc; } - set { this.desc = value; } - } - public SpecialInfo SpecialTag - { - get { return this.specialTag; } - set { this.specialTag = value; } - } - - public ProjectTemplateInfo() {} - public ProjectTemplateInfo(string templatePath) - { - if (string.IsNullOrEmpty(templatePath)) throw new ArgumentNullException("templatePath"); - if (Path.GetExtension(templatePath) != ".zip") throw new ArgumentException("The specified template path is expected to be a .zip file.", "templatePath"); - if (!File.Exists(templatePath)) throw new FileNotFoundException("Template file does not exist", templatePath); - - using (FileStream str = File.OpenRead(templatePath)) { this.InitFrom(str); } - this.file = templatePath; - } - public ProjectTemplateInfo(Stream templateStream) - { - this.InitFrom(templateStream); - } - - public void ExtractTo(string dir) - { - if (string.IsNullOrWhiteSpace(this.file) || !File.Exists(this.file)) - throw new InvalidOperationException("Can't extract Project Template, because the template file is missing"); - - using (FileStream stream = File.OpenRead(this.file)) - using (ZipArchive templateZip = new ZipArchive(stream)) - { - templateZip.ExtractAll(dir, true); - } - if (File.Exists(Path.Combine(dir, "TemplateIcon.png"))) File.Delete(Path.Combine(dir, "TemplateIcon.png")); - if (File.Exists(Path.Combine(dir, "TemplateInfo.xml"))) File.Delete(Path.Combine(dir, "TemplateInfo.xml")); - } - public void InitFrom(Stream templateStream) - { - if (templateStream == null) throw new ArgumentNullException("templateStream"); - - this.file = null; - this.name = "Unknown"; - this.specialTag = SpecialInfo.None; - - using (ZipArchive templateZip = new ZipArchive(templateStream)) - { - ZipArchiveEntry entryInfo = templateZip.Entries.FirstOrDefault(z => z.Name == "TemplateInfo.xml"); - ZipArchiveEntry entryIcon = templateZip.Entries.FirstOrDefault(z => z.Name == "TemplateIcon.png"); - - if (entryIcon != null) - { - using (MemoryStream str = new MemoryStream()) - { - entryIcon.Extract(str); - str.Seek(0, SeekOrigin.Begin); - this.icon = new Bitmap(str); - } - } - - if (entryInfo != null) - { - string xmlSource = null; - using (MemoryStream str = new MemoryStream()) - { - entryInfo.Extract(str); - str.Seek(0, SeekOrigin.Begin); - - using (StreamReader reader = new StreamReader(str)) - { - xmlSource = reader.ReadToEnd(); - } - } - - XDocument xmlDoc = XDocument.Parse(xmlSource); - - XElement elemName = xmlDoc.Element("name"); - if (elemName != null) this.name = elemName.Value; - - XElement elemDesc = xmlDoc.Element("description"); - if (elemDesc != null) this.desc = elemDesc.Value; - } - } - - return; - } - } } diff --git a/Source/Editor/Updater/Properties/AssemblyInfo.cs b/Source/Editor/Updater/Properties/AssemblyInfo.cs index 70babd4e1..e4c15d431 100644 --- a/Source/Editor/Updater/Properties/AssemblyInfo.cs +++ b/Source/Editor/Updater/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.1.9")] -[assembly: AssemblyVersion("3.1.9")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Launcher/Properties/AssemblyInfo.cs b/Source/Launcher/Properties/AssemblyInfo.cs index c985a77b0..363e8690e 100644 --- a/Source/Launcher/Properties/AssemblyInfo.cs +++ b/Source/Launcher/Properties/AssemblyInfo.cs @@ -30,6 +30,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Platform/DefaultOpenTK/Backend/Audio/AudioLibraryLoader.cs b/Source/Platform/DefaultOpenTK/Backend/Audio/AudioLibraryLoader.cs index 71c9b38ee..720de1203 100644 --- a/Source/Platform/DefaultOpenTK/Backend/Audio/AudioLibraryLoader.cs +++ b/Source/Platform/DefaultOpenTK/Backend/Audio/AudioLibraryLoader.cs @@ -23,8 +23,8 @@ public static void LoadAudioLibrary() // Determine working data Assembly execAssembly = Assembly.GetEntryAssembly() ?? typeof(DualityApp).Assembly; string execAssemblyDir = Path.GetFullPath(Path.GetDirectoryName(execAssembly.Location)); - string sourceFileName32 = Path.Combine(DualityApp.PluginDirectory, "OpenALSoft32.dll"); - string sourceFileName64 = Path.Combine(DualityApp.PluginDirectory, "OpenALSoft64.dll"); + string sourceFileName32 = "OpenALSoft32.dll"; + string sourceFileName64 = "OpenALSoft64.dll"; string targetFileName = "OpenAL32.dll"; // Determine the location of fallback libraries diff --git a/Source/Platform/DefaultOpenTK/DefaultOpenTK.Core.csproj b/Source/Platform/DefaultOpenTK/DefaultOpenTK.Core.csproj index b957109e5..34cbc5da0 100644 --- a/Source/Platform/DefaultOpenTK/DefaultOpenTK.Core.csproj +++ b/Source/Platform/DefaultOpenTK/DefaultOpenTK.Core.csproj @@ -94,8 +94,8 @@ - - + + diff --git a/Source/Platform/DefaultOpenTK/Properties/AssemblyInfo.cs b/Source/Platform/DefaultOpenTK/Properties/AssemblyInfo.cs index b5c01885d..60e7363c7 100644 --- a/Source/Platform/DefaultOpenTK/Properties/AssemblyInfo.cs +++ b/Source/Platform/DefaultOpenTK/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.2.0")] -[assembly: AssemblyVersion("3.2.0")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Platform/DefaultOpenTKEditor/Properties/AssemblyInfo.cs b/Source/Platform/DefaultOpenTKEditor/Properties/AssemblyInfo.cs index ed2d10c3f..60e7363c7 100644 --- a/Source/Platform/DefaultOpenTKEditor/Properties/AssemblyInfo.cs +++ b/Source/Platform/DefaultOpenTKEditor/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.1.3")] -[assembly: AssemblyVersion("3.1.3")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Platform/DotNetFramework/Properties/AssemblyInfo.cs b/Source/Platform/DotNetFramework/Properties/AssemblyInfo.cs index fc8ead1d7..60e7363c7 100644 --- a/Source/Platform/DotNetFramework/Properties/AssemblyInfo.cs +++ b/Source/Platform/DotNetFramework/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/Compatibility/Properties/AssemblyInfo.cs b/Source/Plugins/Compatibility/Properties/AssemblyInfo.cs index 51ac09938..4554acd0f 100644 --- a/Source/Plugins/Compatibility/Properties/AssemblyInfo.cs +++ b/Source/Plugins/Compatibility/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/EditorBase/Properties/AssemblyInfo.cs b/Source/Plugins/EditorBase/Properties/AssemblyInfo.cs index 574620407..f72fc5b14 100644 --- a/Source/Plugins/EditorBase/Properties/AssemblyInfo.cs +++ b/Source/Plugins/EditorBase/Properties/AssemblyInfo.cs @@ -31,6 +31,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/EditorModules/CamView/Properties/AssemblyInfo.cs b/Source/Plugins/EditorModules/CamView/Properties/AssemblyInfo.cs index b2bf8f85f..5e3bc6f7a 100644 --- a/Source/Plugins/EditorModules/CamView/Properties/AssemblyInfo.cs +++ b/Source/Plugins/EditorModules/CamView/Properties/AssemblyInfo.cs @@ -31,6 +31,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/EditorModules/HelpAdvisor/Properties/AssemblyInfo.cs b/Source/Plugins/EditorModules/HelpAdvisor/Properties/AssemblyInfo.cs index ced1624da..2df1890cb 100644 --- a/Source/Plugins/EditorModules/HelpAdvisor/Properties/AssemblyInfo.cs +++ b/Source/Plugins/EditorModules/HelpAdvisor/Properties/AssemblyInfo.cs @@ -30,6 +30,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/EditorModules/LogView/Properties/AssemblyInfo.cs b/Source/Plugins/EditorModules/LogView/Properties/AssemblyInfo.cs index 423d49656..0acc3c9d1 100644 --- a/Source/Plugins/EditorModules/LogView/Properties/AssemblyInfo.cs +++ b/Source/Plugins/EditorModules/LogView/Properties/AssemblyInfo.cs @@ -31,6 +31,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.5")] -[assembly: AssemblyVersion("3.0.5")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/EditorModules/ObjectInspector/Properties/AssemblyInfo.cs b/Source/Plugins/EditorModules/ObjectInspector/Properties/AssemblyInfo.cs index a80a148c5..c6b18d78e 100644 --- a/Source/Plugins/EditorModules/ObjectInspector/Properties/AssemblyInfo.cs +++ b/Source/Plugins/EditorModules/ObjectInspector/Properties/AssemblyInfo.cs @@ -31,6 +31,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.5")] -[assembly: AssemblyVersion("3.0.5")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EditorActions/FirstSession/BrowseSamplePackages.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/EditorActions/FirstSession/BrowseSamplePackages.cs deleted file mode 100644 index b3f5353b3..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/EditorActions/FirstSession/BrowseSamplePackages.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Drawing; - -using Duality.Resources; -using Duality.Properties; -using Duality.Editor.Plugins.PackageManagerFrontend.Properties; - -namespace Duality.Editor.Plugins.PackageManagerFrontend.EditorActions.FirstSession -{ - /// - /// Download example projects to see Duality in action. - /// - public class BrowseSamplePackages : EditorAction - { - public override Image Icon - { - get { return PackageManagerFrontendResCache.IconSampleBig; } - } - public override string Name - { - get { return PackageManagerFrontendRes.ActionName_BrowseSamplePackages; } - } - - public override void Perform(IEnumerable objEnum) - { - PackageManagerFrontendPlugin plugin = DualityEditorApp.GetPlugin(); - plugin.ShowSamplePackageBrowser(); - } - public override bool MatchesContext(string context) - { - return context == DualityEditorApp.ActionContextFirstSession; - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/IconSampleBig.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/IconSampleBig.png deleted file mode 100644 index 8e0f6b585..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/IconSampleBig.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/IncompatibleInstall.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/IncompatibleInstall.png deleted file mode 100644 index c37bd062e..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/IncompatibleInstall.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/IncompatibleUpdate.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/IncompatibleUpdate.png deleted file mode 100644 index 492ee8009..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/IncompatibleUpdate.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/LikelySafeUpdate.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/LikelySafeUpdate.png deleted file mode 100644 index ff83ccdaf..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/LikelySafeUpdate.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/LikelyUnsafeUpdate.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/LikelyUnsafeUpdate.png deleted file mode 100644 index 6787e5f19..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/LikelyUnsafeUpdate.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/LikelyUnsafeinstall.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/LikelyUnsafeinstall.png deleted file mode 100644 index 628cf2dae..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/LikelyUnsafeinstall.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/SafeUpdate.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/SafeUpdate.png deleted file mode 100644 index 260720d86..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/SafeUpdate.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/SampleOverlay.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/SampleOverlay.png deleted file mode 100644 index 5e8c01edd..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/SampleOverlay.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/UpToDate.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/UpToDate.png deleted file mode 100644 index 39a4e2e06..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/UpToDate.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/core.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/core.png deleted file mode 100644 index 67de2c6cc..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/core.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/editor.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/editor.png deleted file mode 100644 index 0905f933b..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/editor.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/filter.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/filter.png deleted file mode 100644 index 227e8436c..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/filter.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/package.ico b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/package.ico deleted file mode 100644 index 3efb6c237..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/package.ico and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/package.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/package.png deleted file mode 100644 index da3c2a2d7..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/package.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/packagebig.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/packagebig.png deleted file mode 100644 index a164cd1a3..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/packagebig.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/packagemed.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/packagemed.png deleted file mode 100644 index 448681eaf..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/packagemed.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/sample.png b/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/sample.png deleted file mode 100644 index 7ad7b0d37..000000000 Binary files a/Source/Plugins/EditorModules/PackageManagerFrontend/EmbeddedResources/sample.png and /dev/null differ diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageDateNodeControl.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageDateNodeControl.cs deleted file mode 100644 index 5a59cefe4..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageDateNodeControl.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Drawing; - -using Aga.Controls.Tree; -using Aga.Controls.Tree.NodeControls; - -using Duality.Editor.PackageManagement; -using Duality.Editor.Plugins.PackageManagerFrontend.TreeModels; - -namespace Duality.Editor.Plugins.PackageManagerFrontend -{ - public class DualityPackageDateNodeControl : NodeControl - { - private PackageManager manager = null; - - public PackageManager PackageManager - { - get { return this.manager; } - set { this.manager = value; } - } - - public override void Draw(TreeNodeAdv node, DrawContext context) - { - Graphics g = context.Graphics; - Rectangle targetRect = new Rectangle( - context.Bounds.X + this.LeftMargin, - context.Bounds.Y, - context.Bounds.Width - this.LeftMargin, - context.Bounds.Height); - - // Retrieve item information - PackageItem item = node.Tag as PackageItem; - if (item == null) return; - - DateTime date = item.ItemPackageInfo.PublishDate; - bool isOld = (DateTime.Now - date).TotalDays > 180; - string yearText = date.ToString("yyyy"); - string dayText = date.ToString("MMM dd"); - - // Determine layout and drawing info - SizeF yearTextSize = g.MeasureString(yearText, context.Font); - SizeF dayTextSize = g.MeasureString(dayText, context.Font); - Size totalTextSize = new Size( - (int)Math.Max(yearTextSize.Width, dayTextSize.Width), - (int)(yearTextSize.Height + dayTextSize.Height)); - Rectangle yearTextRect = new Rectangle( - targetRect.X, - targetRect.Y + Math.Max((targetRect.Height - totalTextSize.Height) / 2, 0), - targetRect.Width, - (int)yearTextSize.Height); - Rectangle dayTextRect = new Rectangle( - targetRect.X, - targetRect.Y + (int)yearTextSize.Height + Math.Max((targetRect.Height - totalTextSize.Height) / 2, 0), - targetRect.Width, - targetRect.Height - (int)yearTextSize.Height); - StringFormat stringFormat = new StringFormat - { - Trimming = StringTrimming.EllipsisCharacter, - Alignment = StringAlignment.Center, - FormatFlags = StringFormatFlags.NoWrap - }; - - // Draw date text - g.DrawString(yearText, context.Font, new SolidBrush(Color.FromArgb((isOld ? 128 : 255) / (context.Enabled ? 1 : 2), this.Parent.ForeColor)), yearTextRect, stringFormat); - g.DrawString(dayText, context.Font, new SolidBrush(Color.FromArgb((isOld ? 128 : 255) / (context.Enabled ? 1 : 2), this.Parent.ForeColor)), dayTextRect, stringFormat); - } - public override Size MeasureSize(TreeNodeAdv node, DrawContext context) - { - return new Size(60, 48); - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageSummaryNodeControl.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageSummaryNodeControl.cs deleted file mode 100644 index a4c644a53..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageSummaryNodeControl.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Drawing; - -using Aga.Controls.Tree; -using Aga.Controls.Tree.NodeControls; - -using Duality.Editor.Plugins.PackageManagerFrontend.TreeModels; - -namespace Duality.Editor.Plugins.PackageManagerFrontend -{ - public class DualityPackageSummaryNodeControl : NodeControl - { - public override void Draw(TreeNodeAdv node, DrawContext context) - { - Graphics g = context.Graphics; - Rectangle targetRect = new Rectangle( - context.Bounds.X + this.LeftMargin, - context.Bounds.Y, - context.Bounds.Width - this.LeftMargin, - context.Bounds.Height); - - // Retrieve item information - PackageItem item = node.Tag as PackageItem; - if (item == null) return; - - string headline = null; - string summary = null; - if (item != null) - { - headline = item.Title; - if (item.ItemPackageInfo != null) - { - summary = item.ItemPackageInfo.Summary; - } - } - - // Calculate drawing layout and data - StringFormat headlineFormat = new StringFormat { Trimming = StringTrimming.EllipsisCharacter, FormatFlags = StringFormatFlags.NoWrap }; - StringFormat summaryFormat = new StringFormat { Trimming = StringTrimming.EllipsisCharacter, FormatFlags = StringFormatFlags.LineLimit }; - Rectangle headlineRect; - Rectangle summaryRect; - { - SizeF headlineSize; - SizeF summarySize; - // Base info - { - headlineSize = g.MeasureString(headline, context.Font, targetRect.Width, headlineFormat); - headlineRect = new Rectangle(targetRect.X, targetRect.Y, targetRect.Width, (int)headlineSize.Height + 2); - summaryRect = new Rectangle(targetRect.X, targetRect.Y + headlineRect.Height, targetRect.Width, targetRect.Height - headlineRect.Height); - summarySize = g.MeasureString(summary, context.Font, summaryRect.Size, summaryFormat); - } - // Alignment info - { - Size totelContentSize = new Size(Math.Max(headlineRect.Width, summaryRect.Width), headlineRect.Height + (int)summarySize.Height); - Point alignAdjust = new Point(0, Math.Max((targetRect.Height - totelContentSize.Height) / 2, 0)); - headlineRect.X += alignAdjust.X; - headlineRect.Y += alignAdjust.Y; - summaryRect.X += alignAdjust.X; - summaryRect.Y += alignAdjust.Y; - } - } - - Color textColor = this.Parent.ForeColor; - - g.DrawString(headline, context.Font, new SolidBrush(Color.FromArgb(context.Enabled ? 255 : 128, textColor)), headlineRect, headlineFormat); - g.DrawString(summary, context.Font, new SolidBrush(Color.FromArgb(context.Enabled ? 128 : 64, textColor)), summaryRect, summaryFormat); - } - public override Size MeasureSize(TreeNodeAdv node, DrawContext context) - { - return new Size(250, 48); - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageTypeNodeControl.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageTypeNodeControl.cs deleted file mode 100644 index 5b2fff0c5..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageTypeNodeControl.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Drawing; - -using Aga.Controls.Tree; -using Aga.Controls.Tree.NodeControls; - -using Duality.Editor.Plugins.PackageManagerFrontend.TreeModels; -using Duality.Editor.Plugins.PackageManagerFrontend.Properties; - -namespace Duality.Editor.Plugins.PackageManagerFrontend -{ - public class DualityPackageTypeNodeControl : NodeControl - { - public override void Draw(TreeNodeAdv node, DrawContext context) - { - Graphics g = context.Graphics; - Rectangle targetRect = new Rectangle( - context.Bounds.X + this.LeftMargin, - context.Bounds.Y, - context.Bounds.Width - this.LeftMargin, - context.Bounds.Height); - - // Retrieve item information - PackageItem item = node.Tag as PackageItem; - if (item == null) return; - - Image typeIcon = null; - if (item != null) - { - switch (item.Type) - { - case PackageItem.PackageType.Core: - typeIcon = PackageManagerFrontendResCache.IconCore; - break; - case PackageItem.PackageType.Editor: - typeIcon = PackageManagerFrontendResCache.IconEditor; - break; - case PackageItem.PackageType.Sample: - typeIcon = PackageManagerFrontendResCache.IconSample; - break; - } - } - if (typeIcon == null) return; - - // Draw icon centered - Point iconPos = new Point( - targetRect.X + targetRect.Width / 2 - typeIcon.Width / 2, - targetRect.Y + targetRect.Height / 2 - typeIcon.Height / 2); - g.DrawImageUnscaled(typeIcon, iconPos.X, iconPos.Y); - } - public override Size MeasureSize(TreeNodeAdv node, DrawContext context) - { - return new Size(40, 20); - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageVersionNodeControl.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageVersionNodeControl.cs deleted file mode 100644 index 5125697e2..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/DualityPackageVersionNodeControl.cs +++ /dev/null @@ -1,194 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Drawing; - -using Aga.Controls.Tree; -using Aga.Controls.Tree.NodeControls; - -using Duality.Editor.PackageManagement; -using Duality.Editor.Plugins.PackageManagerFrontend.Properties; -using Duality.Editor.Plugins.PackageManagerFrontend.TreeModels; - -namespace Duality.Editor.Plugins.PackageManagerFrontend -{ - public class DualityPackageVersionNodeControl : NodeControl, IToolTipProvider - { - private PackageManager manager = null; - - public PackageManager PackageManager - { - get { return this.manager; } - set { this.manager = value; } - } - - public override void Draw(TreeNodeAdv node, DrawContext context) - { - Graphics g = context.Graphics; - Rectangle targetRect = new Rectangle( - context.Bounds.X + this.LeftMargin, - context.Bounds.Y, - context.Bounds.Width - this.LeftMargin, - context.Bounds.Height); - - // Retrieve item information - PackageItem item = node.Tag as PackageItem; - if (item == null) return; - - Version itemVersion = null; - Version newVersion = null; - PackageCompatibility compatibility = PackageCompatibility.None; - bool highlightItemVersion = item is LocalPackageItem; - bool isInstalled = false; - bool isUpToDate = false; - if (item != null) - { - isInstalled = item.InstalledPackageInfo != null; - compatibility = item.Compatibility; - - if (item.InstalledPackageInfo != null) - itemVersion = item.InstalledPackageInfo.Version; - else if (item.ItemPackageInfo != null) - itemVersion = item.ItemPackageInfo.Version; - - if (item.NewestPackageInfo != null) - newVersion = item.NewestPackageInfo.Version; - - if (itemVersion != null && newVersion != null) - isUpToDate = itemVersion >= newVersion; - } - string itemVersionText = PackageViewDialog.GetDisplayedVersionString(itemVersion); - string newVersionText = isInstalled && !isUpToDate ? PackageViewDialog.GetDisplayedVersionString(newVersion) : string.Empty; - - // Determine background color and icon based on versioning - Brush backgroundBrush = null; - Image icon = null; - if (isInstalled) backgroundBrush = new SolidBrush(Color.FromArgb(32, 128, 128, 128)); - if (newVersion != null && itemVersion != null) - { - if (isInstalled) - { - if (newVersion <= itemVersion) - icon = Properties.PackageManagerFrontendResCache.IconUpToDate; - else if (compatibility == PackageCompatibility.Definite) - icon = Properties.PackageManagerFrontendResCache.IconSafeUpdate; - else if (compatibility == PackageCompatibility.Likely) - icon = Properties.PackageManagerFrontendResCache.IconLikelySafeUpdate; - else if (compatibility == PackageCompatibility.Unlikely) - icon = Properties.PackageManagerFrontendResCache.IconLikelyUnsafeUpdate; - else if (compatibility == PackageCompatibility.None) - icon = Properties.PackageManagerFrontendResCache.IconIncompatibleUpdate; - } - else - { - if (compatibility == PackageCompatibility.Unlikely) - icon = Properties.PackageManagerFrontendResCache.IconLikelyUnsafeInstall; - else if (compatibility == PackageCompatibility.None) - icon = Properties.PackageManagerFrontendResCache.IconIncompatibleInstall; - } - } - - // Calculate drawing layout and data - StringFormat stringFormat = new StringFormat { Trimming = StringTrimming.EllipsisCharacter, Alignment = StringAlignment.Near, FormatFlags = StringFormatFlags.NoWrap }; - Rectangle currentVersionRect; - Rectangle newestVersionRect; - Rectangle iconRect; - { - SizeF currentVersionSize; - SizeF newestVersionSize; - Size iconSize; - // Base info - { - newestVersionSize = g.MeasureString(newVersionText, context.Font, targetRect.Width, stringFormat); - currentVersionSize = g.MeasureString(itemVersionText, context.Font, targetRect.Width, stringFormat); - iconSize = icon != null ? icon.Size : Size.Empty; - } - // Alignment info - { - Size totalTextSize = new Size( - (int)Math.Max(currentVersionSize.Width, newestVersionSize.Width), - (int)(currentVersionSize.Height + newestVersionSize.Height)); - int leftSpacing = (targetRect.Width - totalTextSize.Width - iconSize.Width - 4) / 2; - int iconIndent = iconSize.Width + 4 + leftSpacing; - - iconRect = new Rectangle( - targetRect.X + leftSpacing, - targetRect.Y + targetRect.Height / 2 - iconSize.Height / 2, - iconSize.Width, - iconSize.Height); - newestVersionRect = new Rectangle( - targetRect.X + iconIndent, - targetRect.Y + Math.Max((targetRect.Height - totalTextSize.Height) / 2, 0), - targetRect.Width - iconIndent, - (int)newestVersionSize.Height); - currentVersionRect = new Rectangle( - targetRect.X + iconIndent, - targetRect.Y + (int)newestVersionSize.Height + Math.Max((targetRect.Height - totalTextSize.Height) / 2, 0), - targetRect.Width - iconIndent, - targetRect.Height - (int)newestVersionSize.Height); - } - } - - // Draw background and version texts - if (backgroundBrush != null) - { - g.FillRectangle(backgroundBrush, targetRect); - } - if (icon != null) - { - g.DrawImageUnscaledAndClipped(icon, iconRect); - } - { - bool bothVisible = !string.IsNullOrWhiteSpace(itemVersionText) && !string.IsNullOrWhiteSpace(newVersionText); - highlightItemVersion = highlightItemVersion || !bothVisible; - g.DrawString(newVersionText, context.Font, new SolidBrush(Color.FromArgb((highlightItemVersion ? 128 : 255) / (context.Enabled ? 1 : 2), this.Parent.ForeColor)), newestVersionRect, stringFormat); - g.DrawString(itemVersionText, context.Font, new SolidBrush(Color.FromArgb((highlightItemVersion ? 255 : 128) / (context.Enabled ? 1 : 2), this.Parent.ForeColor)), currentVersionRect, stringFormat); - } - } - public override Size MeasureSize(TreeNodeAdv node, DrawContext context) - { - return new Size(60, 48); - } - - string IToolTipProvider.GetToolTip(TreeNodeAdv node, NodeControl nodeControl) - { - PackageItem item = node.Tag as PackageItem; - if (item == null) return null; - - if (item.IsInstalled) - { - if (item.IsUpdatable) - { - switch (item.Compatibility) - { - case PackageCompatibility.Definite: - return Properties.PackageManagerFrontendRes.TooltipUpdateDefiniteCompatibility; - case PackageCompatibility.Likely: - return Properties.PackageManagerFrontendRes.TooltipUpdateLikelyCompatibility; - case PackageCompatibility.Unlikely: - return Properties.PackageManagerFrontendRes.TooltipUpdateUnlikelyCompatibility; - case PackageCompatibility.None: - return Properties.PackageManagerFrontendRes.TooltipUpdateNoCompatibility; - } - } - else - { - return Properties.PackageManagerFrontendRes.TooltipUpdateUpToDate; - } - } - else - { - switch (item.Compatibility) - { - case PackageCompatibility.Unlikely: - return Properties.PackageManagerFrontendRes.TooltipInstallUnlikelyCompatibility; - case PackageCompatibility.None: - return Properties.PackageManagerFrontendRes.TooltipInstallNoCompatibility; - } - } - - return null; - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/PackageViewDialog.Designer.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/PackageViewDialog.Designer.cs deleted file mode 100644 index 2edab307a..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/PackageViewDialog.Designer.cs +++ /dev/null @@ -1,852 +0,0 @@ -namespace Duality.Editor.Plugins.PackageManagerFrontend -{ - partial class PackageViewDialog - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackageViewDialog)); - this.packageList = new Aga.Controls.Tree.TreeViewAdv(); - this.treeColumnName = new Aga.Controls.Tree.TreeColumn(); - this.treeColumnVersion = new Aga.Controls.Tree.TreeColumn(); - this.treeColumnDate = new Aga.Controls.Tree.TreeColumn(); - this.treeColumnDownloads = new Aga.Controls.Tree.TreeColumn(); - this.treeColumnPackageType = new Aga.Controls.Tree.TreeColumn(); - this.nodeIcon = new Aga.Controls.Tree.NodeControls.NodeIcon(); - this.nodeTextBoxName = new Duality.Editor.Plugins.PackageManagerFrontend.DualityPackageSummaryNodeControl(); - this.nodeTextBoxVersion = new Duality.Editor.Plugins.PackageManagerFrontend.DualityPackageVersionNodeControl(); - this.nodeTextBoxDate = new Duality.Editor.Plugins.PackageManagerFrontend.DualityPackageDateNodeControl(); - this.nodeTextBoxDownloads = new Aga.Controls.Tree.NodeControls.NodeTextBox(); - this.nodeIconPackageType = new Duality.Editor.Plugins.PackageManagerFrontend.DualityPackageTypeNodeControl(); - this.splitMain = new System.Windows.Forms.SplitContainer(); - this.toolStripMain = new System.Windows.Forms.ToolStrip(); - this.toolStripSearchBox = new System.Windows.Forms.ToolStripTextBox(); - this.toolStripLabelSearch = new System.Windows.Forms.ToolStripLabel(); - this.toolStripLabelView = new System.Windows.Forms.ToolStripLabel(); - this.toolStripViewBox = new System.Windows.Forms.ToolStripComboBox(); - this.tableLayoutPanelInfo = new System.Windows.Forms.TableLayoutPanel(); - this.labelPackageVersion = new System.Windows.Forms.Label(); - this.labelPackageUpdatedCaption = new System.Windows.Forms.Label(); - this.labelPackageUpdated = new System.Windows.Forms.Label(); - this.labelPackageVersionCaption = new System.Windows.Forms.Label(); - this.labelPackageTags = new System.Windows.Forms.Label(); - this.labelPackageTagsCaption = new System.Windows.Forms.Label(); - this.labelPackageTitle = new System.Windows.Forms.Label(); - this.labelPackageId = new System.Windows.Forms.Label(); - this.labelPackageDesc = new System.Windows.Forms.Label(); - this.labelPackageWebsiteCaption = new System.Windows.Forms.Label(); - this.labelPackageWebsite = new System.Windows.Forms.LinkLabel(); - this.labelPackageAuthorCaption = new System.Windows.Forms.Label(); - this.labelPackageAuthor = new System.Windows.Forms.Label(); - this.labelPackageLicenseCaption = new System.Windows.Forms.Label(); - this.labelPackageLicense = new System.Windows.Forms.LinkLabel(); - this.textBoxReleaseNotes = new System.Windows.Forms.TextBox(); - this.labelReleaseNotesCaption = new System.Windows.Forms.Label(); - this.buttonClose = new System.Windows.Forms.Button(); - this.panelLowerArea = new System.Windows.Forms.Panel(); - this.buttonAdvanced = new System.Windows.Forms.Button(); - this.labelRequireRestart = new System.Windows.Forms.Label(); - this.flowLayoutBottom = new System.Windows.Forms.FlowLayoutPanel(); - this.buttonApply = new System.Windows.Forms.Button(); - this.bottomFlowSpacer1 = new System.Windows.Forms.Label(); - this.buttonUninstall = new System.Windows.Forms.Button(); - this.buttonInstall = new System.Windows.Forms.Button(); - this.buttonUpdate = new System.Windows.Forms.Button(); - this.bottomFlowSpacer2 = new System.Windows.Forms.Label(); - this.buttonUpdateAll = new System.Windows.Forms.Button(); - this.miniToolStrip = new System.Windows.Forms.ToolStrip(); - this.labelHeaderText = new System.Windows.Forms.Label(); - this.labelHeader = new System.Windows.Forms.Label(); - this.toolTip = new System.Windows.Forms.ToolTip(this.components); - this.timerPackageModelChanged = new System.Windows.Forms.Timer(this.components); - this.panelTitleImage = new System.Windows.Forms.Panel(); - this.contextMenuAdvanced = new System.Windows.Forms.ContextMenuStrip(this.components); - this.itemReInstallAll = new System.Windows.Forms.ToolStripMenuItem(); - ((System.ComponentModel.ISupportInitialize)(this.splitMain)).BeginInit(); - this.splitMain.Panel1.SuspendLayout(); - this.splitMain.Panel2.SuspendLayout(); - this.splitMain.SuspendLayout(); - this.toolStripMain.SuspendLayout(); - this.tableLayoutPanelInfo.SuspendLayout(); - this.panelLowerArea.SuspendLayout(); - this.flowLayoutBottom.SuspendLayout(); - this.contextMenuAdvanced.SuspendLayout(); - this.SuspendLayout(); - // - // packageList - // - this.packageList.AllowColumnReorder = true; - this.packageList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.packageList.AsyncExpanding = true; - this.packageList.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(196)))), ((int)(((byte)(196))))); - this.packageList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.packageList.Columns.Add(this.treeColumnName); - this.packageList.Columns.Add(this.treeColumnVersion); - this.packageList.Columns.Add(this.treeColumnDate); - this.packageList.Columns.Add(this.treeColumnDownloads); - this.packageList.Columns.Add(this.treeColumnPackageType); - this.packageList.DefaultToolTipProvider = null; - this.packageList.DragDropMarkColor = System.Drawing.Color.Black; - this.packageList.FullRowSelect = true; - this.packageList.FullRowSelectActiveColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.packageList.FullRowSelectInactiveColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(212)))), ((int)(((byte)(212))))); - this.packageList.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(92)))), ((int)(((byte)(92)))), ((int)(((byte)(92))))); - this.packageList.LoadOnDemand = true; - this.packageList.Location = new System.Drawing.Point(0, 29); - this.packageList.Model = null; - this.packageList.Name = "packageList"; - this.packageList.NodeControls.Add(this.nodeIcon); - this.packageList.NodeControls.Add(this.nodeTextBoxName); - this.packageList.NodeControls.Add(this.nodeTextBoxVersion); - this.packageList.NodeControls.Add(this.nodeTextBoxDate); - this.packageList.NodeControls.Add(this.nodeTextBoxDownloads); - this.packageList.NodeControls.Add(this.nodeIconPackageType); - this.packageList.NodeFilter = null; - this.packageList.RowHeight = 48; - this.packageList.SelectedNode = null; - this.packageList.ShowLines = false; - this.packageList.ShowNodeToolTips = true; - this.packageList.ShowPlusMinus = false; - this.packageList.Size = new System.Drawing.Size(602, 363); - this.packageList.TabIndex = 0; - this.packageList.Text = "packageList"; - this.packageList.UseColumns = true; - this.packageList.ColumnClicked += new System.EventHandler(this.packageList_ColumnClicked); - this.packageList.SelectionChanged += new System.EventHandler(this.packageList_SelectionChanged); - this.packageList.Resize += new System.EventHandler(this.packageList_Resize); - // - // treeColumnName - // - this.treeColumnName.Header = "Name"; - this.treeColumnName.SortOrder = System.Windows.Forms.SortOrder.None; - this.treeColumnName.TooltipText = null; - this.treeColumnName.Width = 455; - // - // treeColumnVersion - // - this.treeColumnVersion.Header = "Version"; - this.treeColumnVersion.SortOrder = System.Windows.Forms.SortOrder.None; - this.treeColumnVersion.TooltipText = null; - this.treeColumnVersion.Width = 80; - // - // treeColumnDate - // - this.treeColumnDate.Header = "Date"; - this.treeColumnDate.IsVisible = false; - this.treeColumnDate.SortOrder = System.Windows.Forms.SortOrder.None; - this.treeColumnDate.TooltipText = null; - this.treeColumnDate.Width = 80; - // - // treeColumnDownloads - // - this.treeColumnDownloads.Header = "Downloads"; - this.treeColumnDownloads.IsVisible = false; - this.treeColumnDownloads.SortOrder = System.Windows.Forms.SortOrder.None; - this.treeColumnDownloads.TooltipText = null; - this.treeColumnDownloads.Width = 65; - // - // treeColumnPackageType - // - this.treeColumnPackageType.Header = "Type"; - this.treeColumnPackageType.SortOrder = System.Windows.Forms.SortOrder.None; - this.treeColumnPackageType.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.treeColumnPackageType.TooltipText = null; - this.treeColumnPackageType.Width = 40; - // - // nodeIcon - // - this.nodeIcon.DataPropertyName = "Icon"; - this.nodeIcon.LeftMargin = 1; - this.nodeIcon.ParentColumn = this.treeColumnName; - this.nodeIcon.ScaleMode = Aga.Controls.Tree.ImageScaleMode.Clip; - // - // nodeTextBoxName - // - this.nodeTextBoxName.LeftMargin = 6; - this.nodeTextBoxName.ParentColumn = this.treeColumnName; - // - // nodeTextBoxVersion - // - this.nodeTextBoxVersion.LeftMargin = 3; - this.nodeTextBoxVersion.PackageManager = null; - this.nodeTextBoxVersion.ParentColumn = this.treeColumnVersion; - // - // nodeTextBoxDate - // - this.nodeTextBoxDate.LeftMargin = 3; - this.nodeTextBoxDate.PackageManager = null; - this.nodeTextBoxDate.ParentColumn = this.treeColumnDate; - // - // nodeTextBoxDownloads - // - this.nodeTextBoxDownloads.DataPropertyName = "Downloads"; - this.nodeTextBoxDownloads.IncrementalSearchEnabled = true; - this.nodeTextBoxDownloads.LeftMargin = 3; - this.nodeTextBoxDownloads.ParentColumn = this.treeColumnDownloads; - this.nodeTextBoxDownloads.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nodeTextBoxDownloads.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; - // - // nodeIconPackageType - // - this.nodeIconPackageType.LeftMargin = 0; - this.nodeIconPackageType.ParentColumn = this.treeColumnPackageType; - // - // splitMain - // - this.splitMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.splitMain.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; - this.splitMain.Location = new System.Drawing.Point(3, 77); - this.splitMain.Margin = new System.Windows.Forms.Padding(0); - this.splitMain.Name = "splitMain"; - // - // splitMain.Panel1 - // - this.splitMain.Panel1.Controls.Add(this.packageList); - this.splitMain.Panel1.Controls.Add(this.toolStripMain); - // - // splitMain.Panel2 - // - this.splitMain.Panel2.Controls.Add(this.tableLayoutPanelInfo); - this.splitMain.Panel2MinSize = 150; - this.splitMain.Size = new System.Drawing.Size(895, 392); - this.splitMain.SplitterDistance = 602; - this.splitMain.TabIndex = 0; - this.splitMain.TabStop = false; - // - // toolStripMain - // - this.toolStripMain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(212)))), ((int)(((byte)(212))))); - this.toolStripMain.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.toolStripMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripSearchBox, - this.toolStripLabelSearch, - this.toolStripLabelView, - this.toolStripViewBox}); - this.toolStripMain.Location = new System.Drawing.Point(0, 0); - this.toolStripMain.Name = "toolStripMain"; - this.toolStripMain.Padding = new System.Windows.Forms.Padding(3, 3, 0, 3); - this.toolStripMain.Size = new System.Drawing.Size(602, 29); - this.toolStripMain.TabIndex = 1; - // - // toolStripSearchBox - // - this.toolStripSearchBox.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.toolStripSearchBox.AutoSize = false; - this.toolStripSearchBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(196)))), ((int)(((byte)(196))))); - this.toolStripSearchBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.toolStripSearchBox.Name = "toolStripSearchBox"; - this.toolStripSearchBox.Size = new System.Drawing.Size(146, 23); - this.toolStripSearchBox.TextChanged += new System.EventHandler(this.toolStripSearchBox_TextChanged); - // - // toolStripLabelSearch - // - this.toolStripLabelSearch.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.toolStripLabelSearch.Name = "toolStripLabelSearch"; - this.toolStripLabelSearch.Size = new System.Drawing.Size(45, 20); - this.toolStripLabelSearch.Text = "Search:"; - // - // toolStripLabelView - // - this.toolStripLabelView.Margin = new System.Windows.Forms.Padding(3, 1, 0, 2); - this.toolStripLabelView.Name = "toolStripLabelView"; - this.toolStripLabelView.Size = new System.Drawing.Size(35, 20); - this.toolStripLabelView.Text = "View:"; - // - // toolStripViewBox - // - this.toolStripViewBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.toolStripViewBox.FlatStyle = System.Windows.Forms.FlatStyle.Standard; - this.toolStripViewBox.Name = "toolStripViewBox"; - this.toolStripViewBox.Size = new System.Drawing.Size(121, 23); - this.toolStripViewBox.DropDownClosed += new System.EventHandler(this.toolStripViewBox_DropDownClosed); - this.toolStripViewBox.SelectedIndexChanged += new System.EventHandler(this.toolStripViewBox_SelectedIndexChanged); - // - // tableLayoutPanelInfo - // - this.tableLayoutPanelInfo.ColumnCount = 2; - this.tableLayoutPanelInfo.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanelInfo.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageVersion, 1, 9); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageUpdatedCaption, 0, 10); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageUpdated, 1, 10); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageVersionCaption, 0, 9); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageTags, 1, 8); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageTagsCaption, 0, 8); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageTitle, 0, 0); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageId, 0, 1); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageDesc, 0, 2); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageWebsiteCaption, 0, 5); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageWebsite, 1, 5); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageAuthorCaption, 0, 7); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageAuthor, 1, 7); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageLicenseCaption, 0, 6); - this.tableLayoutPanelInfo.Controls.Add(this.labelPackageLicense, 1, 6); - this.tableLayoutPanelInfo.Controls.Add(this.textBoxReleaseNotes, 0, 4); - this.tableLayoutPanelInfo.Controls.Add(this.labelReleaseNotesCaption, 0, 3); - this.tableLayoutPanelInfo.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanelInfo.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanelInfo.Name = "tableLayoutPanelInfo"; - this.tableLayoutPanelInfo.RowCount = 11; - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelInfo.Size = new System.Drawing.Size(289, 392); - this.tableLayoutPanelInfo.TabIndex = 0; - // - // labelPackageVersion - // - this.labelPackageVersion.AutoSize = true; - this.labelPackageVersion.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageVersion.Location = new System.Drawing.Point(60, 357); - this.labelPackageVersion.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageVersion.Name = "labelPackageVersion"; - this.labelPackageVersion.Size = new System.Drawing.Size(226, 13); - this.labelPackageVersion.TabIndex = 12; - this.labelPackageVersion.Text = "1.0.0.0"; - this.labelPackageVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelPackageUpdatedCaption - // - this.labelPackageUpdatedCaption.AutoSize = true; - this.labelPackageUpdatedCaption.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageUpdatedCaption.Location = new System.Drawing.Point(3, 376); - this.labelPackageUpdatedCaption.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageUpdatedCaption.Name = "labelPackageUpdatedCaption"; - this.labelPackageUpdatedCaption.Size = new System.Drawing.Size(51, 13); - this.labelPackageUpdatedCaption.TabIndex = 11; - this.labelPackageUpdatedCaption.Text = "Updated:"; - this.labelPackageUpdatedCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelPackageUpdated - // - this.labelPackageUpdated.AutoSize = true; - this.labelPackageUpdated.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageUpdated.Location = new System.Drawing.Point(60, 376); - this.labelPackageUpdated.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageUpdated.Name = "labelPackageUpdated"; - this.labelPackageUpdated.Size = new System.Drawing.Size(226, 13); - this.labelPackageUpdated.TabIndex = 10; - this.labelPackageUpdated.Text = "1900-01-01"; - this.labelPackageUpdated.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelPackageVersionCaption - // - this.labelPackageVersionCaption.AutoSize = true; - this.labelPackageVersionCaption.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageVersionCaption.Location = new System.Drawing.Point(3, 357); - this.labelPackageVersionCaption.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageVersionCaption.Name = "labelPackageVersionCaption"; - this.labelPackageVersionCaption.Size = new System.Drawing.Size(51, 13); - this.labelPackageVersionCaption.TabIndex = 9; - this.labelPackageVersionCaption.Text = "Version:"; - this.labelPackageVersionCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelPackageTags - // - this.labelPackageTags.AutoSize = true; - this.labelPackageTags.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageTags.Location = new System.Drawing.Point(60, 338); - this.labelPackageTags.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageTags.Name = "labelPackageTags"; - this.labelPackageTags.Size = new System.Drawing.Size(226, 13); - this.labelPackageTags.TabIndex = 8; - this.labelPackageTags.Text = "Tag1, Tag2, Tag3"; - this.labelPackageTags.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelPackageTagsCaption - // - this.labelPackageTagsCaption.AutoSize = true; - this.labelPackageTagsCaption.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageTagsCaption.Location = new System.Drawing.Point(3, 338); - this.labelPackageTagsCaption.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageTagsCaption.Name = "labelPackageTagsCaption"; - this.labelPackageTagsCaption.Size = new System.Drawing.Size(51, 13); - this.labelPackageTagsCaption.TabIndex = 7; - this.labelPackageTagsCaption.Text = "Tags:"; - this.labelPackageTagsCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelPackageTitle - // - this.labelPackageTitle.AutoSize = true; - this.tableLayoutPanelInfo.SetColumnSpan(this.labelPackageTitle, 2); - this.labelPackageTitle.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelPackageTitle.Location = new System.Drawing.Point(3, 3); - this.labelPackageTitle.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageTitle.Name = "labelPackageTitle"; - this.labelPackageTitle.Size = new System.Drawing.Size(283, 18); - this.labelPackageTitle.TabIndex = 0; - this.labelPackageTitle.Text = "Package Title"; - // - // labelPackageId - // - this.labelPackageId.AutoEllipsis = true; - this.labelPackageId.AutoSize = true; - this.tableLayoutPanelInfo.SetColumnSpan(this.labelPackageId, 2); - this.labelPackageId.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageId.ForeColor = System.Drawing.SystemColors.GrayText; - this.labelPackageId.Location = new System.Drawing.Point(3, 25); - this.labelPackageId.Margin = new System.Windows.Forms.Padding(3, 1, 3, 12); - this.labelPackageId.Name = "labelPackageId"; - this.labelPackageId.Size = new System.Drawing.Size(283, 13); - this.labelPackageId.TabIndex = 1; - this.labelPackageId.Text = "Package Id"; - // - // labelPackageDesc - // - this.labelPackageDesc.AutoEllipsis = true; - this.labelPackageDesc.AutoSize = true; - this.tableLayoutPanelInfo.SetColumnSpan(this.labelPackageDesc, 2); - this.labelPackageDesc.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageDesc.Location = new System.Drawing.Point(3, 50); - this.labelPackageDesc.Name = "labelPackageDesc"; - this.labelPackageDesc.Size = new System.Drawing.Size(283, 102); - this.labelPackageDesc.TabIndex = 2; - this.labelPackageDesc.Text = "This area contains the complete package description."; - // - // labelPackageWebsiteCaption - // - this.labelPackageWebsiteCaption.AutoSize = true; - this.labelPackageWebsiteCaption.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageWebsiteCaption.Location = new System.Drawing.Point(3, 281); - this.labelPackageWebsiteCaption.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageWebsiteCaption.Name = "labelPackageWebsiteCaption"; - this.labelPackageWebsiteCaption.Size = new System.Drawing.Size(51, 13); - this.labelPackageWebsiteCaption.TabIndex = 3; - this.labelPackageWebsiteCaption.Text = "Website:"; - this.labelPackageWebsiteCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelPackageWebsite - // - this.labelPackageWebsite.AutoSize = true; - this.labelPackageWebsite.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageWebsite.Location = new System.Drawing.Point(60, 281); - this.labelPackageWebsite.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageWebsite.Name = "labelPackageWebsite"; - this.labelPackageWebsite.Size = new System.Drawing.Size(226, 13); - this.labelPackageWebsite.TabIndex = 4; - this.labelPackageWebsite.TabStop = true; - this.labelPackageWebsite.Text = "http://www.example.com"; - this.labelPackageWebsite.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.labelPackageWebsite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.labelPackageWebsite_LinkClicked); - // - // labelPackageAuthorCaption - // - this.labelPackageAuthorCaption.AutoSize = true; - this.labelPackageAuthorCaption.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageAuthorCaption.Location = new System.Drawing.Point(3, 319); - this.labelPackageAuthorCaption.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageAuthorCaption.Name = "labelPackageAuthorCaption"; - this.labelPackageAuthorCaption.Size = new System.Drawing.Size(51, 13); - this.labelPackageAuthorCaption.TabIndex = 5; - this.labelPackageAuthorCaption.Text = "Authors:"; - this.labelPackageAuthorCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelPackageAuthor - // - this.labelPackageAuthor.AutoSize = true; - this.labelPackageAuthor.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageAuthor.Location = new System.Drawing.Point(60, 319); - this.labelPackageAuthor.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageAuthor.Name = "labelPackageAuthor"; - this.labelPackageAuthor.Size = new System.Drawing.Size(226, 13); - this.labelPackageAuthor.TabIndex = 6; - this.labelPackageAuthor.Text = "Author1, Author2"; - this.labelPackageAuthor.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelPackageLicenseCaption - // - this.labelPackageLicenseCaption.AutoSize = true; - this.labelPackageLicenseCaption.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageLicenseCaption.Location = new System.Drawing.Point(3, 297); - this.labelPackageLicenseCaption.Name = "labelPackageLicenseCaption"; - this.labelPackageLicenseCaption.Size = new System.Drawing.Size(51, 19); - this.labelPackageLicenseCaption.TabIndex = 13; - this.labelPackageLicenseCaption.Text = "License:"; - this.labelPackageLicenseCaption.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // labelPackageLicense - // - this.labelPackageLicense.AutoSize = true; - this.labelPackageLicense.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelPackageLicense.Location = new System.Drawing.Point(60, 300); - this.labelPackageLicense.Margin = new System.Windows.Forms.Padding(3); - this.labelPackageLicense.Name = "labelPackageLicense"; - this.labelPackageLicense.Size = new System.Drawing.Size(226, 13); - this.labelPackageLicense.TabIndex = 14; - this.labelPackageLicense.TabStop = true; - this.labelPackageLicense.Text = "http://www.license.com"; - this.labelPackageLicense.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.labelPackageLicense.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.labelPackageLicense_LinkClicked); - // - // textBoxReleaseNotes - // - this.textBoxReleaseNotes.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(196)))), ((int)(((byte)(196))))); - this.textBoxReleaseNotes.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.tableLayoutPanelInfo.SetColumnSpan(this.textBoxReleaseNotes, 2); - this.textBoxReleaseNotes.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxReleaseNotes.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.textBoxReleaseNotes.Location = new System.Drawing.Point(3, 177); - this.textBoxReleaseNotes.Multiline = true; - this.textBoxReleaseNotes.Name = "textBoxReleaseNotes"; - this.textBoxReleaseNotes.ReadOnly = true; - this.textBoxReleaseNotes.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.textBoxReleaseNotes.Size = new System.Drawing.Size(283, 98); - this.textBoxReleaseNotes.TabIndex = 15; - this.textBoxReleaseNotes.Text = "Release Notes:\r\n--------------"; - // - // labelReleaseNotesCaption - // - this.labelReleaseNotesCaption.AutoSize = true; - this.tableLayoutPanelInfo.SetColumnSpan(this.labelReleaseNotesCaption, 2); - this.labelReleaseNotesCaption.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelReleaseNotesCaption.Location = new System.Drawing.Point(3, 158); - this.labelReleaseNotesCaption.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3); - this.labelReleaseNotesCaption.Name = "labelReleaseNotesCaption"; - this.labelReleaseNotesCaption.Size = new System.Drawing.Size(283, 13); - this.labelReleaseNotesCaption.TabIndex = 16; - this.labelReleaseNotesCaption.Text = "Release Notes:"; - this.labelReleaseNotesCaption.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // buttonClose - // - this.buttonClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonClose.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonClose.Location = new System.Drawing.Point(399, 0); - this.buttonClose.Margin = new System.Windows.Forms.Padding(0); - this.buttonClose.Name = "buttonClose"; - this.buttonClose.Size = new System.Drawing.Size(75, 23); - this.buttonClose.TabIndex = 11; - this.buttonClose.Text = "Close"; - this.buttonClose.UseVisualStyleBackColor = true; - // - // panelLowerArea - // - this.panelLowerArea.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.panelLowerArea.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(196)))), ((int)(((byte)(196))))); - this.panelLowerArea.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelLowerArea.Controls.Add(this.buttonAdvanced); - this.panelLowerArea.Controls.Add(this.labelRequireRestart); - this.panelLowerArea.Controls.Add(this.flowLayoutBottom); - this.panelLowerArea.Location = new System.Drawing.Point(-3, 472); - this.panelLowerArea.Name = "panelLowerArea"; - this.panelLowerArea.Size = new System.Drawing.Size(901, 39); - this.panelLowerArea.TabIndex = 12; - // - // buttonAdvanced - // - this.buttonAdvanced.Location = new System.Drawing.Point(14, 7); - this.buttonAdvanced.Name = "buttonAdvanced"; - this.buttonAdvanced.Size = new System.Drawing.Size(85, 23); - this.buttonAdvanced.TabIndex = 17; - this.buttonAdvanced.Text = "Advanced..."; - this.buttonAdvanced.UseVisualStyleBackColor = true; - this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvanced_Click); - // - // labelRequireRestart - // - this.labelRequireRestart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelRequireRestart.ForeColor = System.Drawing.Color.Blue; - this.labelRequireRestart.Location = new System.Drawing.Point(114, 2); - this.labelRequireRestart.Name = "labelRequireRestart"; - this.labelRequireRestart.Size = new System.Drawing.Size(366, 32); - this.labelRequireRestart.TabIndex = 16; - this.labelRequireRestart.Text = "Click Apply in order to restart Duality and finish the update."; - this.labelRequireRestart.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // flowLayoutBottom - // - this.flowLayoutBottom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.flowLayoutBottom.Controls.Add(this.buttonClose); - this.flowLayoutBottom.Controls.Add(this.buttonApply); - this.flowLayoutBottom.Controls.Add(this.bottomFlowSpacer1); - this.flowLayoutBottom.Controls.Add(this.buttonUninstall); - this.flowLayoutBottom.Controls.Add(this.buttonInstall); - this.flowLayoutBottom.Controls.Add(this.buttonUpdate); - this.flowLayoutBottom.Controls.Add(this.bottomFlowSpacer2); - this.flowLayoutBottom.Controls.Add(this.buttonUpdateAll); - this.flowLayoutBottom.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutBottom.Location = new System.Drawing.Point(415, 7); - this.flowLayoutBottom.Margin = new System.Windows.Forms.Padding(0); - this.flowLayoutBottom.Name = "flowLayoutBottom"; - this.flowLayoutBottom.Size = new System.Drawing.Size(474, 23); - this.flowLayoutBottom.TabIndex = 15; - // - // buttonApply - // - this.buttonApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonApply.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonApply.Location = new System.Drawing.Point(324, 0); - this.buttonApply.Margin = new System.Windows.Forms.Padding(0); - this.buttonApply.Name = "buttonApply"; - this.buttonApply.Size = new System.Drawing.Size(75, 23); - this.buttonApply.TabIndex = 15; - this.buttonApply.Text = "Apply"; - this.toolTip.SetToolTip(this.buttonApply, "Restart the editor to apply changes."); - this.buttonApply.UseVisualStyleBackColor = true; - this.buttonApply.Click += new System.EventHandler(this.buttonApply_Click); - // - // bottomFlowSpacer1 - // - this.bottomFlowSpacer1.Location = new System.Drawing.Point(314, 0); - this.bottomFlowSpacer1.Margin = new System.Windows.Forms.Padding(0); - this.bottomFlowSpacer1.Name = "bottomFlowSpacer1"; - this.bottomFlowSpacer1.Size = new System.Drawing.Size(10, 15); - this.bottomFlowSpacer1.TabIndex = 16; - // - // buttonUninstall - // - this.buttonUninstall.Location = new System.Drawing.Point(239, 0); - this.buttonUninstall.Margin = new System.Windows.Forms.Padding(0); - this.buttonUninstall.Name = "buttonUninstall"; - this.buttonUninstall.Size = new System.Drawing.Size(75, 23); - this.buttonUninstall.TabIndex = 14; - this.buttonUninstall.Text = "Uninstall"; - this.buttonUninstall.UseVisualStyleBackColor = true; - this.buttonUninstall.Click += new System.EventHandler(this.buttonUninstall_Click); - // - // buttonInstall - // - this.buttonInstall.Location = new System.Drawing.Point(164, 0); - this.buttonInstall.Margin = new System.Windows.Forms.Padding(0); - this.buttonInstall.Name = "buttonInstall"; - this.buttonInstall.Size = new System.Drawing.Size(75, 23); - this.buttonInstall.TabIndex = 12; - this.buttonInstall.Text = "Install"; - this.buttonInstall.UseVisualStyleBackColor = true; - this.buttonInstall.Click += new System.EventHandler(this.buttonInstall_Click); - // - // buttonUpdate - // - this.buttonUpdate.Location = new System.Drawing.Point(89, 0); - this.buttonUpdate.Margin = new System.Windows.Forms.Padding(0); - this.buttonUpdate.Name = "buttonUpdate"; - this.buttonUpdate.Size = new System.Drawing.Size(75, 23); - this.buttonUpdate.TabIndex = 13; - this.buttonUpdate.Text = "Update"; - this.toolTip.SetToolTip(this.buttonUpdate, "Update the Package to the newest version"); - this.buttonUpdate.UseVisualStyleBackColor = true; - this.buttonUpdate.Click += new System.EventHandler(this.buttonUpdate_Click); - // - // bottomFlowSpacer2 - // - this.bottomFlowSpacer2.Location = new System.Drawing.Point(79, 0); - this.bottomFlowSpacer2.Margin = new System.Windows.Forms.Padding(0); - this.bottomFlowSpacer2.Name = "bottomFlowSpacer2"; - this.bottomFlowSpacer2.Size = new System.Drawing.Size(10, 15); - this.bottomFlowSpacer2.TabIndex = 19; - // - // buttonUpdateAll - // - this.buttonUpdateAll.Location = new System.Drawing.Point(4, 0); - this.buttonUpdateAll.Margin = new System.Windows.Forms.Padding(0); - this.buttonUpdateAll.Name = "buttonUpdateAll"; - this.buttonUpdateAll.Size = new System.Drawing.Size(75, 23); - this.buttonUpdateAll.TabIndex = 18; - this.buttonUpdateAll.Text = "Update All"; - this.toolTip.SetToolTip(this.buttonUpdateAll, "Update all packages to their newest version"); - this.buttonUpdateAll.UseVisualStyleBackColor = true; - this.buttonUpdateAll.Click += new System.EventHandler(this.buttonUpdateAll_Click); - // - // miniToolStrip - // - this.miniToolStrip.AutoSize = false; - this.miniToolStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(212)))), ((int)(((byte)(212))))); - this.miniToolStrip.CanOverflow = false; - this.miniToolStrip.Dock = System.Windows.Forms.DockStyle.None; - this.miniToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; - this.miniToolStrip.Location = new System.Drawing.Point(1, 2); - this.miniToolStrip.Name = "miniToolStrip"; - this.miniToolStrip.Padding = new System.Windows.Forms.Padding(0, 0, 1, 3); - this.miniToolStrip.Size = new System.Drawing.Size(414, 26); - this.miniToolStrip.TabIndex = 1; - // - // labelHeaderText - // - this.labelHeaderText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelHeaderText.Location = new System.Drawing.Point(82, 35); - this.labelHeaderText.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0); - this.labelHeaderText.Name = "labelHeaderText"; - this.labelHeaderText.Size = new System.Drawing.Size(803, 42); - this.labelHeaderText.TabIndex = 13; - this.labelHeaderText.Text = "Each Duality project consists of multiple Packages that can carry plugins and dat" + - "a. This dialog provides an overview of installed and available Packages and help" + - "s you manage them."; - // - // labelHeader - // - this.labelHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelHeader.Location = new System.Drawing.Point(79, 7); - this.labelHeader.Margin = new System.Windows.Forms.Padding(0, 0, 0, 3); - this.labelHeader.Name = "labelHeader"; - this.labelHeader.Size = new System.Drawing.Size(806, 22); - this.labelHeader.TabIndex = 17; - this.labelHeader.Text = "Manage Duality Packages"; - this.labelHeader.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // timerPackageModelChanged - // - this.timerPackageModelChanged.Tick += new System.EventHandler(this.timerPackageModelChanged_Tick); - // - // panelTitleImage - // - this.panelTitleImage.BackgroundImage = global::Duality.Editor.Plugins.PackageManagerFrontend.Properties.Resources.packagebig; - this.panelTitleImage.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.panelTitleImage.Location = new System.Drawing.Point(8, 7); - this.panelTitleImage.Name = "panelTitleImage"; - this.panelTitleImage.Size = new System.Drawing.Size(68, 67); - this.panelTitleImage.TabIndex = 18; - // - // contextMenuAdvanced - // - this.contextMenuAdvanced.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.itemReInstallAll}); - this.contextMenuAdvanced.Name = "contextMenuAdvanced"; - this.contextMenuAdvanced.Size = new System.Drawing.Size(191, 26); - // - // itemReInstallAll - // - this.itemReInstallAll.Name = "itemReInstallAll"; - this.itemReInstallAll.Size = new System.Drawing.Size(190, 22); - this.itemReInstallAll.Text = "Re-Install all Packages"; - this.itemReInstallAll.Click += new System.EventHandler(this.itemReInstallAll_Click); - // - // PackageViewDialog - // - this.AcceptButton = this.buttonApply; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(212)))), ((int)(((byte)(212))))); - this.CancelButton = this.buttonClose; - this.ClientSize = new System.Drawing.Size(897, 510); - this.Controls.Add(this.panelTitleImage); - this.Controls.Add(this.labelHeader); - this.Controls.Add(this.labelHeaderText); - this.Controls.Add(this.splitMain); - this.Controls.Add(this.panelLowerArea); - this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(600, 400); - this.Name = "PackageViewDialog"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Package Management"; - this.splitMain.Panel1.ResumeLayout(false); - this.splitMain.Panel1.PerformLayout(); - this.splitMain.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitMain)).EndInit(); - this.splitMain.ResumeLayout(false); - this.toolStripMain.ResumeLayout(false); - this.toolStripMain.PerformLayout(); - this.tableLayoutPanelInfo.ResumeLayout(false); - this.tableLayoutPanelInfo.PerformLayout(); - this.panelLowerArea.ResumeLayout(false); - this.flowLayoutBottom.ResumeLayout(false); - this.contextMenuAdvanced.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private Aga.Controls.Tree.TreeViewAdv packageList; - private Duality.Editor.Plugins.PackageManagerFrontend.DualityPackageSummaryNodeControl nodeTextBoxName; - private System.Windows.Forms.SplitContainer splitMain; - private System.Windows.Forms.Button buttonClose; - private System.Windows.Forms.Panel panelLowerArea; - private System.Windows.Forms.ToolStrip miniToolStrip; - private System.Windows.Forms.ToolStripTextBox toolStripSearchBox; - private System.Windows.Forms.ToolStripLabel toolStripLabelSearch; - private System.Windows.Forms.ToolStrip toolStripMain; - private System.Windows.Forms.ToolStripLabel toolStripLabelView; - private System.Windows.Forms.ToolStripComboBox toolStripViewBox; - private Aga.Controls.Tree.TreeColumn treeColumnName; - private Aga.Controls.Tree.TreeColumn treeColumnVersion; - private Aga.Controls.Tree.TreeColumn treeColumnDownloads; - private Duality.Editor.Plugins.PackageManagerFrontend.DualityPackageVersionNodeControl nodeTextBoxVersion; - private Aga.Controls.Tree.NodeControls.NodeTextBox nodeTextBoxDownloads; - private System.Windows.Forms.Label labelHeaderText; - private System.Windows.Forms.Label labelHeader; - private System.Windows.Forms.Panel panelTitleImage; - private Aga.Controls.Tree.NodeControls.NodeIcon nodeIcon; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanelInfo; - private System.Windows.Forms.Label labelPackageTitle; - private System.Windows.Forms.Label labelPackageId; - private System.Windows.Forms.Label labelPackageDesc; - private System.Windows.Forms.Label labelPackageWebsiteCaption; - private System.Windows.Forms.LinkLabel labelPackageWebsite; - private System.Windows.Forms.Label labelPackageTagsCaption; - private System.Windows.Forms.Label labelPackageAuthorCaption; - private System.Windows.Forms.Label labelPackageAuthor; - private System.Windows.Forms.Label labelPackageUpdated; - private System.Windows.Forms.Label labelPackageVersionCaption; - private System.Windows.Forms.Label labelPackageTags; - private System.Windows.Forms.FlowLayoutPanel flowLayoutBottom; - private System.Windows.Forms.Button buttonApply; - private System.Windows.Forms.Label bottomFlowSpacer1; - private System.Windows.Forms.Button buttonUninstall; - private System.Windows.Forms.Button buttonInstall; - private System.Windows.Forms.Button buttonUpdate; - private System.Windows.Forms.Label labelPackageUpdatedCaption; - private System.Windows.Forms.Label labelPackageVersion; - private System.Windows.Forms.Label labelRequireRestart; - private System.Windows.Forms.ToolTip toolTip; - private System.Windows.Forms.Label bottomFlowSpacer2; - private System.Windows.Forms.Button buttonUpdateAll; - private System.Windows.Forms.Timer timerPackageModelChanged; - private Aga.Controls.Tree.TreeColumn treeColumnPackageType; - private Duality.Editor.Plugins.PackageManagerFrontend.DualityPackageTypeNodeControl nodeIconPackageType; - private Aga.Controls.Tree.TreeColumn treeColumnDate; - private Duality.Editor.Plugins.PackageManagerFrontend.DualityPackageDateNodeControl nodeTextBoxDate; - private System.Windows.Forms.Button buttonAdvanced; - private System.Windows.Forms.ContextMenuStrip contextMenuAdvanced; - private System.Windows.Forms.ToolStripMenuItem itemReInstallAll; - private System.Windows.Forms.Label labelPackageLicenseCaption; - private System.Windows.Forms.LinkLabel labelPackageLicense; - private System.Windows.Forms.TextBox textBoxReleaseNotes; - private System.Windows.Forms.Label labelReleaseNotesCaption; - } -} \ No newline at end of file diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/PackageViewDialog.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/PackageViewDialog.cs deleted file mode 100644 index ad5dc6ccd..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/PackageViewDialog.cs +++ /dev/null @@ -1,833 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Diagnostics; -using System.Xml.Linq; -using System.Windows.Forms; - -using WeifenLuo.WinFormsUI.Docking; - -using Aga.Controls.Tree; -using Aga.Controls.Tree.NodeControls; - -using Duality.IO; - -using Duality.Editor.Properties; -using Duality.Editor.PackageManagement; -using Duality.Editor.Forms; -using Duality.Editor.Plugins.PackageManagerFrontend.Properties; -using Duality.Editor.Plugins.PackageManagerFrontend.TreeModels; - -namespace Duality.Editor.Plugins.PackageManagerFrontend -{ - public partial class PackageViewDialog : Form, IToolTipProvider - { - public enum DisplayMode - { - None, - - Installed, - Online - } - private class FilterBoxItem - { - private DisplayMode display; - private string name; - - public DisplayMode Display - { - get { return this.display; } - } - public string Name - { - get { return this.name; } - } - - public FilterBoxItem(DisplayMode display, string name) - { - this.display = display; - this.name = name; - } - - public override string ToString() - { - return this.name; - } - } - private class PackageListItemComparer : IComparer - { - public enum SortMode - { - Name, - Version, - Date, - Downloads, - PackageType, - CombinedScore - } - - private SortOrder sortOrder = SortOrder.Ascending; - private SortMode sortMode = SortMode.Name; - - public PackageListItemComparer(SortMode mode, SortOrder order) - { - this.sortMode = mode; - this.sortOrder = order; - } - - public int Compare(BaseItem x, BaseItem y) - { - PackageItem itemA = x as PackageItem; - PackageItem itemB = y as PackageItem; - - if (itemA == itemB) return 0; - if (itemA == null) return this.sortOrder == SortOrder.Ascending ? 1 : -1; - if (itemB == null) return this.sortOrder == SortOrder.Ascending ? -1 : 1; - - int result = 0; - if (result == 0 || this.sortMode == SortMode.Version) - { - if (itemA.Version < itemB.Version) result = -1; - else if (itemA.Version > itemB.Version) result = 1; - } - if (result == 0 || this.sortMode == SortMode.Date) - { - if (itemA.ItemPackageInfo.PublishDate < itemB.ItemPackageInfo.PublishDate) result = -1; - else if (itemA.ItemPackageInfo.PublishDate > itemB.ItemPackageInfo.PublishDate) result = 1; - } - if (result == 0 || this.sortMode == SortMode.Downloads) - { - int itemANum = itemA.Downloads.HasValue ? itemA.Downloads.Value : 0; - int itemBNum = itemB.Downloads.HasValue ? itemB.Downloads.Value : 0; - result = itemANum - itemBNum; - } - if (result == 0 || this.sortMode == SortMode.Name) - { - result = string.Compare(itemA.Title, itemB.Title); - } - if (result == 0 || this.sortMode == SortMode.PackageType) - { - result = (int)itemA.Type - (int)itemB.Type; - } - if (result == 0 || this.sortMode == SortMode.CombinedScore) - { - float scoreA = (float)itemA.ItemPackageInfo.DownloadCount * (1.0f - MathF.Clamp((float)(DateTime.Now - itemA.ItemPackageInfo.PublishDate).TotalDays / 360.0f, 0.001f, 1.0f)); - float scoreB = (float)itemB.ItemPackageInfo.DownloadCount * (1.0f - MathF.Clamp((float)(DateTime.Now - itemB.ItemPackageInfo.PublishDate).TotalDays / 360.0f, 0.001f, 1.0f)); - if (scoreA < scoreB) result = -1; - else if (scoreA > scoreB) result = 1; - } - if (result == 0) - { - result = itemA.GetHashCode() - itemB.GetHashCode(); - } - - return (this.sortOrder == SortOrder.Ascending) ? -result : result; - } - } - private class PackageOperationData - { - private PackageManager manager; - private PackageInfo package; - private Action operation; - - public PackageManager Manager - { - get { return this.manager; } - } - public PackageInfo Package - { - get { return this.package; } - } - public Action Operation - { - get { return this.operation; } - } - - public PackageOperationData(PackageManager manager, PackageInfo package, Action operation) - { - this.manager = manager; - this.package = package; - this.operation = operation; - } - } - - private static readonly string[] InvisibleTags = new[] { - PackageManager.DualityTag, - PackageManager.PluginTag, - PackageManager.CoreTag, - PackageManager.EditorTag, - PackageManager.LauncherTag, - PackageManager.SampleTag }; - - private PackageManager packageManager = null; - private DisplayMode display = DisplayMode.None; - private InstalledPackagesTreeModel modelInstalled = null; - private OnlinePackagesTreeModel modelOnline = null; - private PackageItem selectedItem = null; - private bool restartRequired = false; - private Size oldTreeViewSize = Size.Empty; - - public DisplayMode Display - { - get { return this.display; } - set - { - if (this.display != value) - { - DisplayMode previous = this.display; - this.display = value; - this.OnDisplayModeChanged(previous, this.display); - } - } - } - public string SearchFilter - { - get { return this.toolStripSearchBox.Text; } - set { this.toolStripSearchBox.Text = value; } - } - - public PackageViewDialog() - { - this.InitializeComponent(); - - this.packageList.DefaultToolTipProvider = this; - this.packageList.ShowNodeToolTips = true; - this.packageList.NodeFilter = this.PackageListNodeFilter; - - this.treeColumnName.DrawColHeaderBg += this.treeColumn_DrawColHeaderBg; - this.treeColumnVersion.DrawColHeaderBg += this.treeColumn_DrawColHeaderBg; - this.treeColumnDate.DrawColHeaderBg += this.treeColumn_DrawColHeaderBg; - this.treeColumnDownloads.DrawColHeaderBg += this.treeColumn_DrawColHeaderBg; - this.treeColumnPackageType.DrawColHeaderBg += this.treeColumn_DrawColHeaderBg; - this.nodeTextBoxDownloads.DrawText += this.nodeTextBoxDownloads_DrawText; - this.toolStripMain.Renderer = new Duality.Editor.Controls.ToolStrip.DualitorToolStripProfessionalRenderer(); - - this.toolStripViewBox.Items.Add(new FilterBoxItem(DisplayMode.Installed, PackageManagerFrontendRes.ItemName_InstalledPackages)); - this.toolStripViewBox.Items.Add(new FilterBoxItem(DisplayMode.Online, PackageManagerFrontendRes.ItemName_OnlineRepository)); - } - - internal void SaveUserData(XElement node) {} - internal void LoadUserData(XElement node) {} - - private void ScheduleLazyPackageInterfaceUpdate() - { - if (!this.timerPackageModelChanged.Enabled) - { - this.timerPackageModelChanged.Enabled = true; - } - } - private void UpdateBottomButtons() - { - OnlinePackageItem onlineItem = this.selectedItem as OnlinePackageItem; - if (onlineItem != null) onlineItem.UpdateLocalPackageData(this.packageManager); - - bool isItemSelected = this.selectedItem != null; - bool isItemInstalled = isItemSelected && this.selectedItem.IsInstalled; - bool isItemUpdatable = isItemInstalled && this.selectedItem.IsUpdatable; - bool canUninstall = isItemInstalled && this.packageManager.CanUninstallPackage(this.selectedItem.ItemPackageInfo.Name); - bool canUpdate = isItemUpdatable; - - this.buttonInstall.Visible = isItemSelected && !isItemInstalled; - this.buttonUninstall.Visible = isItemInstalled && canUninstall; - this.buttonUpdate.Visible = isItemInstalled && canUpdate; - this.bottomFlowSpacer2.Visible = this.buttonInstall.Visible || this.buttonUninstall.Visible || this.buttonUpdate.Visible; - this.buttonUpdateAll.Visible = this.packageList.Root.Children.Select(n => n.Tag as PackageItem).NotNull().Any(n => n.IsUpdatable); - this.buttonApply.Visible = this.restartRequired; - this.labelRequireRestart.Visible = this.restartRequired; - } - private void UpdateInfoArea() - { - PackageInfo itemInfo = this.selectedItem != null ? this.selectedItem.ItemPackageInfo : null; - PackageInfo installedInfo = this.selectedItem != null ? this.selectedItem.InstalledPackageInfo : null; - PackageInfo newestInfo = this.selectedItem != null ? this.selectedItem.NewestPackageInfo : null; - - this.SuspendLayout(); - - if (itemInfo == null) - { - this.labelPackageTitle.Text = PackageManagerFrontendRes.NoPackageSelected; - this.labelPackageId.Text = null; - this.labelPackageDesc.Text = PackageManagerFrontendRes.NoDescAvailable; - this.labelPackageAuthor.Text = null; - this.labelPackageTags.Text = null; - this.labelPackageVersion.Text = null; - this.labelPackageUpdated.Text = null; - this.labelPackageWebsite.Text = null; - this.labelPackageLicense.Text = null; - this.textBoxReleaseNotes.Text = null; - } - else - { - bool isItemInstalled = installedInfo != null; - bool isItemUpdatable = isItemInstalled && newestInfo != null && installedInfo.Version < newestInfo.Version; - - string releaseNoteText = (isItemUpdatable && !string.IsNullOrWhiteSpace(newestInfo.ReleaseNotes)) ? newestInfo.ReleaseNotes : string.Empty; - if (!string.IsNullOrWhiteSpace(releaseNoteText)) - releaseNoteText = Regex.Replace(releaseNoteText, @"\r\n?|\n", Environment.NewLine); - - string websiteLinkCaption = itemInfo.ProjectUrl != null ? itemInfo.ProjectUrl.Host : string.Empty; - string licenseLinkCaption = itemInfo.LicenseUrl != null ? itemInfo.LicenseUrl.Host : string.Empty; - - if (!string.IsNullOrWhiteSpace(websiteLinkCaption)) - websiteLinkCaption = string.Format(PackageManagerFrontendRes.ItemName_VisitLinkUrl, websiteLinkCaption); - if (!string.IsNullOrWhiteSpace(licenseLinkCaption)) - licenseLinkCaption = string.Format(PackageManagerFrontendRes.ItemName_VisitLinkUrl, licenseLinkCaption); - - this.labelPackageTitle.Text = !string.IsNullOrWhiteSpace(itemInfo.Title) ? itemInfo.Title : itemInfo.Id; - this.labelPackageId.Text = itemInfo.Id; - this.labelPackageDesc.Text = itemInfo.Description; - this.labelPackageAuthor.Text = itemInfo.Authors.ToString(", "); - this.labelPackageTags.Text = itemInfo.Tags.Except(InvisibleTags).ToString(", "); - this.labelPackageUpdated.Text = itemInfo.PublishDate.ToString("yyyy-MM-dd, HH:mm", System.Globalization.CultureInfo.InvariantCulture); - this.labelPackageWebsite.Text = websiteLinkCaption; - this.labelPackageWebsite.Tag = itemInfo.ProjectUrl; - this.labelPackageLicense.Text = licenseLinkCaption; - this.labelPackageLicense.Tag = itemInfo.LicenseUrl; - this.textBoxReleaseNotes.Text = releaseNoteText; - this.labelPackageVersion.Text = isItemUpdatable ? - string.Format("{0} --> {1}", - PackageViewDialog.GetDisplayedVersionString(installedInfo.Version), - PackageViewDialog.GetDisplayedVersionString(newestInfo.Version)) : - PackageViewDialog.GetDisplayedVersionString(itemInfo.Version); - } - - this.labelPackageAuthor.Visible = !string.IsNullOrWhiteSpace(this.labelPackageAuthor.Text); - this.labelPackageTags.Visible = !string.IsNullOrWhiteSpace(this.labelPackageTags.Text); - this.labelPackageVersion.Visible = !string.IsNullOrWhiteSpace(this.labelPackageVersion.Text); - this.labelPackageUpdated.Visible = !string.IsNullOrWhiteSpace(this.labelPackageUpdated.Text); - this.labelPackageWebsite.Visible = !string.IsNullOrWhiteSpace(this.labelPackageWebsite.Text); - this.labelPackageLicense.Visible = !string.IsNullOrWhiteSpace(this.labelPackageLicense.Text); - this.textBoxReleaseNotes.Visible = !string.IsNullOrWhiteSpace(this.textBoxReleaseNotes.Text); - - this.labelPackageAuthorCaption.Visible = this.labelPackageAuthor.Visible; - this.labelPackageTagsCaption.Visible = this.labelPackageTags.Visible; - this.labelPackageVersionCaption.Visible = this.labelPackageVersion.Visible; - this.labelPackageUpdatedCaption.Visible = this.labelPackageUpdated.Visible; - this.labelPackageWebsiteCaption.Visible = this.labelPackageWebsite.Visible; - this.labelPackageLicenseCaption.Visible = this.labelPackageLicense.Visible; - this.labelReleaseNotesCaption.Visible = this.textBoxReleaseNotes.Visible; - - this.ResumeLayout(); - } - - private void InstallPackage(PackageInfo info) - { - if (!this.ConfirmCompatibility(info)) - return; - - bool anythingChanged = false; - EventHandler listener = delegate (object sender, PackageEventArgs e) - { - anythingChanged = true; - }; - - bool operationSuccessful = false; - this.packageManager.PackageInstalled += listener; - this.packageManager.PackageUninstalled += listener; - { - ProcessingBigTaskDialog setupDialog = new ProcessingBigTaskDialog( - PackageManagerFrontendRes.TaskInstallPackages_Caption, - PackageManagerFrontendRes.TaskInstallPackages_Desc, - PackageOperationThread, - new PackageOperationData(this.packageManager, info, d => d.Manager.InstallPackage(d.Package.Name))); - setupDialog.MainThreadRequired = false; - setupDialog.ShowDialog(); - operationSuccessful = setupDialog.DialogResult == DialogResult.OK; - } - this.packageManager.PackageUninstalled -= listener; - this.packageManager.PackageInstalled -= listener; - - if (anythingChanged) - { - this.packageList.Invalidate(); - this.modelInstalled.ApplyChanges(); - this.modelOnline.ApplyChanges(); - this.restartRequired = operationSuccessful; - this.UpdateBottomButtons(); - } - } - private void UninstallPackage(PackageInfo info) - { - bool anythingChanged = false; - EventHandler listener = delegate (object sender, PackageEventArgs e) - { - anythingChanged = true; - }; - - bool operationSuccessful = false; - this.packageManager.PackageInstalled += listener; - this.packageManager.PackageUninstalled += listener; - { - ProcessingBigTaskDialog setupDialog = new ProcessingBigTaskDialog( - PackageManagerFrontendRes.TaskUninstallPackages_Caption, - PackageManagerFrontendRes.TaskUninstallPackages_Desc, - PackageOperationThread, - new PackageOperationData(this.packageManager, info, d => d.Manager.UninstallPackage(d.Package.Name))); - setupDialog.MainThreadRequired = false; - setupDialog.ShowDialog(); - operationSuccessful = setupDialog.DialogResult == DialogResult.OK; - } - this.packageManager.PackageUninstalled -= listener; - this.packageManager.PackageInstalled -= listener; - - if (anythingChanged) - { - this.packageList.Invalidate(); - this.modelInstalled.ApplyChanges(); - this.modelOnline.ApplyChanges(); - this.restartRequired = operationSuccessful; - this.UpdateBottomButtons(); - } - } - private void UpdatePackage(PackageInfo info) - { - PackageInfo newestInfo = this.packageManager.GetPackage(info.Name.VersionInvariant); - if (!this.ConfirmCompatibility(newestInfo)) - return; - - ProcessingBigTaskDialog setupDialog = new ProcessingBigTaskDialog( - PackageManagerFrontendRes.TaskUpdatePackages_Caption, - PackageManagerFrontendRes.TaskUpdatePackages_Desc, - PackageOperationThread, - new PackageOperationData(this.packageManager, info, d => d.Manager.UpdatePackage(d.Package.Name))); - setupDialog.MainThreadRequired = false; - setupDialog.ShowDialog(); - - this.packageList.Invalidate(); - this.modelInstalled.ApplyChanges(); - this.modelOnline.ApplyChanges(); - this.restartRequired = (setupDialog.DialogResult == DialogResult.OK); - this.UpdateBottomButtons(); - } - private void UpdateAllPackages() - { - IEnumerable newestUpdatablePackages = - this.packageManager.GetUpdatablePackages() - .Select(p => this.packageManager.GetPackage(p.Name.VersionInvariant)); - if (!this.ConfirmCompatibility(newestUpdatablePackages)) - return; - - ProcessingBigTaskDialog setupDialog = new ProcessingBigTaskDialog( - PackageManagerFrontendRes.TaskUpdatePackages_Caption, - PackageManagerFrontendRes.TaskUpdatePackages_Desc, - PackageUpdateAllThread, - this.packageManager); - setupDialog.MainThreadRequired = false; - setupDialog.ShowDialog(); - - this.packageList.Invalidate(); - this.modelInstalled.ApplyChanges(); - this.modelOnline.ApplyChanges(); - this.restartRequired = true; - this.UpdateBottomButtons(); - } - - private bool ConfirmCompatibility(PackageInfo package) - { - return this.ConfirmCompatibility(this.packageManager.GetCompatibilityLevel(package)); - } - private bool ConfirmCompatibility(IEnumerable packages) - { - PackageCompatibility compatibility = PackageCompatibility.Definite; - foreach (PackageInfo package in packages) - { - PackageCompatibility otherCompat = this.packageManager.GetCompatibilityLevel(package); - compatibility = compatibility.Combine(otherCompat); - } - return this.ConfirmCompatibility(compatibility); - } - private bool ConfirmCompatibility(PackageCompatibility compatibility) - { - if (compatibility.IsAtLeast(PackageCompatibility.Likely)) return true; - - DialogResult result = MessageBox.Show(this, - PackageManagerFrontendRes.MsgConfirmIncompatibleOperation_Desc, - PackageManagerFrontendRes.MsgConfirmIncompatibleOperation_Caption, - MessageBoxButtons.YesNo, - MessageBoxIcon.Warning, - MessageBoxDefaultButton.Button2); - - return result == DialogResult.Yes; - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - this.oldTreeViewSize = this.packageList.Size; - - // Retrieve the package manager and clear its remote package cache, so we'll - // get fresh data every time we re-open the package view dialog. - this.packageManager = DualityEditorApp.PackageManager; - this.packageManager.ClearCache(); - this.nodeTextBoxVersion.PackageManager = this.packageManager; - - this.modelOnline = new OnlinePackagesTreeModel(this.packageManager); - this.modelOnline.SortComparer = new PackageListItemComparer(PackageListItemComparer.SortMode.CombinedScore, SortOrder.Ascending); - this.modelOnline.NodesChanged += this.modelOnline_NodesChanged; - - this.modelInstalled = new InstalledPackagesTreeModel(this.packageManager); - this.modelInstalled.NodesChanged += this.modelInstalled_NodesChanged; - - this.OnDisplayModeChanged(DisplayMode.None, this.display); - this.toolStripSearchBox_TextChanged(this.toolStripSearchBox, EventArgs.Empty); - - this.UpdateBottomButtons(); - this.UpdateInfoArea(); - } - protected override void OnClosed(EventArgs e) - { - base.OnClosed(e); - this.modelInstalled.NodesChanged -= this.modelInstalled_NodesChanged; - this.modelOnline.NodesChanged -= this.modelOnline_NodesChanged; - this.modelInstalled.Dispose(); - this.modelOnline.Dispose(); - } - - private void timerPackageModelChanged_Tick(object sender, EventArgs e) - { - this.UpdateInfoArea(); - this.UpdateBottomButtons(); - this.packageList.UpdateNodeFilter(); - this.packageList.Invalidate(); - this.timerPackageModelChanged.Enabled = false; - } - private void modelOnline_NodesChanged(object sender, TreeModelEventArgs e) - { - this.InvokeEx(this.ScheduleLazyPackageInterfaceUpdate, false); - } - private void modelInstalled_NodesChanged(object sender, TreeModelEventArgs e) - { - this.InvokeEx(this.ScheduleLazyPackageInterfaceUpdate, false); - } - private void toolStripViewBox_DropDownClosed(object sender, EventArgs e) - { - this.packageList.Focus(); - } - private void treeColumn_DrawColHeaderBg(object sender, DrawColHeaderBgEventArgs e) - { - e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(255, 212, 212, 212)), e.Bounds); - e.Handled = true; - } - private void toolStripViewBox_SelectedIndexChanged(object sender, EventArgs e) - { - FilterBoxItem selectedItem = this.toolStripViewBox.SelectedItem as FilterBoxItem; - this.Display = selectedItem.Display; - } - private void packageList_ColumnClicked(object sender, TreeColumnEventArgs e) - { - if (e.Column.SortOrder == SortOrder.None) - { - if (e.Column == this.treeColumnVersion) - e.Column.SortOrder = SortOrder.Ascending; - else if (e.Column == this.treeColumnDownloads) - e.Column.SortOrder = SortOrder.Ascending; - else if (e.Column == this.treeColumnDate) - e.Column.SortOrder = SortOrder.Ascending; - else - e.Column.SortOrder = SortOrder.Descending; - } - else - { - e.Column.SortOrder = (e.Column.SortOrder == SortOrder.Descending) ? SortOrder.Ascending : SortOrder.Descending; - } - - IComparer comparer = null; - if (e.Column == this.treeColumnName) - comparer = new PackageListItemComparer(PackageListItemComparer.SortMode.Name, e.Column.SortOrder); - else if (e.Column == this.treeColumnVersion) - comparer = new PackageListItemComparer(PackageListItemComparer.SortMode.Version, e.Column.SortOrder); - else if (e.Column == this.treeColumnDownloads) - comparer = new PackageListItemComparer(PackageListItemComparer.SortMode.Downloads, e.Column.SortOrder); - else if (e.Column == this.treeColumnDate) - comparer = new PackageListItemComparer(PackageListItemComparer.SortMode.Date, e.Column.SortOrder); - else if (e.Column == this.treeColumnPackageType) - comparer = new PackageListItemComparer(PackageListItemComparer.SortMode.PackageType, e.Column.SortOrder); - - this.modelInstalled.SortComparer = comparer; - this.modelOnline.SortComparer = comparer; - } - private void packageList_Resize(object sender, EventArgs e) - { - Size sizeChange = new Size( - this.packageList.Width - this.oldTreeViewSize.Width, - this.packageList.Height - this.oldTreeViewSize.Height); - - this.treeColumnName.Width += sizeChange.Width; - this.UpdateColumnVisibility(); - - this.oldTreeViewSize = this.packageList.Size; - } - private void packageList_SelectionChanged(object sender, EventArgs e) - { - this.selectedItem = this.packageList.SelectedNode != null ? this.packageList.SelectedNode.Tag as PackageItem : null; - - this.UpdateBottomButtons(); - this.UpdateInfoArea(); - } - private void labelPackageWebsite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - if (this.labelPackageWebsite.Tag is Uri) - Process.Start((this.labelPackageWebsite.Tag as Uri).AbsoluteUri); - } - private void labelPackageLicense_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - if (this.labelPackageLicense.Tag is Uri) - Process.Start((this.labelPackageLicense.Tag as Uri).AbsoluteUri); - } - private void nodeTextBoxDownloads_DrawText(object sender, DrawTextEventArgs e) - { - e.TextColor = this.packageList.ForeColor; - } - private void toolStripSearchBox_TextChanged(object sender, EventArgs e) - { - string filterString = this.toolStripSearchBox.Text; - Predicate itemFilter = null; - - if (!string.IsNullOrWhiteSpace(filterString)) - { - itemFilter = delegate(BaseItem item) - { - PackageItem packageItem = item as PackageItem; - if (packageItem != null) - { - StringComparison ignoreCase = StringComparison.InvariantCultureIgnoreCase; - - // Check title, id and any of the tags for the filter string - if (packageItem.Title.IndexOf(filterString, ignoreCase) != -1) return true; - if (packageItem.Id.IndexOf(filterString, ignoreCase) != -1) return true; - if (packageItem.ItemPackageInfo != null && - packageItem.ItemPackageInfo.Tags.Any(t => - t != null && - t.IndexOf(filterString, ignoreCase) != -1)) - return true; - - // If it isn't contained anywhere, we don't want this item here. - return false; - } - else - { - return true; - } - }; - } - - if (this.modelInstalled != null) this.modelInstalled.ItemFilter = itemFilter; - if (this.modelOnline != null) this.modelOnline.ItemFilter = itemFilter; - } - private void buttonAdvanced_Click(object sender, EventArgs e) - { - Point screenPoint = this.buttonAdvanced.PointToScreen(new Point(this.buttonAdvanced.Left, this.buttonAdvanced.Bottom)); - Screen screen = Screen.FromControl(this.buttonAdvanced); - if (screenPoint.Y + this.contextMenuAdvanced.Size.Height > screen.WorkingArea.Height) - { - this.contextMenuAdvanced.Show(this.buttonAdvanced, new Point(0, -this.contextMenuAdvanced.Size.Height)); - } - else - { - this.contextMenuAdvanced.Show(this.buttonAdvanced, new Point(0, this.buttonAdvanced.Height)); - } - } - private void buttonApply_Click(object sender, EventArgs e) - { - this.DialogResult = DialogResult.OK; - DualityEditorApp.SaveAllProjectData(); - this.packageManager.ApplyUpdate(); - Application.Exit(); - } - private void buttonUninstall_Click(object sender, EventArgs e) - { - this.UninstallPackage(this.selectedItem.InstalledPackageInfo); - } - private void buttonInstall_Click(object sender, EventArgs e) - { - this.InstallPackage(this.selectedItem.NewestPackageInfo); - } - private void buttonUpdate_Click(object sender, EventArgs e) - { - this.UpdatePackage(this.selectedItem.InstalledPackageInfo); - } - private void buttonUpdateAll_Click(object sender, EventArgs e) - { - this.UpdateAllPackages(); - } - private void itemReInstallAll_Click(object sender, EventArgs e) - { - // Shut down the editor - CancelEventArgs cancelArgs = new CancelEventArgs(); - Application.Exit(cancelArgs); - if (cancelArgs.Cancel) return; - - // Delete all files and directories in the local package store, except the icon cache - foreach (string dir in Directory.EnumerateDirectories(this.packageManager.LocalEnvironment.RepositoryPath)) - { - if (PathOp.ArePathsEqual(PackageItem.PackageIconCacheDir, dir)) - continue; - Directory.Delete(dir, true); - } - foreach (string file in Directory.EnumerateFiles(this.packageManager.LocalEnvironment.RepositoryPath)) - { - File.Delete(file); - } - - // Start the editor again - Process.Start(Application.ExecutablePath); - } - - private void OnDisplayModeChanged(DisplayMode prev, DisplayMode next) - { - FilterBoxItem selectedItem = this.toolStripViewBox.SelectedItem as FilterBoxItem; - if (selectedItem == null || next != selectedItem.Display) - { - this.toolStripViewBox.SelectedItem = this.toolStripViewBox.Items.OfType().FirstOrDefault(i => i.Display == next); - } - - if (next == DisplayMode.Installed) - { - this.packageList.Model = this.modelInstalled; - } - else if (next == DisplayMode.Online) - { - this.packageList.Model = this.modelOnline; - } - this.UpdateColumnVisibility(); - } - - private bool PackageListNodeFilter(TreeNodeAdv node) - { - PackageItem item = node.Tag as PackageItem; - if (item == null) return true; - - return item.IsInstalled || item.Compatibility == PackageCompatibility.Unknown || item.Compatibility.IsAtLeast(PackageCompatibility.Likely); - } - - private void UpdateColumnVisibility() - { - int colRefWidth = this.GetPackageListMainColumnWidth(c => - c != this.treeColumnDate && - c != this.treeColumnDownloads && - c != this.treeColumnName); - - this.UpdateColumnVisibility(this.treeColumnDate, ref colRefWidth); - this.UpdateColumnVisibility(this.treeColumnDownloads, ref colRefWidth, () => this.display == DisplayMode.Online); - } - private void UpdateColumnVisibility(TreeColumn column, ref int colRefWidth, Func visibilityFunc = null) - { - bool displayColumn = colRefWidth > 400 && (visibilityFunc == null || visibilityFunc()); - if (displayColumn && !column.IsVisible) - { - column.IsVisible = true; - this.treeColumnName.Width -= column.Width; - } - else if (!displayColumn && column.IsVisible) - { - column.IsVisible = false; - this.treeColumnName.Width += column.Width; - } - if (column.IsVisible) - colRefWidth -= this.treeColumnDownloads.Width; - } - private int GetPackageListMainColumnWidth(Predicate columnPredicate) - { - int availWidth = this.packageList.ClientSize.Width; - foreach (TreeColumn column in this.packageList.Columns) - { - if (!column.IsVisible) continue; - if (!columnPredicate(column)) continue; - availWidth -= column.Width; - } - return availWidth; - } - - private static System.Collections.IEnumerable PackageOperationThread(ProcessingBigTaskDialog.WorkerInterface workerInterface) - { - PackageOperationData data = workerInterface.Data as PackageOperationData; - - workerInterface.Progress = -1.0f; - if (data.Package.Version != null) - workerInterface.StateDesc = string.Format("Package '{0}', Version {1}...", data.Package.Id, data.Package.Version); - else - workerInterface.StateDesc = string.Format("Package '{0}'...", data.Package.Id); - yield return null; - - try - { - data.Operation(data); - } - catch (Exception e) - { - Logs.Editor.WriteError("An error occurred while processing Package '{0}', Version {1}: {2}", - data.Package.Id, - data.Package.Version, - LogFormat.Exception(e)); - workerInterface.Error = e; - } - - yield break; - } - private static System.Collections.IEnumerable PackageUpdateAllThread(ProcessingBigTaskDialog.WorkerInterface workerInterface) - { - PackageManager manager = workerInterface.Data as PackageManager; - - workerInterface.Progress = 0.0f; - workerInterface.StateDesc = GeneralRes.TaskPrepareInfo; - yield return null; - - // Determine which packages need to be updated - PackageInfo[] updatePackages = manager.GetUpdatablePackages().ToArray(); - - // Sort packages by their dependencies so we don't accidentally install multiple versions - manager.OrderByDependencies(updatePackages); - - // Start the updating process - foreach (PackageInfo package in updatePackages) - { - workerInterface.Progress += 1.0f / updatePackages.Length; - workerInterface.StateDesc = string.Format("Package '{0}'...", package.Id); - yield return null; - - try - { - manager.UpdatePackage(package.Name); - } - catch (Exception e) - { - Logs.Editor.WriteError("An error occurred while updating Package '{0}', Version {1}: {2}", - package.Id, - package.Version, - LogFormat.Exception(e)); - workerInterface.Error = e; - } - } - - workerInterface.Progress = 1.0f; - yield break; - } - - string IToolTipProvider.GetToolTip(TreeNodeAdv node, NodeControl nodeControl) - { - if (nodeControl is IToolTipProvider) - { - IToolTipProvider controlProvider = nodeControl as IToolTipProvider; - return controlProvider.GetToolTip(node, nodeControl); - } - return null; - } - - public static string GetDisplayedVersionString(Version version) - { - if (version == null) - return string.Empty; - else if (version.Build == 0) - return string.Format("{0}.{1}", version.Major, version.Minor); - else - return string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build); - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/PackageViewDialog.resx b/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/PackageViewDialog.resx deleted file mode 100644 index 86c437654..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Modules/PackageViewDialog.resx +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - 141, 17 - - - 17, 17 - - - 231, 17 - - - 440, 17 - - - - - AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA - AAD///8B////Af///wH///8B////Af///wEqi8ZHKInFvyaHxcUkhcRN////Af///wH///8B////Af// - /wH///8B////Af///wH///8B////ATCTyisukMmlLI7I/4/N6/9vt+L/QI7I/ySFxK0jg8Mx////Af// - /wH///8B////Af///wH///8BNprNFzSYzIUylcvvgsTl/8z0///E7///i9Lx/4rO8P9fpNf/JYbE8yOE - w40hgsIb////Af///wE9otAHO6DPZTmdztt9wOD/x+78/8zy//+o6P//lOD+/0G65/9FseT/isrv/4LB - 6/9Tl9D/I4TD4SKCwm0ggMILQKXSu3e93P+/5fb/2/b//8Hu//+l5f//n+P//5Th/v9Gwer/OrXm/zeq - 4v9Wr+X/h8bt/3Sz5P9KkMr/IoPDwUKo0/nn+/7/3fb//8Hv//+36///q+j//6Tk//+W4f7/SMbr/0C9 - 6f89tOb/OKni/zKf3v9rtub/g8Tu/ySFxPlEqtTx4vb8/9Tz///J8P//vu3//7Pq//+t5///fNn+/0jH - 7/9DxOr/Q77o/z+15v86q+P/QKfh/4PF7P8mh8XxR63V8eL2/P/X9P//zvL//8jv//+66///ktv7/1bB - 8f9Iwvn/O73w/0fF7P9Fven/QrXm/0ex5v+Iyu7/KIrG8Umw1vHi9v3/2vT//9Xz//+96///idX3/2nJ - 9f9MtOn/jdr7/4zc//9IxPn/OLbs/0i/6P9Pu+j/jNDw/yuNx/FLstfx4vj9/9Tz//+w5Pr/hs/x/3/Q - 9f940PX/TLHk/7Dk+v+26f//m+H//3jW/v9AvfX/PbXp/5DV8f8tj8jxTbTY++H4/v/N6/n/ktLt/4TM - 6/9vv+X/VrHb/zuUyP/O7Pr/2fX//7nq//+V3/7/d9X//6Xk//+E3Pv/L5LJ+0+32Z9Ntdn/pdnt/9Lr - 9f++3u3/lcne/4nD2/9wuNb/abnd/5DX9f9/z/X/ndv4/6rj+v+Eyuz/UabV/zKVy6f///8BT7fZR061 - 2cN+xuD/0e73//b////w/v//y+37/1Ct2v+L1/f/quH5/5XW8v9istv/OZ3OyTaazU3///8B////Af// - /wFPt9oFTrbZZUy02NuSz+X/5vj8/+P2/v+v3fL/suT3/3LA4f8/pNHhPaLQbTugzwn///8B////Af// - /wH///8B////Af///wFOttkXTbTYhUuy1++c1er/iMzn/0Ws1fNEqtSNQqfTG////wH///8B////Af// - /wH///8B////Af///wH///8B////Af///wFNtNgrS7LYr0qw171IrtYx////Af///wH///8B////Af// - /wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA - //8AAP//AAD//w== - - - \ No newline at end of file diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/PackageManagerFrontend.Editor.csproj b/Source/Plugins/EditorModules/PackageManagerFrontend/PackageManagerFrontend.Editor.csproj deleted file mode 100644 index eaab7172e..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/PackageManagerFrontend.Editor.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {E771E45B-3EB3-4CD3-8483-7D8798D0F5F8} - Library - Properties - Duality.Editor.Plugins.PackageManagerFrontend - PackageManagerFrontend.editor - v4.7.2 - 512 - - bin\$(Configuration)\ - $(AssemblyName).xml - - - true - full - false - DEBUG;TRACE - prompt - 4 - false - 1591,1592,1573,1571,1570,1572,0419 - 7.3 - - - pdbonly - true - TRACE - prompt - 4 - false - 1591,1592,1573,1571,1570,1572,0419 - 7.3 - - - - - - - - - - - - Component - - - Component - - - Component - - - Component - - - True - True - PackageManagerFrontendRes.resx - - - - Form - - - PackageViewDialog.cs - - - - - True - True - Resources.resx - - - - - - - - - {9FB9F397-FD39-460C-A9AD-B4780D19945F} - DualityEditor - False - - - {c87a6a2f-e537-48fa-a789-3c54cf29cc09} - DualityPrimitives - False - - - {D821AFB9-BCC9-4025-9A9C-798E2BC546AB} - Duality - False - - - - - - - - - - - - - - - - - - - - - - - - PackageViewDialog.cs - - - PublicResXFileCodeGenerator - PackageManagerFrontendRes.Designer.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - 2.8.2 - - - 1.7.7 - - - 1.1.17 - - - - - - - - - \ No newline at end of file diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/PackageManagerFrontendPlugin.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/PackageManagerFrontendPlugin.cs deleted file mode 100644 index c9c329041..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/PackageManagerFrontendPlugin.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using System.Xml.Linq; - -using WeifenLuo.WinFormsUI.Docking; - -using AdamsLair.WinForms.ItemModels; - -using Duality.Editor; -using Duality.Editor.Properties; -using Duality.Editor.Forms; -using Duality.Editor.Plugins.PackageManagerFrontend.Properties; - -namespace Duality.Editor.Plugins.PackageManagerFrontend -{ - public class PackageManagerFrontendPlugin : EditorPlugin - { - private PackageViewDialog packageView = null; - - - public override string Id - { - get { return "PackageManagerFrontend"; } - } - public PackageViewDialog PackageView - { - get - { - if (this.packageView == null) - this.packageView = new PackageViewDialog(); - return this.packageView; - } - } - - - protected override void SaveUserData(XElement node) - { - XElement packageViewElem = new XElement("PackageView"); - this.PackageView.SaveUserData(packageViewElem); - if (!packageViewElem.IsEmpty) - node.Add(packageViewElem); - } - protected override void LoadUserData(XElement node) - { - XElement packageViewElem = node.Element("PackageView"); - if (packageViewElem != null) - { - this.PackageView.LoadUserData(packageViewElem); - } - } - protected override void InitPlugin(MainForm main) - { - base.InitPlugin(main); - - // Request menus - MenuModelItem fileItem = main.MainMenu.RequestItem(GeneralRes.MenuName_File); - fileItem.AddItem(new MenuModelItem - { - Name = PackageManagerFrontendRes.MenuItemName_PackageView, - Icon = PackageManagerFrontendResCache.IconPackage.ToBitmap(), - ActionHandler = this.menuItemManagePackages_Click - }); - MenuModelItem helpItem = main.MainMenu.RequestItem(GeneralRes.MenuName_Help); - helpItem.AddItem(new MenuModelItem - { - Name = PackageManagerFrontendRes.MenuItemName_BrowseSamples, - ActionHandler = this.menuItemBrowseSamples_Click - }); - } - - public void ShowPackageViewDialog() - { - this.PackageView.Display = PackageViewDialog.DisplayMode.Installed; - this.PackageView.SearchFilter = string.Empty; - this.PackageView.ShowDialog(DualityEditorApp.MainForm); - } - public void ShowSamplePackageBrowser() - { - this.PackageView.Display = PackageViewDialog.DisplayMode.Online; - this.PackageView.SearchFilter = PackageManagement.PackageManager.SampleTag; - this.PackageView.ShowDialog(DualityEditorApp.MainForm); - } - - private void menuItemManagePackages_Click(object sender, EventArgs e) - { - this.ShowPackageViewDialog(); - } - private void menuItemBrowseSamples_Click(object sender, EventArgs e) - { - this.ShowSamplePackageBrowser(); - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/AssemblyInfo.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/AssemblyInfo.cs deleted file mode 100644 index 2d90b13d2..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("PackageManagerFrontend")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PackageManagerFrontend")] -[assembly: AssemblyCopyright("Copyright © Fedja Adam 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar -// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von -// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. -[assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("ca69367f-b175-4a44-9d09-e4fb718fae99")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.5")] -[assembly: AssemblyVersion("3.0.5")] diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/PackageManagerFrontendRes.Designer.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/PackageManagerFrontendRes.Designer.cs deleted file mode 100644 index 18e1f3e6e..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/PackageManagerFrontendRes.Designer.cs +++ /dev/null @@ -1,410 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Duality.Editor.Plugins.PackageManagerFrontend.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class PackageManagerFrontendRes { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal PackageManagerFrontendRes() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Duality.Editor.Plugins.PackageManagerFrontend.Properties.PackageManagerFrontendRe" + - "s", typeof(PackageManagerFrontendRes).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Download example projects to see Duality in action.. - /// - public static string ActionDesc_BrowseSamplePackages { - get { - return ResourceManager.GetString("ActionDesc_BrowseSamplePackages", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Browse Sample Packages. - /// - public static string ActionName_BrowseSamplePackages { - get { - return ResourceManager.GetString("ActionName_BrowseSamplePackages", resourceCulture); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconCore { - get { - object obj = ResourceManager.GetObject("IconCore", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconEditor { - get { - object obj = ResourceManager.GetObject("IconEditor", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconIncompatibleInstall { - get { - object obj = ResourceManager.GetObject("IconIncompatibleInstall", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconIncompatibleUpdate { - get { - object obj = ResourceManager.GetObject("IconIncompatibleUpdate", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconLikelySafeUpdate { - get { - object obj = ResourceManager.GetObject("IconLikelySafeUpdate", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconLikelyUnsafeInstall { - get { - object obj = ResourceManager.GetObject("IconLikelyUnsafeInstall", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconLikelyUnsafeUpdate { - get { - object obj = ResourceManager.GetObject("IconLikelyUnsafeUpdate", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). - /// - public static System.Drawing.Icon IconPackage { - get { - object obj = ResourceManager.GetObject("IconPackage", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconPackageMedium { - get { - object obj = ResourceManager.GetObject("IconPackageMedium", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconSafeUpdate { - get { - object obj = ResourceManager.GetObject("IconSafeUpdate", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconSample { - get { - object obj = ResourceManager.GetObject("IconSample", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconSampleBig { - get { - object obj = ResourceManager.GetObject("IconSampleBig", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap IconUpToDate { - get { - object obj = ResourceManager.GetObject("IconUpToDate", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized string similar to Installed Packages. - /// - public static string ItemName_InstalledPackages { - get { - return ResourceManager.GetString("ItemName_InstalledPackages", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Online Repository. - /// - public static string ItemName_OnlineRepository { - get { - return ResourceManager.GetString("ItemName_OnlineRepository", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to View on {0}. - /// - public static string ItemName_VisitLinkUrl { - get { - return ResourceManager.GetString("ItemName_VisitLinkUrl", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Browse Samples.... - /// - public static string MenuItemName_BrowseSamples { - get { - return ResourceManager.GetString("MenuItemName_BrowseSamples", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Manage Packages.... - /// - public static string MenuItemName_PackageView { - get { - return ResourceManager.GetString("MenuItemName_PackageView", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Package Compatibility. - /// - public static string MsgConfirmIncompatibleOperation_Caption { - get { - return ResourceManager.GetString("MsgConfirmIncompatibleOperation_Caption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There is a major version difference between some of the new target packages and local package versions. Compatibility cannot be guaranteed. Continue anyway?. - /// - public static string MsgConfirmIncompatibleOperation_Desc { - get { - return ResourceManager.GetString("MsgConfirmIncompatibleOperation_Desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No description available. - /// - public static string NoDescAvailable { - get { - return ResourceManager.GetString("NoDescAvailable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No Package selected. - /// - public static string NoPackageSelected { - get { - return ResourceManager.GetString("NoPackageSelected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Installing Packages.... - /// - public static string TaskInstallPackages_Caption { - get { - return ResourceManager.GetString("TaskInstallPackages_Caption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Duality is installing packages. This may include downloading them from the central package repository.. - /// - public static string TaskInstallPackages_Desc { - get { - return ResourceManager.GetString("TaskInstallPackages_Desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Uninstalling Packages.... - /// - public static string TaskUninstallPackages_Caption { - get { - return ResourceManager.GetString("TaskUninstallPackages_Caption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Duality is uninstalling packages.. - /// - public static string TaskUninstallPackages_Desc { - get { - return ResourceManager.GetString("TaskUninstallPackages_Desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Updating Packages.... - /// - public static string TaskUpdatePackages_Caption { - get { - return ResourceManager.GetString("TaskUpdatePackages_Caption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Duality is updating packages. This may include downloading new versions from the central package repository.. - /// - public static string TaskUpdatePackages_Desc { - get { - return ResourceManager.GetString("TaskUpdatePackages_Desc", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This package is not supported by your Duality installation.. - /// - public static string TooltipInstallNoCompatibility { - get { - return ResourceManager.GetString("TooltipInstallNoCompatibility", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This package is likely incompatible with other packages in your project.. - /// - public static string TooltipInstallUnlikelyCompatibility { - get { - return ResourceManager.GetString("TooltipInstallUnlikelyCompatibility", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Updating this package shouldn't cause any compatibility issues.. - /// - public static string TooltipUpdateDefiniteCompatibility { - get { - return ResourceManager.GetString("TooltipUpdateDefiniteCompatibility", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Updating this package is usually fine, but certain older plugins may not be compatible with the new version.. - /// - public static string TooltipUpdateLikelyCompatibility { - get { - return ResourceManager.GetString("TooltipUpdateLikelyCompatibility", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Updating this package will likely break older plugins depending on it.. - /// - public static string TooltipUpdateNoCompatibility { - get { - return ResourceManager.GetString("TooltipUpdateNoCompatibility", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Updating this package can cause compatibility problems with older plugins.. - /// - public static string TooltipUpdateUnlikelyCompatibility { - get { - return ResourceManager.GetString("TooltipUpdateUnlikelyCompatibility", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This package is up-to-date.. - /// - public static string TooltipUpdateUpToDate { - get { - return ResourceManager.GetString("TooltipUpdateUpToDate", resourceCulture); - } - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/PackageManagerFrontendRes.resx b/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/PackageManagerFrontendRes.resx deleted file mode 100644 index 24c36b940..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/PackageManagerFrontendRes.resx +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\EmbeddedResources\core.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\editor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\IncompatibleUpdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\LikelySafeUpdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\LikelyUnsafeUpdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\packagemed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\SafeUpdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\UpToDate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Installed Packages - - - Online Repository - - - Manage Packages... - - - No description available - - - No Package selected - - - ..\EmbeddedResources\sample.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Installing Packages... - - - Duality is installing packages. This may include downloading them from the central package repository. - - - Uninstalling Packages... - - - Duality is uninstalling packages. - - - Updating Packages... - - - Duality is updating packages. This may include downloading new versions from the central package repository. - - - Updating this package shouldn't cause any compatibility issues. - - - Updating this package is usually fine, but certain older plugins may not be compatible with the new version. - - - Updating this package will likely break older plugins depending on it. - - - Updating this package can cause compatibility problems with older plugins. - - - ..\EmbeddedResources\IncompatibleInstall.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\EmbeddedResources\LikelyUnsafeinstall.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - This package is not supported by your Duality installation. - - - This package is likely incompatible with other packages in your project. - - - This package is up-to-date. - - - Package Compatibility - - - There is a major version difference between some of the new target packages and local package versions. Compatibility cannot be guaranteed. Continue anyway? - - - View on {0} - - - Browse Samples... - - - Download example projects to see Duality in action. - - - Browse Sample Packages - - - ..\EmbeddedResources\IconSampleBig.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/PackageManagerFrontendResCache.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/PackageManagerFrontendResCache.cs deleted file mode 100644 index 270a41c68..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/PackageManagerFrontendResCache.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Drawing; - -namespace Duality.Editor.Plugins.PackageManagerFrontend.Properties -{ - public static class PackageManagerFrontendResCache - { - public static readonly Icon IconPackage = PackageManagerFrontendRes.IconPackage; - public static readonly Image IconPackageMedium = PackageManagerFrontendRes.IconPackageMedium; - public static readonly Image IconPackageBig = Resources.packagebig; - public static readonly Image IconUpToDate = PackageManagerFrontendRes.IconUpToDate; - public static readonly Image IconSafeUpdate = PackageManagerFrontendRes.IconSafeUpdate; - public static readonly Image IconLikelySafeUpdate = PackageManagerFrontendRes.IconLikelySafeUpdate; - public static readonly Image IconLikelyUnsafeUpdate = PackageManagerFrontendRes.IconLikelyUnsafeUpdate; - public static readonly Image IconIncompatibleUpdate = PackageManagerFrontendRes.IconIncompatibleUpdate; - public static readonly Image IconLikelyUnsafeInstall = PackageManagerFrontendRes.IconLikelyUnsafeInstall; - public static readonly Image IconIncompatibleInstall = PackageManagerFrontendRes.IconIncompatibleInstall; - public static readonly Image IconCore = PackageManagerFrontendRes.IconCore; - public static readonly Image IconEditor = PackageManagerFrontendRes.IconEditor; - public static readonly Image IconSample = PackageManagerFrontendRes.IconSample; - public static readonly Image IconSampleBig = PackageManagerFrontendRes.IconSampleBig; - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/Resources.Designer.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/Resources.Designer.cs deleted file mode 100644 index b4a7bbe99..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/Resources.Designer.cs +++ /dev/null @@ -1,73 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Duality.Editor.Plugins.PackageManagerFrontend.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Duality.Editor.Plugins.PackageManagerFrontend.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap packagebig { - get { - object obj = ResourceManager.GetObject("packagebig", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/Resources.resx b/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/Resources.resx deleted file mode 100644 index 46a0bc84d..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/Properties/Resources.resx +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\EmbeddedResources\packagebig.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/InstalledPackagesTreeModel.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/InstalledPackagesTreeModel.cs deleted file mode 100644 index b25e2c8c2..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/InstalledPackagesTreeModel.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Concurrent; -using System.Text; -using System.Linq; -using System.ComponentModel; -using System.Threading; - -using Aga.Controls.Tree; - -using Duality.Editor.PackageManagement; - -namespace Duality.Editor.Plugins.PackageManagerFrontend.TreeModels -{ - public class InstalledPackagesTreeModel : PackageRepositoryTreeModel - { - protected enum ChangeOperation - { - Add, - Remove - } - protected class ChangeEvent - { - private BaseItem item; - private ChangeOperation operation; - - public BaseItem Item - { - get { return this.item; } - } - public ChangeOperation Operation - { - get { return this.operation; } - } - - public ChangeEvent(BaseItem item, ChangeOperation op) - { - this.item = item; - this.operation = op; - } - } - - private ConcurrentQueue changeQueue = new ConcurrentQueue(); - - public InstalledPackagesTreeModel(PackageManager manager) : base(manager) - { - this.packageManager.PackageInstalled += this.packageManager_PackageInstalled; - this.packageManager.PackageUninstalled += this.packageManager_PackageUninstalled; - } - protected override void OnDisposing(bool manually) - { - base.OnDisposing(manually); - this.packageManager.PackageInstalled -= this.packageManager_PackageInstalled; - this.packageManager.PackageUninstalled -= this.packageManager_PackageUninstalled; - } - - public override void Refresh() - { - base.Refresh(); - while (!this.changeQueue.IsEmpty) - { - ChangeEvent change; - this.changeQueue.TryDequeue(out change); - } - } - public override void ApplyChanges() - { - base.ApplyChanges(); - while (!this.changeQueue.IsEmpty) - { - ChangeEvent change; - this.changeQueue.TryDequeue(out change); - if (change.Operation == ChangeOperation.Add) - { - this.AddItem(change.Item); - } - else if (change.Operation == ChangeOperation.Remove) - { - this.RemoveItem(change.Item); - } - } - } - - protected override IEnumerable EnumeratePackages() - { - return this.packageManager.LocalSetup.Packages; - } - protected override BaseItem CreatePackageItem(object package, BaseItem parentItem) - { - return new LocalPackageItem(package as LocalPackage, parentItem); - } - - private void packageManager_PackageInstalled(object sender, PackageEventArgs e) - { - // Will be called from a worker thread, because packages are installed in one. - - LocalPackage localPackage = this.packageManager.LocalSetup.GetPackage(e.Id, e.Version); - if (localPackage == null) return; - - BaseItem item = this.CreatePackageItem(localPackage, null); - if (item == null) return; - - this.changeQueue.Enqueue(new ChangeEvent(item, ChangeOperation.Add)); - } - private void packageManager_PackageUninstalled(object sender, PackageEventArgs e) - { - // Will be called from a worker thread, because packages are installed in one. - - BaseItem item = this.GetItem(e.Id, e.Version); - if (item == null) return; - - this.changeQueue.Enqueue(new ChangeEvent(item, ChangeOperation.Remove)); - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/ModelItems.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/ModelItems.cs deleted file mode 100644 index 81621974c..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/ModelItems.cs +++ /dev/null @@ -1,304 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; -using System.Drawing; -using System.Net; - -using Duality; -using Duality.IO; -using Duality.Editor.PackageManagement; -using Duality.Editor.Plugins.PackageManagerFrontend.Properties; - -namespace Duality.Editor.Plugins.PackageManagerFrontend.TreeModels -{ - public abstract class BaseItem - { - private BaseItem parent = null; - public BaseItem Parent - { - get { return this.parent; } - } - public abstract Image Icon { get; } - public abstract string Title { get; } - - public BaseItem(BaseItem parent) - { - this.parent = parent; - } - - public abstract void RetrieveAsyncData(PackageManager manager); - public abstract void RetrieveIcon(); - } - public abstract class PackageItem : BaseItem - { - private static string packageIconCacheDir = null; - private static Image defaultPackageIcon = null; - - public static string PackageIconCacheDir - { - get - { - if (packageIconCacheDir == null) - { - packageIconCacheDir = Path.Combine( - DualityEditorApp.PackageManager.LocalEnvironment.RepositoryPath, - "IconCache"); - } - return packageIconCacheDir; - } - } - public static Image DefaultPackageIcon - { - get - { - if (defaultPackageIcon == null) - { - defaultPackageIcon = (PackageManagerFrontendResCache.IconPackageMedium as Bitmap) - .ScaleToFit(32, 32, - System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic); - } - return defaultPackageIcon; - } - } - - public enum PackageType - { - Core, - Editor, - Sample, - Other - } - - protected object asyncDataLock = new object(); - protected PackageInfo itemPackageInfo = null; - private Image icon = DefaultPackageIcon; - private PackageCompatibility compatibility = PackageCompatibility.Unknown; - - public abstract PackageInfo InstalledPackageInfo { get; } - public abstract PackageInfo NewestPackageInfo { get; } - public PackageCompatibility Compatibility - { - get { return this.compatibility; } - } - public bool IsInstalled - { - get { return this.InstalledPackageInfo != null; } - } - public bool IsUpdatable - { - get { return this.IsInstalled && this.NewestPackageInfo != null && this.InstalledPackageInfo.Version < this.NewestPackageInfo.Version; } - } - public PackageInfo ItemPackageInfo - { - get { return this.itemPackageInfo; } - } - public PackageType Type - { - get - { - if (this.itemPackageInfo.IsSamplePackage) - return PackageType.Sample; - else if (this.itemPackageInfo.IsEditorPackage) - return PackageType.Editor; - else if (this.itemPackageInfo.IsCorePackage) - return PackageType.Core; - else - return PackageType.Other; - } - } - public override Image Icon - { - get - { - lock (this.asyncDataLock) - { - return this.icon; - } - } - } - public override string Title - { - get - { - lock (this.asyncDataLock) - { - return this.itemPackageInfo != null && !string.IsNullOrWhiteSpace(this.itemPackageInfo.Title) ? this.itemPackageInfo.Title : this.itemPackageInfo.Id; - } - } - } - public Version Version - { - get { return this.itemPackageInfo != null ? this.itemPackageInfo.Version : null; } - } - public int? Downloads - { - get - { - lock (this.asyncDataLock) - { - if (this.NewestPackageInfo == null) - return null; - else - return this.NewestPackageInfo.DownloadCount; - } - } - } - public string Id - { - get { return this.itemPackageInfo != null ? this.itemPackageInfo.Id : null; } - } - - public PackageItem(PackageInfo packageInfo, BaseItem parent) : base(parent) - { - this.itemPackageInfo = packageInfo; - } - public override void RetrieveIcon() - { - PackageInfo info = this.itemPackageInfo; - Image newIcon = null; - - if (info != null && info.IconUrl != null) - { - // Determine the local cache name of the icon. - string cacheFileName = GetLocalUrlCacheFileName(info.IconUrl); - string cacheFilePath = Path.Combine(PackageIconCacheDir, cacheFileName); - - // Attempt to load the icon from the local cache. - if (newIcon == null) - { - try - { - if (File.Exists(cacheFilePath)) - { - newIcon = Bitmap.FromFile(cacheFilePath) as Bitmap; - } - } - catch (Exception) {} - } - - // Download the image from the specified URL and save it. - if (newIcon == null) - { - try - { - ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; - HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(info.IconUrl); - httpWebRequest.Timeout = 3000; - using (HttpWebResponse httpWebReponse = (HttpWebResponse)httpWebRequest.GetResponse()) - { - using (Stream stream = httpWebReponse.GetResponseStream()) - { - Bitmap rawIcon = Bitmap.FromStream(stream) as Bitmap; - newIcon = rawIcon.ScaleToFit(32, 32, System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic); - - // Save the scaled image to the cache - Directory.CreateDirectory(PackageIconCacheDir); - newIcon.Save(cacheFilePath); - } - } - } - catch (Exception) {} - } - } - - // Fall back to the default icon - newIcon = newIcon ?? DefaultPackageIcon; - - // Apply the icon image back to the model item - lock (this.asyncDataLock) - { - this.icon = newIcon; - } - } - protected void GetUpdateCompatibility(PackageManager manager) - { - PackageCompatibility compatibility = manager.GetCompatibilityLevel(this.NewestPackageInfo); - lock (this.asyncDataLock) - { - this.compatibility = compatibility; - } - } - - private static string GetLocalUrlCacheFileName(Uri url) - { - string extension; - try { extension = Path.GetExtension(url.AbsolutePath); } - catch (Exception) { extension = ""; } - - string absoluteUri = url.AbsoluteUri; - ulong hashedValue = 3074457345618258791ul; - for(int i = 0; i < absoluteUri.Length; i++) - { - hashedValue += absoluteUri[i]; - hashedValue *= 3074457345618258799ul; - } - string hashedUrl = Convert.ToBase64String(BitConverter.GetBytes(hashedValue)); - return PathOp.GetValidFileName(hashedUrl) + extension; - } - } - public class LocalPackageItem : PackageItem - { - private PackageInfo newestPackageInfo = null; - - public override PackageInfo InstalledPackageInfo - { - get { return this.itemPackageInfo; } - } - public override PackageInfo NewestPackageInfo - { - get { return this.newestPackageInfo; } - } - - public LocalPackageItem(LocalPackage package, BaseItem parent) : base(package.Info, parent) {} - public override void RetrieveAsyncData(PackageManager manager) - { - // Retrieve info about newest online version - PackageInfo newestPackage = manager.GetPackage(this.itemPackageInfo.Name.VersionInvariant); - lock (this.asyncDataLock) - { - this.newestPackageInfo = newestPackage; - } - this.GetUpdateCompatibility(manager); - } - - public override string ToString() - { - return string.Format("LocalPackage {0} {1}, {2}", this.itemPackageInfo.Id, this.itemPackageInfo.Version, this.itemPackageInfo.PublishDate); - } - } - public class OnlinePackageItem : PackageItem - { - private PackageInfo installedPackageInfo = null; - - public override PackageInfo InstalledPackageInfo - { - get { return this.installedPackageInfo; } - } - public override PackageInfo NewestPackageInfo - { - get { return this.itemPackageInfo; } - } - - public OnlinePackageItem(PackageInfo package, BaseItem parent) : base(package, parent) {} - public override void RetrieveAsyncData(PackageManager manager) - { - this.UpdateLocalPackageData(manager); - this.GetUpdateCompatibility(manager); - } - public void UpdateLocalPackageData(PackageManager manager) - { - lock (this.asyncDataLock) - { - LocalPackage installedPackage = manager.LocalSetup.GetPackage(this.itemPackageInfo.Id); - this.installedPackageInfo = (installedPackage != null) ? installedPackage.Info : null; - } - } - - public override string ToString() - { - return string.Format("OnlinePackage {0} {1}, {2}", this.itemPackageInfo.Id, this.itemPackageInfo.Version, this.itemPackageInfo.PublishDate); - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/OnlinePackagesTreeModel.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/OnlinePackagesTreeModel.cs deleted file mode 100644 index 755c76c34..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/OnlinePackagesTreeModel.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Concurrent; -using System.Text; -using System.Linq; -using System.ComponentModel; -using System.Threading; - -using Aga.Controls.Tree; - -using Duality.Editor.PackageManagement; - -namespace Duality.Editor.Plugins.PackageManagerFrontend.TreeModels -{ - public class OnlinePackagesTreeModel : PackageRepositoryTreeModel - { - public OnlinePackagesTreeModel(PackageManager manager) : base(manager) - { - this.packageManager.PackageInstalled += this.packageManager_PackageInstalled; - this.packageManager.PackageUninstalled += this.packageManager_PackageUninstalled; - } - protected override void OnDisposing(bool manually) - { - base.OnDisposing(manually); - this.packageManager.PackageInstalled -= this.packageManager_PackageInstalled; - this.packageManager.PackageUninstalled -= this.packageManager_PackageUninstalled; - } - - protected override IEnumerable EnumeratePackages() - { - return this.packageManager.GetLatestDualityPackages(); - } - protected override BaseItem CreatePackageItem(object package, BaseItem parentItem) - { - return new OnlinePackageItem(package as PackageInfo, parentItem); - } - - private void packageManager_PackageInstalled(object sender, PackageEventArgs e) - { - // Will be called from a worker thread, because packages are installed in one. - - BaseItem item = this.GetItem(e.Id, e.Version); - if (item == null) return; - - this.ReadItemData(item); - } - private void packageManager_PackageUninstalled(object sender, PackageEventArgs e) - { - // Will be called from a worker thread, because packages are installed in one. - - BaseItem item = this.GetItem(e.Id, e.Version); - if (item == null) return; - - this.ReadItemData(item); - } - } -} diff --git a/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/PackageRepositoryTreeModel.cs b/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/PackageRepositoryTreeModel.cs deleted file mode 100644 index 38a46f14e..000000000 --- a/Source/Plugins/EditorModules/PackageManagerFrontend/TreeModels/PackageRepositoryTreeModel.cs +++ /dev/null @@ -1,405 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Concurrent; -using System.Text; -using System.Linq; -using System.ComponentModel; -using System.Threading; - -using Aga.Controls.Tree; - -using Duality.Editor.PackageManagement; - -namespace Duality.Editor.Plugins.PackageManagerFrontend.TreeModels -{ - public abstract class PackageRepositoryTreeModel : ITreeModel, IDisposable - { - private class NewItemRetrievedReport - { - public BaseItem Item { get; set; } - public int InsertAtIndex { get; set; } - } - - protected PackageManager packageManager = null; - private bool disposed = false; - private List items = new List(); - private BackgroundWorker itemRetriever = null; - private BackgroundWorker itemInfoLoader = null; - private BackgroundWorker itemIconLoader = null; - private ConcurrentQueue itemsToRead = new ConcurrentQueue(); - private ConcurrentQueue itemsToGetIcon = new ConcurrentQueue(); - private object workerLock = new object(); - private object itemLock = new object(); - private bool requireFullSort = false; - private IComparer sortComparer = null; - private Predicate itemFilter = null; - - public IComparer SortComparer - { - get { return this.sortComparer; } - set - { - this.sortComparer = value; - this.requireFullSort = true; - if (this.StructureChanged != null) - this.StructureChanged(this, new TreePathEventArgs()); - } - } - public Predicate ItemFilter - { - get { return this.itemFilter; } - set - { - this.itemFilter = value; - if (this.StructureChanged != null) - this.StructureChanged(this, new TreePathEventArgs()); - } - } - public bool IsBusy - { - get { return this.itemRetriever.IsBusy || this.itemInfoLoader.IsBusy || this.itemIconLoader.IsBusy; } - } - - #pragma warning disable 67 // Event never used - public event EventHandler NodesChanged; - public event EventHandler NodesInserted; - public event EventHandler NodesRemoved; - public event EventHandler StructureChanged; - - public PackageRepositoryTreeModel(PackageManager manager) - { - this.packageManager = manager; - - this.itemInfoLoader = new BackgroundWorker(); - this.itemInfoLoader.WorkerReportsProgress = true; - this.itemInfoLoader.DoWork += this.Worker_ReadItemData; - this.itemInfoLoader.ProgressChanged += this.Worker_ProgressChanged; - - this.itemIconLoader = new BackgroundWorker(); - this.itemIconLoader.WorkerReportsProgress = true; - this.itemIconLoader.DoWork += this.Worker_ReadItemIcon; - this.itemIconLoader.ProgressChanged += this.Worker_IconChanged; - - this.itemRetriever = new BackgroundWorker(); - this.itemRetriever.WorkerReportsProgress = true; - this.itemRetriever.DoWork += this.Worker_RetrieveItems; - this.itemRetriever.ProgressChanged += this.Worker_ItemsRetrieved; - } - ~PackageRepositoryTreeModel() - { - this.Dispose(false); - } - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - private void Dispose(bool manually) - { - if (!this.disposed) - { - this.OnDisposing(manually); - this.disposed = true; - } - } - protected virtual void OnDisposing(bool manually) - { - - } - - /// - /// Rebuilds the entire model. - /// - public virtual void Refresh() - { - while (!this.itemsToRead.IsEmpty) - { - BaseItem item; - this.itemsToRead.TryDequeue(out item); - } - while (!this.itemsToGetIcon.IsEmpty) - { - BaseItem item; - this.itemsToGetIcon.TryDequeue(out item); - } - lock (this.itemLock) - { - this.items.Clear(); - } - if (this.StructureChanged != null) - this.StructureChanged(this, new TreePathEventArgs()); - } - /// - /// Performs a main-thread update on the item model to process - /// update operations that were scheduled from worker threads. - /// - public virtual void ApplyChanges() - { - this.RunLoadInfoWorkers(); - } - - public IEnumerable GetChildren(TreePath treePath) - { - BaseItem parentItem = treePath.LastNode as BaseItem; - - if (parentItem == null) - { - // Start retrieving all the items from out source asynchronously - if (this.items.Count == 0) - this.RunWorker(this.itemRetriever); - - // Determine which items to display and return them - List displayedItems = new List(); - lock (this.itemLock) - { - if (this.requireFullSort) - { - this.items.Sort(this.sortComparer); - } - foreach (BaseItem item in this.items) - { - if (this.itemFilter != null && !this.itemFilter(item)) continue; - displayedItems.Add(item); - } - } - - return displayedItems; - } - - return Enumerable.Empty(); - } - public bool IsLeaf(TreePath treePath) - { - return true; - } - - protected abstract IEnumerable EnumeratePackages(); - protected abstract BaseItem CreatePackageItem(object package, BaseItem parentItem); - - protected void ReadItemData(BaseItem item) - { - this.itemsToRead.Enqueue(item); - this.itemsToGetIcon.Enqueue(item); - } - /// - /// Wakes info and icon loaders to read online item data. - /// - protected void RunLoadInfoWorkers() - { - if (!this.itemsToRead.IsEmpty) - this.RunWorker(this.itemInfoLoader); - if (!this.itemsToGetIcon.IsEmpty) - this.RunWorker(this.itemIconLoader); - } - protected BaseItem GetItem(string packageId, Version packageVersion) - { - lock (this.itemLock) - { - return this.items.OfType().FirstOrDefault(i => i.Id == packageId && i.Version == packageVersion); - } - } - protected void AddItem(BaseItem item) - { - this.SubmitItem(item); - this.ReadItemData(item); - - if (this.NodesInserted != null) - { - int index = GetItemIndex(item); - if (index != -1) - { - this.NodesInserted(this, new TreeModelEventArgs(this.GetPath(item.Parent), new int[] { index }, new[] { item })); - } - } - - // Wake info and icon loaders to read online item data - this.RunLoadInfoWorkers(); - } - protected void RemoveItem(BaseItem item) - { - int index = GetItemIndex(item); - lock (this.itemLock) - { - this.items.Remove(item); - } - if (this.NodesRemoved != null && index != -1) - { - this.NodesRemoved(this, new TreeModelEventArgs(this.GetPath(item.Parent), new int[] { index }, new[] { item })); - } - } - - private void SubmitItem(BaseItem item) - { - lock (this.itemLock) - { - // Remove the item, if already part of the list - int oldIndex = this.items.IndexOf(item); - if (oldIndex != -1) - this.items.RemoveAt(oldIndex); - - // Determine where to insert the item - int newIndex = oldIndex; - if (this.sortComparer != null) - { - for (int i = 0; i < this.items.Count; i++) - { - if (this.sortComparer.Compare(this.items[i], item) > 0) - { - newIndex = i; - break; - } - } - } - - // Insert the item - if (newIndex != -1) - this.items.Insert(newIndex, item); - else - this.items.Add(item); - } - } - private TreePath GetPath(BaseItem item) - { - Stack stack = new Stack(); - while (item != null) - { - stack.Push(item); - item = item.Parent; - } - return new TreePath(stack.ToArray()); - } - private int GetItemIndex(BaseItem item) - { - if (this.itemFilter == null) - { - int index; - lock (this.itemLock) - { - index = this.items.IndexOf(item); - } - return index; - } - else if (this.itemFilter(item)) - { - int index = 0; - lock (this.itemLock) - { - foreach (BaseItem i in this.items) - { - if (!this.itemFilter(i)) continue; - if (i == item) break; - ++index; - } - } - return index; - } - else - { - return -1; - } - } - - private void RunWorker(BackgroundWorker worker) - { - if (!worker.IsBusy) - { - lock (this.workerLock) - { - if (!worker.IsBusy) - worker.RunWorkerAsync(); - } - } - } - - private void Worker_RetrieveItems(object sender, DoWorkEventArgs e) - { - // Create items within the model - foreach (object package in this.EnumeratePackages()) - { - // Create item and report back - BaseItem item = null; - item = this.CreatePackageItem(package, null); - this.SubmitItem(item); - this.ReadItemData(item); - this.itemRetriever.ReportProgress(0, new NewItemRetrievedReport - { - Item = item, - InsertAtIndex = this.GetItemIndex(item) - }); - } - } - private void Worker_ItemsRetrieved(object sender, ProgressChangedEventArgs e) - { - NewItemRetrievedReport report = e.UserState as NewItemRetrievedReport; - - // Notify the model that we've got some new items - if (this.NodesInserted != null) - { - int newIndex = this.GetItemIndex(report.Item); - if (newIndex != -1) - { - this.NodesInserted(this, new TreeModelEventArgs(this.GetPath(report.Item.Parent), new int[] { report.InsertAtIndex }, new[] { report.Item })); - } - } - - // Wake info and icon loaders to read online item data - this.RunLoadInfoWorkers(); - } - private void Worker_ReadItemData(object sender, DoWorkEventArgs e) - { - while (!this.itemsToRead.IsEmpty) - { - BaseItem item; - if (!this.itemsToRead.TryDequeue(out item)) - continue; - - // Read additional item data and report back - item.RetrieveAsyncData(this.packageManager); - this.SubmitItem(item); - this.itemInfoLoader.ReportProgress(0, item); - } - } - private void Worker_ProgressChanged(object sender, ProgressChangedEventArgs e) - { - BaseItem item = e.UserState as BaseItem; - - // Notify the model that we've changed some items - if (this.NodesChanged != null) - { - int index = this.GetItemIndex(item); - if (index != -1) - { - this.NodesChanged(this, new TreeModelEventArgs(this.GetPath(item.Parent), new[] { item })); - } - } - } - private void Worker_ReadItemIcon(object sender, DoWorkEventArgs e) - { - while (!this.itemsToGetIcon.IsEmpty) - { - BaseItem item; - if (!this.itemsToGetIcon.TryDequeue(out item)) - continue; - - // Read the item icon and update the view. Doesn't affect sorting, so no Submit here - item.RetrieveIcon(); - this.itemIconLoader.ReportProgress(0, item); - } - } - private void Worker_IconChanged(object sender, ProgressChangedEventArgs e) - { - BaseItem item = e.UserState as BaseItem; - - // Notify the model that we've changed some items - if (this.NodesChanged != null) - { - int index = this.GetItemIndex(item); - if (index != -1) - { - this.NodesChanged(this, new TreeModelEventArgs(this.GetPath(item.Parent), new[] { item })); - } - } - } - } -} diff --git a/Source/Plugins/EditorModules/ProjectView/Properties/AssemblyInfo.cs b/Source/Plugins/EditorModules/ProjectView/Properties/AssemblyInfo.cs index 0da5e452a..9c724e819 100644 --- a/Source/Plugins/EditorModules/ProjectView/Properties/AssemblyInfo.cs +++ b/Source/Plugins/EditorModules/ProjectView/Properties/AssemblyInfo.cs @@ -31,6 +31,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.5")] -[assembly: AssemblyVersion("3.0.5")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/EditorModules/SceneView/Properties/AssemblyInfo.cs b/Source/Plugins/EditorModules/SceneView/Properties/AssemblyInfo.cs index a4b0a09cf..02ceb3f80 100644 --- a/Source/Plugins/EditorModules/SceneView/Properties/AssemblyInfo.cs +++ b/Source/Plugins/EditorModules/SceneView/Properties/AssemblyInfo.cs @@ -31,6 +31,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("3.0.4")] -[assembly: AssemblyVersion("3.0.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/Tilemaps/Core/Properties/AssemblyInfo.cs b/Source/Plugins/Tilemaps/Core/Properties/AssemblyInfo.cs index d7d348807..d20ec6bda 100644 --- a/Source/Plugins/Tilemaps/Core/Properties/AssemblyInfo.cs +++ b/Source/Plugins/Tilemaps/Core/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("2.1.4")] -[assembly: AssemblyVersion("2.1.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Source/Plugins/Tilemaps/Editor/Properties/AssemblyInfo.cs b/Source/Plugins/Tilemaps/Editor/Properties/AssemblyInfo.cs index fbe091281..baf8898b2 100644 --- a/Source/Plugins/Tilemaps/Editor/Properties/AssemblyInfo.cs +++ b/Source/Plugins/Tilemaps/Editor/Properties/AssemblyInfo.cs @@ -30,6 +30,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("2.1.4")] -[assembly: AssemblyVersion("2.1.4")] +[assembly: AssemblyVersion("4.0.0")] diff --git a/Test/Editor/DualityEditorTests.csproj b/Test/Editor/DualityEditorTests.csproj index 16e57c5e6..17e49e55e 100644 --- a/Test/Editor/DualityEditorTests.csproj +++ b/Test/Editor/DualityEditorTests.csproj @@ -54,11 +54,6 @@ - - - - - @@ -89,9 +84,6 @@ 2.1.1 - - 2.14.0 - 3.11.0 @@ -106,7 +98,6 @@ - \ No newline at end of file diff --git a/Test/Editor/PackageManagement/MockPackageSpec.cs b/Test/Editor/PackageManagement/MockPackageSpec.cs deleted file mode 100644 index 577f0fc8c..000000000 --- a/Test/Editor/PackageManagement/MockPackageSpec.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Collections.Generic; -using System.Runtime.Versioning; - -using NuGet; - -namespace Duality.Editor.PackageManagement.Tests -{ - /// - /// Specifies a NuGet package for mocking purposes during testing and provides - /// functionality to build packages from those specs, as well as information on - /// the expected outputs after an install via the . - /// - public class MockPackageSpec - { - private PackageName name = new PackageName("Unknown", new Version(0, 0, 0, 0)); - private List tags = new List(); - private Dictionary> dependencySets = new Dictionary>(); - private List> files = new List>(); - private Dictionary localMapping = new Dictionary(); - - - /// - /// [GET / SET] The packages ID and version. - /// - public PackageName Name - { - get { return this.name; } - set { this.name = value; } - } - /// - /// [GET] A list of keywords that this package will be tagged with. - /// - public List Tags - { - get { return this.tags; } - } - /// - /// [GET] A list of packages that this package depends on. - /// - public Dictionary> DependencySets - { - get { return this.dependencySets; } - } - /// - /// [GET] A mapping of files from source files in the package build directory to - /// their target inside the NuGet package. Note that the source files will be - /// created automatically when building the mock package. - /// - public List> Files - { - get { return this.files; } - } - /// - /// [GET] The expected mapping of files from the local package repository path to the - /// local root path. This information is used by tests for asserting correct install, - /// update and uninstall operations and needs to be specified manually. - /// - public Dictionary LocalMapping - { - get { return this.localMapping; } - } - - - public MockPackageSpec(string id) : this(id, new Version(1, 0, 0, 0)) { } - public MockPackageSpec(string id, Version version) - { - this.name = new PackageName(id, version); - } - - public void AddFile(string sourcePath, string packagePath) - { - this.files.Add(new KeyValuePair(sourcePath, packagePath)); - } - public List AddTarget(string targetFramework) - { - List dependencySet; - if (!this.dependencySets.TryGetValue(targetFramework, out dependencySet)) - { - dependencySet = new List(); - this.dependencySets.Add(targetFramework, dependencySet); - } - - return dependencySet; - } - public void AddDependency(string targetFramework, PackageName package) - { - List dependencySet = this.AddTarget(targetFramework); - dependencySet.Add(package); - } - public void AddDependency(PackageName package) - { - this.AddDependency("net45", package); - } - - /// - /// Creates a NuGet package from this mock package spec and copies it into the - /// specified repository path. - /// - /// - /// - public void CreatePackage(string buildPath, string repositoryPath) - { - NuGet.PackageBuilder builder = new NuGet.PackageBuilder(); - NuGet.ManifestMetadata metadata = new NuGet.ManifestMetadata - { - Authors = "AdamsLair", - Version = this.name.Version.ToString(), - Id = this.name.Id, - Description = string.Format("Mock Package: {0} {1}", this.name.Id, this.name.Version), - Tags = string.Join(" ", this.tags), - DependencySets = this.dependencySets.Select(pair => new NuGet.ManifestDependencySet() - { - TargetFramework = pair.Key, - Dependencies = - pair.Value - .Select(item => new NuGet.ManifestDependency { Id = item.Id, Version = item.Version.ToString() }) - .ToList() - }).ToList() - }; - - // Set up file contents metadata for the package - List fileMetadata = new List(); - foreach (var pair in this.files) - { - fileMetadata.Add(new NuGet.ManifestFile { Source = pair.Key, Target = pair.Value }); - this.CreateFile(buildPath, pair.Key); - } - - // If we don't have files or dependencies, at least at one mock file so we - // can create a package at all. This is useful for test cases where we're - // not actually interested in package contents at all. - if (this.files.Count == 0 && !this.dependencySets.SelectMany(pair => pair.Value).Any()) - { - fileMetadata.Add(new NuGet.ManifestFile { Source = "Empty.dll", Target = "lib" }); - this.CreateFile(buildPath, "Empty.dll"); - } - - builder.PopulateFiles(buildPath, fileMetadata); - builder.Populate(metadata); - - string packageFileName = Path.Combine( - repositoryPath, - string.Format("{0}.{1}.nupkg", this.name.Id, this.name.Version)); - using (FileStream stream = File.Open(packageFileName, FileMode.Create)) - { - builder.Save(stream); - } - } - private void CreateFile(string buildPath, string pathOrName) - { - string filePath = Path.Combine(buildPath, pathOrName); - string directory = Path.GetDirectoryName(filePath); - Directory.CreateDirectory(directory); - File.WriteAllText(filePath, string.Format( - "{0} {1}: {2}", - this.name.Id, - this.name.Version, - pathOrName)); - } - - public override string ToString() - { - return this.name.ToString(); - } - - /// - /// Creates a package spec with a mock Assembly file that is not tagged as a Duality-related package. - /// - /// - /// - /// - /// - public static MockPackageSpec CreateLibrary(string id, Version version = null, string targetFramework = null) - { - MockPackageSpec package = new MockPackageSpec(id, version ?? new Version(1, 0, 0, 0)); - package.AddFile( - string.Format("{0}.dll", id), - targetFramework != null ? - string.Format("lib\\{0}", targetFramework) : - "lib"); - package.LocalMapping.Add( - targetFramework != null ? - string.Format("lib\\{0}\\{1}.dll", targetFramework, id) : - string.Format("lib\\{0}.dll", id), - string.Format("{0}.dll", id)); - return package; - } - /// - /// Creates a package spec with a mock Assembly file, tagged as a Duality plugin. - /// - /// - /// - /// - /// - public static MockPackageSpec CreateDualityPlugin(string id, string[] targetFrameworks, Version version = null) - { - MockPackageSpec package = new MockPackageSpec(id, version ?? new Version(1, 0, 0, 0)); - package.Tags.Add(PackageManager.DualityTag); - package.Tags.Add(PackageManager.PluginTag); - foreach (string folder in targetFrameworks) - { - package.AddFile( - string.Format("{0}.dll", id), - folder != null ? - string.Format("lib\\{0}", folder) : - "lib"); - package.LocalMapping.Add( - folder != null ? - string.Format("lib\\{0}\\{1}.dll", folder, id) : - string.Format("lib\\{0}.dll", id), - string.Format("Plugins\\{0}.dll", id)); - } - - return package; - } - /// - /// Creates a package spec with a mock Assembly file, tagged as a Duality plugin. - /// - /// - /// - /// - /// - public static MockPackageSpec CreateDualityPlugin(string id, Version version = null, string targetFramework = null) - { - MockPackageSpec package = new MockPackageSpec(id, version ?? new Version(1, 0, 0, 0)); - package.Tags.Add(PackageManager.DualityTag); - package.Tags.Add(PackageManager.PluginTag); - package.AddFile( - string.Format("{0}.dll", id), - targetFramework != null ? - string.Format("lib\\{0}", targetFramework) : - "lib"); - package.LocalMapping.Add( - targetFramework != null ? - string.Format("lib\\{0}\\{1}.dll", targetFramework, id) : - string.Format("lib\\{0}.dll", id), - string.Format("Plugins\\{0}.dll", id)); - return package; - } - /// - /// Creates a package spec with a mock Assembly file, tagged as a Duality core part or non-plugin package. - /// - /// - /// - /// - /// - public static MockPackageSpec CreateDualityCorePart(string id, Version version = null, string targetFramework = null) - { - MockPackageSpec package = new MockPackageSpec(id, version ?? new Version(1, 0, 0, 0)); - package.Tags.Add(PackageManager.DualityTag); - package.AddFile( - string.Format("{0}.dll", id), - targetFramework != null ? - string.Format("lib\\{0}", targetFramework) : - "lib"); - package.LocalMapping.Add( - targetFramework != null ? - string.Format("lib\\{0}\\{1}.dll", targetFramework, id) : - string.Format("lib\\{0}.dll", id), - string.Format("{0}.dll", id)); - return package; - } - } -} diff --git a/Test/Editor/PackageManagement/PackageEventListener.cs b/Test/Editor/PackageManagement/PackageEventListener.cs deleted file mode 100644 index febfa3434..000000000 --- a/Test/Editor/PackageManagement/PackageEventListener.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Collections.Generic; -using System.Xml; -using System.Xml.Linq; - -using Duality.IO; - -using NUnit.Framework; - -namespace Duality.Editor.PackageManagement.Tests -{ - public class PackageEventListener : IDisposable - { - private PackageManager packageManager = null; - private List installEvents = new List(); - private List uninstallEvents = new List(); - - - public PackageEventListener(PackageManager packageManager) - { - this.packageManager = packageManager; - this.packageManager.PackageInstalled += this.packageManager_PackageInstalled; - this.packageManager.PackageUninstalled += this.packageManager_PackageUninstalled; - } - public void Dispose() - { - if (this.packageManager == null) return; - this.packageManager.PackageInstalled -= this.packageManager_PackageInstalled; - this.packageManager.PackageUninstalled -= this.packageManager_PackageUninstalled; - this.packageManager = null; - } - - public void AssertChanges(IEnumerable installed, IEnumerable uninstalled) - { - foreach (MockPackageSpec package in installed) this.AssertInstall(package.Name); - foreach (MockPackageSpec package in uninstalled) this.AssertUninstall(package.Name); - this.AssertEmpty(); - } - public void AssertInstall(PackageName package) - { - Assert.IsTrue( - this.installEvents.Remove(package), - "Expected install event for package {0}, but did not receive one.", - package); - } - public void AssertUninstall(PackageName package) - { - Assert.IsTrue(this.uninstallEvents.Remove(package), - "Expected uninstall event for package {0}, but did not receive one.", - package); - } - public void AssertEmpty() - { - Assert.IsEmpty(this.installEvents, "Install package events"); - Assert.IsEmpty(this.uninstallEvents, "Uninstall package events"); - } - - private void packageManager_PackageUninstalled(object sender, PackageEventArgs e) - { - this.uninstallEvents.Add(e.PackageName); - } - private void packageManager_PackageInstalled(object sender, PackageEventArgs e) - { - this.installEvents.Add(e.PackageName); - } - } -} diff --git a/Test/Editor/PackageManagement/PackageManagerTest.cs b/Test/Editor/PackageManagement/PackageManagerTest.cs deleted file mode 100644 index 3d176fd18..000000000 --- a/Test/Editor/PackageManagement/PackageManagerTest.cs +++ /dev/null @@ -1,1212 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Collections.Generic; -using System.Runtime.Versioning; -using System.Xml; -using System.Xml.Linq; - -using Duality.IO; - -using NuGet; - -using NUnit.Framework; - -namespace Duality.Editor.PackageManagement.Tests -{ - [TestFixture] - public class PackageManagerTest - { - private const string TestBasePath = "PackageManagerTest"; - private const string TestClientPath = TestBasePath + "\\Client"; - private const string TestRepositoryPath = TestBasePath + "\\Repository"; - private const string TestPackageBuildPath = TestBasePath + "\\PackageBuild"; - - private PackageManagerEnvironment workEnv; - private PackageSetup setup; - - - [SetUp] public void Init() - { - if (Directory.Exists(TestBasePath)) - Directory.Delete(TestBasePath, true); - - Directory.CreateDirectory(TestClientPath); - Directory.CreateDirectory(TestRepositoryPath); - - string relativeRepositoryPath = PathHelper.MakeDirectoryPathRelative( - TestRepositoryPath, - TestClientPath); - - this.workEnv = new PackageManagerEnvironment(TestClientPath); - this.setup = new PackageSetup(); - this.setup.RepositoryUrls.Clear(); - this.setup.RepositoryUrls.Add(relativeRepositoryPath); - } - [TearDown] public void Cleanup() - { - this.workEnv = null; - - Directory.Delete(TestBasePath, true); - } - - - [Test] public void EmptySetup() - { - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - Assert.IsFalse(packageManager.IsPackageSyncRequired); - Assert.IsFalse(packageManager.LocalSetup.IsFirstInstall); - Assert.IsEmpty(packageManager.LocalSetup.Packages); - Assert.AreEqual(1, packageManager.LocalSetup.RepositoryUrls.Count); - } - [Test] public void NonExistentConfigFile() - { - PackageManager packageManager = new PackageManager(this.workEnv); - - Assert.IsFalse(packageManager.IsPackageSyncRequired); - Assert.IsFalse(packageManager.LocalSetup.IsFirstInstall); - Assert.IsEmpty(packageManager.LocalSetup.Packages); - Assert.AreEqual(1, packageManager.LocalSetup.RepositoryUrls.Count); - } - [Test] public void GetPackage() - { - MockPackageSpec packageSpec = new MockPackageSpec("AdamsLair.Duality.Test", new Version(1, 2, 3, 4)); - packageSpec.CreatePackage(TestPackageBuildPath, TestRepositoryPath); - - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - PackageInfo info = packageManager.GetPackage(packageSpec.Name); - - Assert.IsNotNull(info); - Assert.AreEqual(packageSpec.Name.Id, info.Id); - Assert.AreEqual(packageSpec.Name.Version, info.Version); - Assert.AreEqual(packageSpec.Name, info.Name); - } - [Test] public void GetLatestDualityPackages() - { - MockPackageSpec packageSpecNonDuality = new MockPackageSpec("Some.Other.Package"); - MockPackageSpec packageSpecPlugin = new MockPackageSpec("AdamsLair.Duality.TestPlugin", new Version(1, 0, 0, 0)); - MockPackageSpec packageSpecPluginLatest = new MockPackageSpec("AdamsLair.Duality.TestPlugin", new Version(1, 1, 0, 0)); - MockPackageSpec packageSpecSample = new MockPackageSpec("AdamsLair.Duality.TestSample"); - - packageSpecPlugin.Tags.Add(PackageManager.DualityTag); - packageSpecPlugin.Tags.Add(PackageManager.PluginTag); - packageSpecPluginLatest.Tags.Add(PackageManager.DualityTag); - packageSpecPluginLatest.Tags.Add(PackageManager.PluginTag); - packageSpecSample.Tags.Add(PackageManager.DualityTag); - packageSpecSample.Tags.Add(PackageManager.SampleTag); - - packageSpecNonDuality.CreatePackage(TestPackageBuildPath, TestRepositoryPath); - packageSpecPlugin.CreatePackage(TestPackageBuildPath, TestRepositoryPath); - packageSpecPluginLatest.CreatePackage(TestPackageBuildPath, TestRepositoryPath); - packageSpecSample.CreatePackage(TestPackageBuildPath, TestRepositoryPath); - - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - List packages = packageManager.GetLatestDualityPackages().ToList(); - - // We expect that only Duality packages are reported, and only the latest version of each. - Assert.IsNotNull(packages); - Assert.AreEqual(2, packages.Count); - - PackageInfo packagePluginInfo = packages.FirstOrDefault(item => item.Id == packageSpecPlugin.Name.Id); - PackageInfo packageSampleInfo = packages.FirstOrDefault(item => item.Id == packageSpecSample.Name.Id); - - Assert.IsNotNull(packagePluginInfo); - Assert.IsNotNull(packageSampleInfo); - Assert.AreEqual(packageSpecPluginLatest.Name.Version, packagePluginInfo.Version); - } - - [Test, TestCaseSource("InstallPackageTestCases")] - public void InstallPackage(PackageOperationTestCase testCase) - { - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - // Prepare the test by setting up remote repository and pre-installed local packages - this.SetupReporistoryForTest(testCase.Repository); - this.SetupPackagesForTest(packageManager, testCase.Setup); - - using (PackageEventListener listener = new PackageEventListener(packageManager)) - { - // Find and install the package to test - packageManager.InstallPackage(testCase.Target.Name); - - // Assert that the expected events were fired - listener.AssertChanges( - testCase.Installed, - testCase.Uninstalled); - } - - // Assert client state / setup after the install was done - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync"); - this.AssertLocalSetup(packageManager.LocalSetup, testCase.DualityResults); - this.AssertUpdateSchedule(testCase.Installed, testCase.Uninstalled); - } - [Test, TestCaseSource("InstallPackageWithFrameworkFolderTestCases")] - public void InstallPackageWithFrameworkFolder(PackageOperationTestCase testCase) - { - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - // Prepare the test by setting up remote repository and pre-installed local packages - this.SetupReporistoryForTest(testCase.Repository); - this.SetupPackagesForTest(packageManager, testCase.Setup); - - using (PackageEventListener listener = new PackageEventListener(packageManager)) - { - // Find and install the package to test - packageManager.InstallPackage(testCase.Target.Name); - - // Assert that the expected events were fired - listener.AssertChanges( - testCase.Installed, - testCase.Uninstalled); - } - - // Assert client state / setup after the install was done - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync"); - this.AssertLocalSetup(packageManager.LocalSetup, testCase.DualityResults); - this.AssertUpdateSchedule(testCase.Installed, testCase.Uninstalled); - } - [Test, TestCaseSource("UninstallPackageTestCases")] - public void UninstallPackage(PackageOperationTestCase testCase) - { - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - // Prepare the test by setting up remote repository and pre-installed local packages - this.SetupReporistoryForTest(testCase.Repository); - this.SetupPackagesForTest(packageManager, testCase.Setup); - - using (PackageEventListener listener = new PackageEventListener(packageManager)) - { - // Uninstall the package to test - packageManager.UninstallPackage(testCase.Target.Name); - - // Assert that the expected events were fired - listener.AssertChanges( - testCase.Installed, - testCase.Uninstalled); - } - - // Assert client state / setup after the install was done - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync"); - this.AssertLocalSetup(packageManager.LocalSetup, testCase.DualityResults); - this.AssertUpdateSchedule(testCase.Installed, testCase.Uninstalled); - } - [Test, TestCaseSource("UpdatePackageTestCases")] - public void UpdatePackage(PackageOperationTestCase testCase) - { - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - // Prepare the test by setting up remote repository and pre-installed local packages - this.SetupReporistoryForTest(testCase.Repository); - this.SetupPackagesForTest(packageManager, testCase.Setup); - - using (PackageEventListener listener = new PackageEventListener(packageManager)) - { - // Update the package to test - packageManager.UpdatePackage(testCase.Target.Name); - - // Assert that the expected events were fired - listener.AssertChanges( - testCase.Installed, - testCase.Uninstalled); - } - - // Assert client state / setup after the install was done - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync"); - this.AssertLocalSetup(packageManager.LocalSetup, testCase.DualityResults); - this.AssertUpdateSchedule(testCase.Installed, testCase.Uninstalled); - } - [Test, TestCaseSource("PackageRestoreTestCases")] - public void PackageRestore(PackageRestoreTestCase testCase) - { - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - this.SetupReporistoryForTest(testCase.Repository); - this.SetupPackagesForTest(packageManager, testCase.PreSetup); - - packageManager.LocalSetup.Packages.Clear(); - packageManager.LocalSetup.Packages.AddRange(testCase.DesiredSetup.Select(name => new LocalPackage(name))); - - using (PackageEventListener listener = new PackageEventListener(packageManager)) - { - // Uninstall packages that are installed but no longer present in the local setup config - packageManager.UninstallNonRegisteredPackages(); - - // Install, update or check packages that are in the local setup config - List packagesToVerify = packageManager.LocalSetup.Packages.ToList(); - packageManager.OrderByDependencies(packagesToVerify); - foreach (LocalPackage package in packagesToVerify) - { - packageManager.VerifyPackage(package); - } - - listener.AssertChanges( - testCase.Installed, - testCase.Uninstalled); - } - - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync"); - this.AssertLocalSetup(packageManager.LocalSetup, testCase.DualityResults); - this.AssertUpdateSchedule(testCase.Installed, testCase.Uninstalled); - } - - private static IEnumerable InstallPackageTestCases() - { - // Note that NuGet treats the very first lib subfolder as a target framework specifier, - // so we can't naively use a folder structure in the lib package directory. Otherwise, - // it will be treated as an unsupported / unknown target framework. - - List cases = new List(); - - // Duality plugin without any dependencies - MockPackageSpec dualityPluginA = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA"); - dualityPluginA.AddFile("Subfolder\\TestPluginA.Second.dll", "lib"); - dualityPluginA.AddFile("Data\\TestPluginA\\SomeRes.Pixmap.res", "content\\TestPluginA"); - dualityPluginA.AddFile("Source\\Foo\\SomeCode.cs", "source\\Foo"); - dualityPluginA.LocalMapping.Add("lib\\TestPluginA.Second.dll", "Plugins\\TestPluginA.Second.dll"); - dualityPluginA.LocalMapping.Add("content\\TestPluginA\\SomeRes.Pixmap.res", "Data\\TestPluginA\\SomeRes.Pixmap.res"); - dualityPluginA.LocalMapping.Add("source\\Foo\\SomeCode.cs", "Source\\Code\\AdamsLair.Duality.TestPluginA\\Foo\\SomeCode.cs"); - - cases.Add(new PackageOperationTestCase( - "Duality Plugin, No Dependencies", - dualityPluginA, - new[] { dualityPluginA })); - - // Duality plugin depending on another Duality plugin - MockPackageSpec dualityPluginB = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB"); - dualityPluginB.AddDependency(dualityPluginA.Name); - - cases.Add(new PackageOperationTestCase( - "Duality Plugin, With Duality Dependencies", - dualityPluginB, - new[] { dualityPluginB, dualityPluginA })); - - // Duality plugin depending on a non-Duality NuGet package - MockPackageSpec otherLibraryA = MockPackageSpec.CreateLibrary("Some.Other.TestLibraryA"); - otherLibraryA.AddFile("Data\\TestLibraryA\\SomeFile.txt", "content\\TestLibraryA"); - otherLibraryA.LocalMapping.Add("content\\TestLibraryA\\SomeFile.txt", "TestLibraryA\\SomeFile.txt"); - - MockPackageSpec dualityPluginC = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginC"); - dualityPluginC.AddDependency(otherLibraryA.Name); - - cases.Add(new PackageOperationTestCase( - "Duality Plugin, With Lib Dependencies", - dualityPluginC, - new[] { dualityPluginC, otherLibraryA })); - - // Duality package that is not a plugin - MockPackageSpec dualityNonPluginA = MockPackageSpec.CreateDualityCorePart("AdamsLair.Duality.TestNonPluginA"); - dualityNonPluginA.AddFile("Data\\TestNonPluginA\\SomeFile.txt", "content\\TestNonPluginA"); - dualityNonPluginA.LocalMapping.Add("content\\TestNonPluginA\\SomeFile.txt", "TestNonPluginA\\SomeFile.txt"); - - cases.Add(new PackageOperationTestCase( - "Duality Non-Plugin Package", - dualityNonPluginA, - new[] { dualityNonPluginA })); - - // Installing a package that was already installed - cases.Add(new PackageOperationTestCase( - "Package Already Installed", - new[] { dualityPluginA }, - dualityPluginA, - new[] { dualityPluginA })); - - // Installing a package where one of its dependencies was already installed - cases.Add(new PackageOperationTestCase( - "Package Dependency Already Installed", - new[] { dualityPluginA }, - dualityPluginB, - new[] { dualityPluginA, dualityPluginB })); - - // Installing a package where an old version of one of its dependencies is already installed - MockPackageSpec dualityPluginA_Old = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA", new Version(0, 9, 0, 0)); - - cases.Add(new PackageOperationTestCase( - "Older Package Dependency Installed", - new[] { dualityPluginA_Old }, - dualityPluginB, - new[] { dualityPluginA, dualityPluginB })); - - // Installing a package where a newer version of one of its dependencies is already installed - MockPackageSpec dualityPluginA_New = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA", new Version(1, 1, 0, 0)); - - cases.Add(new PackageOperationTestCase( - "Newer Package Dependency Installed", - new[] { dualityPluginA_New }, - dualityPluginB, - new[] { dualityPluginA_New, dualityPluginB })); - - return cases; - } - private static IEnumerable InstallPackageWithFrameworkFolderTestCases() - { - List cases = new List(); - - // Files are located in lib root, without any framework folder - { - MockPackageSpec spec = MockPackageSpec.CreateDualityPlugin( - "AdamsLair.Duality.TestPlugin", - new Version(1, 0, 0, 0), - null); - cases.Add(new PackageOperationTestCase( - "No Framework", - spec, - new[] { spec })); - } - - // Files are located in a Portable Profile 111 framework lib folder - { - MockPackageSpec spec = MockPackageSpec.CreateDualityPlugin( - "AdamsLair.Duality.TestPlugin", - new Version(1, 0, 0, 0), - "portable-net45+win8+wpa81"); - cases.Add(new PackageOperationTestCase( - "Portable Profile 111", - spec, - new[] { spec })); - } - - // Files are located in a Portable Profile 328 framework lib folder - { - MockPackageSpec spec = MockPackageSpec.CreateDualityPlugin( - "AdamsLair.Duality.TestPlugin", - new Version(1, 0, 0, 0), - "portable-net40+sl5+win8+wp8+wpa81"); - cases.Add(new PackageOperationTestCase( - "Portable Profile 328", - spec, - new[] { spec })); - } - - // Files are located in a .NET Framework 4.5 framework lib folder - { - MockPackageSpec spec = MockPackageSpec.CreateDualityPlugin( - "AdamsLair.Duality.TestPlugin", - new Version(1, 0, 0, 0), - "net45"); - cases.Add(new PackageOperationTestCase( - ".NET Framework 4.5", - spec, - new[] { spec })); - } - - // Files are located in a .NET Framework 2.0 framework lib folder - { - MockPackageSpec spec = MockPackageSpec.CreateDualityPlugin( - "AdamsLair.Duality.TestPlugin", - new Version(1, 0, 0, 0), - "net20"); - cases.Add(new PackageOperationTestCase( - ".NET Framework 2.0", - spec, - new[] { spec })); - } - - // Files are located in a .NET Standard 1.1 framework lib folder - { - MockPackageSpec spec = MockPackageSpec.CreateDualityPlugin( - "AdamsLair.Duality.TestPlugin", - new Version(1, 0, 0, 0), - "netstandard1.1"); - cases.Add(new PackageOperationTestCase( - ".NET Standard 1.1", - spec, - new[] { spec })); - } - - // Files are located in a .NET Standard 2.0 framework lib folder - { - MockPackageSpec spec = MockPackageSpec.CreateDualityPlugin( - "AdamsLair.Duality.TestPlugin", - new Version(1, 0, 0, 0), - "netstandard2.0"); - cases.Add(new PackageOperationTestCase( - ".NET Standard 2.0", - spec, - new[] { spec })); - } - - // Different versions of the binaries are located in various framework folders, as well as the root folder - { - MockPackageSpec spec = new MockPackageSpec("AdamsLair.Duality.TestPlugin"); - spec.Tags.Add(PackageManager.DualityTag); - spec.Tags.Add(PackageManager.PluginTag); - - // See here for a big list: https://docs.microsoft.com/en-us/nuget/reference/target-frameworks - spec.AddFile("TestPlugin-Root.dll", "lib"); - spec.AddFile("TestPlugin-Portable111.dll", "lib\\portable-net45+win8+wpa81"); - spec.AddFile("TestPlugin-Portable328.dll", "lib\\portable-net40+sl5+win8+wp8+wpa81"); - spec.AddFile("TestPlugin-NetFramework47.dll", "lib\\net47"); - spec.AddFile("TestPlugin-NetFramework46.dll", "lib\\net46"); - spec.AddFile("TestPlugin-NetFramework45.dll", "lib\\net45"); - spec.AddFile("TestPlugin-NetFramework40.dll", "lib\\net40"); - spec.AddFile("TestPlugin-NetFramework30.dll", "lib\\net30"); - spec.AddFile("TestPlugin-NetFramework20.dll", "lib\\net20"); - spec.AddFile("TestPlugin-NetCore.dll", "lib\\netcore"); - spec.AddFile("TestPlugin-NetCore451.dll", "lib\\netcore451"); - spec.AddFile("TestPlugin-NetStandard10.dll", "lib\\netstandard1.0"); - spec.AddFile("TestPlugin-NetStandard11.dll", "lib\\netstandard1.1"); - spec.AddFile("TestPlugin-NetStandard13.dll", "lib\\netstandard1.3"); - spec.AddFile("TestPlugin-NetStandard20.dll", "lib\\netstandard2.0"); - spec.AddFile("TestPlugin-NetStandard21.dll", "lib\\netstandard2.1"); - spec.AddFile("TestPlugin-NetStandard30.dll", "lib\\netstandard3.0"); - spec.AddFile("TestPlugin-FooFramework.dll", "lib\\fooframework"); - - // We expect the package manager to make a choice to find the closest matching framework. - // Since the context of the package manager is editor / desktop development for now, we - // expect to prefer the closest we can get to .NET Framework 4.5, as that's what the editor - // is compiled with. - spec.LocalMapping.Add( - "lib\\net45\\TestPlugin-NetFramework45.dll", - "Plugins\\TestPlugin-NetFramework45.dll"); - - cases.Add(new PackageOperationTestCase( - "Primary Preference .NET Framework 4.5", - spec, - new[] { spec })); - } - - // Different versions of binaries again. Checking for secondary portable / profile 111 preference this time - { - MockPackageSpec spec = new MockPackageSpec("AdamsLair.Duality.TestPlugin"); - spec.Tags.Add(PackageManager.DualityTag); - spec.Tags.Add(PackageManager.PluginTag); - - // See here for a big list: https://docs.microsoft.com/en-us/nuget/reference/target-frameworks - spec.AddFile("TestPlugin-Root.dll", "lib"); - spec.AddFile("TestPlugin-Portable111.dll", "lib\\portable-net45+win8+wpa81"); - spec.AddFile("TestPlugin-Portable328.dll", "lib\\portable-net40+sl5+win8+wp8+wpa81"); - spec.AddFile("TestPlugin-NetCore.dll", "lib\\netcore"); - spec.AddFile("TestPlugin-NetCore451.dll", "lib\\netcore451"); - spec.AddFile("TestPlugin-NetStandard10.dll", "lib\\netstandard1.0"); - spec.AddFile("TestPlugin-NetStandard11.dll", "lib\\netstandard1.1"); - spec.AddFile("TestPlugin-NetStandard13.dll", "lib\\netstandard1.3"); - spec.AddFile("TestPlugin-NetStandard20.dll", "lib\\netstandard2.0"); - spec.AddFile("TestPlugin-NetStandard21.dll", "lib\\netstandard2.1"); - spec.AddFile("TestPlugin-NetStandard30.dll", "lib\\netstandard3.0"); - spec.AddFile("TestPlugin-FooFramework.dll", "lib\\fooframework"); - - // We expect the package manager to make a choice to find the closest matching framework. - // Since the context of the package manager is editor / desktop development for now, we - // expect to prefer the closest we can get to .NET Framework 4.5, as that's what the editor - // is compiled with. - spec.LocalMapping.Add( - "lib\\portable-net45+win8+wpa81\\TestPlugin-Portable111.dll", - "Plugins\\TestPlugin-Portable111.dll"); - - cases.Add(new PackageOperationTestCase( - "Secondary Preference Portable Profile 111", - spec, - new[] { spec })); - } - - // Legacy support: Files from the root folder are used as a fallback, if no framework-specific - // "override" is defined for any of them. - { - MockPackageSpec spec = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPlugin"); - spec.AddFile("AdamsLair.Duality.TestPlugin.dll", "lib"); - spec.AddFile("AdamsLair.Duality.TestPlugin.xml", "lib"); - spec.LocalMapping.Add("lib\\AdamsLair.Duality.TestPlugin.xml", "Plugins\\AdamsLair.Duality.TestPlugin.xml"); - cases.Add(new PackageOperationTestCase( - "Root Folder Fallback", - spec, - new[] { spec })); - } - - // Ensure framework selection does not affect content and source files - { - MockPackageSpec spec = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPlugin"); - spec.AddFile("Subfolder\\UnusedBinary.dll", "lib\\net20"); - spec.AddFile("Subfolder\\UnusedBinary2.dll", "lib\\netstandard1.1"); - spec.AddFile("Subfolder\\SecondBinary.dll", "lib"); - spec.AddFile("Data\\TestPlugin\\SomeRes.Pixmap.res", "content\\TestPlugin"); - spec.AddFile("Source\\Foo\\SomeCode.cs", "source\\Foo"); - spec.LocalMapping.Add("lib\\SecondBinary.dll", "Plugins\\SecondBinary.dll"); - spec.LocalMapping.Add("content\\TestPlugin\\SomeRes.Pixmap.res", "Data\\TestPlugin\\SomeRes.Pixmap.res"); - spec.LocalMapping.Add("source\\Foo\\SomeCode.cs", "Source\\Code\\AdamsLair.Duality.TestPlugin\\Foo\\SomeCode.cs"); - cases.Add(new PackageOperationTestCase( - "Content Remains Unaffected", - spec, - new[] { spec })); - } - - return cases; - } - private static IEnumerable UninstallPackageTestCases() - { - List cases = new List(); - - // Duality plugin without any dependencies - MockPackageSpec dualityPluginA = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA"); - - cases.Add(new PackageOperationTestCase( - "Duality Plugin, No Dependencies", - new[] { dualityPluginA }, - dualityPluginA, - new MockPackageSpec[0])); - - // Duality plugin with Duality plugin dependencies - MockPackageSpec dualityPluginB = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB"); - dualityPluginB.AddDependency(dualityPluginA.Name); - - cases.Add(new PackageOperationTestCase( - "Duality Plugin, With Duality Dependencies", - new[] { dualityPluginA, dualityPluginB }, - dualityPluginB, - new[] { dualityPluginA })); - - // Duality plugin depending on a non-Duality NuGet package - MockPackageSpec otherLibraryA = MockPackageSpec.CreateLibrary("Some.Other.TestLibraryA"); - MockPackageSpec dualityPluginC = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginC"); - dualityPluginC.AddDependency(otherLibraryA.Name); - - cases.Add(new PackageOperationTestCase( - "Duality Plugin, With Lib Dependencies", - new[] { dualityPluginC, otherLibraryA }, - dualityPluginC, - new MockPackageSpec[0])); - - // Duality plugin that has a dependency that other plugins still need - MockPackageSpec dualityPluginD = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginD"); - dualityPluginD.AddDependency(dualityPluginA.Name); - - cases.Add(new PackageOperationTestCase( - "Shared Dependencies", - new[] { dualityPluginA, dualityPluginB, dualityPluginD }, - dualityPluginD, - new[] { dualityPluginA, dualityPluginB })); - - // Duality plugin that has multiple non-Duality dependencies that depend on each other - MockPackageSpec otherLibraryB = MockPackageSpec.CreateLibrary("Some.Other.TestLibraryB"); - MockPackageSpec otherLibraryC = MockPackageSpec.CreateLibrary("Some.Other.TestLibraryC"); - MockPackageSpec otherLibraryD = MockPackageSpec.CreateLibrary("Some.Other.TestLibraryD"); - MockPackageSpec otherLibraryE = MockPackageSpec.CreateLibrary("Some.Other.TestLibraryE"); - MockPackageSpec dualityPluginE = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginE"); - otherLibraryB.AddDependency(otherLibraryD.Name); - otherLibraryB.AddDependency(otherLibraryE.Name); - otherLibraryD.AddDependency(otherLibraryC.Name); - // Order is important - biggest dependency set comes centered to trigger most problems - dualityPluginE.AddDependency(otherLibraryC.Name); - dualityPluginE.AddDependency(otherLibraryB.Name); - dualityPluginE.AddDependency(otherLibraryE.Name); - - cases.Add(new PackageOperationTestCase( - "Interconnected Dependencies", - new[] { otherLibraryD, otherLibraryC, otherLibraryE, otherLibraryB, dualityPluginE }, - dualityPluginE, - new MockPackageSpec[0])); - - return cases; - } - private static IEnumerable UpdatePackageTestCases() - { - List cases = new List(); - - // Duality plugin without any dependencies - MockPackageSpec dualityPluginA_Old = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA", new Version(1, 0, 0, 0)); - MockPackageSpec dualityPluginA_New = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA", new Version(1, 1, 0, 0)); - - cases.Add(new PackageOperationTestCase( - "Duality Plugin, No Dependencies", - new[] { dualityPluginA_Old }, - dualityPluginA_Old, - new[] { dualityPluginA_New })); - - // Duality plugin with Duality plugin dependencies - MockPackageSpec dualityPluginB_Old = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB", new Version(1, 0, 0, 0)); - MockPackageSpec dualityPluginB_New = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB", new Version(1, 1, 0, 0)); - dualityPluginB_Old.AddDependency(dualityPluginA_Old.Name); - dualityPluginB_New.AddDependency(dualityPluginA_New.Name); - - cases.Add(new PackageOperationTestCase( - "Duality Plugin, With Duality Dependencies", - new[] { dualityPluginA_Old, dualityPluginB_Old }, - dualityPluginB_Old, - new[] { dualityPluginA_New, dualityPluginB_New })); - - // Duality plugin depending on a non-Duality NuGet package - MockPackageSpec otherLibraryA_Old = MockPackageSpec.CreateLibrary("Some.Other.TestLibraryA", new Version(1, 0, 0, 0)); - MockPackageSpec otherLibraryA_New = MockPackageSpec.CreateLibrary("Some.Other.TestLibraryA", new Version(1, 1, 0, 0)); - MockPackageSpec dualityPluginC_Old = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginC", new Version(1, 0, 0, 0)); - MockPackageSpec dualityPluginC_New = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginC", new Version(1, 1, 0, 0)); - dualityPluginC_Old.AddDependency(otherLibraryA_Old.Name); - dualityPluginC_New.AddDependency(otherLibraryA_New.Name); - - cases.Add(new PackageOperationTestCase( - "Duality Plugin, With Lib Dependencies", - new[] { otherLibraryA_Old, dualityPluginC_Old }, - dualityPluginC_Old, - new[] { otherLibraryA_New, dualityPluginC_New })); - - return cases; - } - private static IEnumerable PackageRestoreTestCases() - { - // Create a shared repository for all test cases to save some space and redundancy - MockPackageSpec libraryA1 = MockPackageSpec.CreateLibrary("Some.Other.LibraryA", new Version(5, 0, 1, 0)); - MockPackageSpec libraryA2 = MockPackageSpec.CreateLibrary("Some.Other.LibraryA", new Version(6, 1, 0, 0)); - MockPackageSpec pluginA1 = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA", new Version(1, 0, 1, 0)); - MockPackageSpec pluginA2 = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA", new Version(2, 1, 0, 0)); - MockPackageSpec pluginB1 = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB", new Version(1, 0, 2, 0)); - MockPackageSpec pluginB2 = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB", new Version(2, 2, 0, 0)); - MockPackageSpec pluginC1 = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginC", new Version(1, 1, 2, 0)); - MockPackageSpec pluginC2 = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginC", new Version(2, 2, 1, 0)); - MockPackageSpec pluginD1 = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginD", new Version(1, 1, 3, 0)); - pluginA1.AddDependency(libraryA1.Name); - pluginA2.AddDependency(libraryA2.Name); - pluginB1.AddDependency(pluginA1.Name); - pluginB2.AddDependency(pluginA2.Name); - pluginD1.AddDependency(pluginA1.Name); - - List repository = new List(); - repository.Add(libraryA1); - repository.Add(libraryA2); - repository.Add(pluginA1); - repository.Add(pluginA2); - repository.Add(pluginB1); - repository.Add(pluginB2); - repository.Add(pluginC1); - repository.Add(pluginC2); - repository.Add(pluginD1); - - List cases = new List(); - - // Full restore of all packages to the newest available versions - { - List configSetup = new List(); - configSetup.Add(pluginA1.Name.VersionInvariant); - configSetup.Add(pluginB1.Name.VersionInvariant); - - cases.Add(new PackageRestoreTestCase( - "Full Restore, Newest", - repository, - new MockPackageSpec[0], - configSetup, - new[] { libraryA2, pluginA2, pluginB2 })); - } - - // Full restore of all packages to specific package versions - { - List configSetup = new List(); - configSetup.Add(pluginA1.Name); - configSetup.Add(pluginB1.Name); - - cases.Add(new PackageRestoreTestCase( - "Full Restore, Specific", - repository, - new MockPackageSpec[0], - configSetup, - new[] { libraryA1, pluginA1, pluginB1 })); - } - - // Partial restore of packages to newest available versions - { - List configSetup = new List(); - configSetup.Add(pluginA1.Name); - configSetup.Add(pluginC1.Name.VersionInvariant); - - cases.Add(new PackageRestoreTestCase( - "Partial Restore, Newest", - repository, - new[] { libraryA1, pluginA1 }, - configSetup, - new[] { libraryA1, pluginA1, pluginC2 })); - } - - // Partial restore of packages to specific package versions - { - List configSetup = new List(); - configSetup.Add(pluginA1.Name); - configSetup.Add(pluginB1.Name); - - cases.Add(new PackageRestoreTestCase( - "Partial Restore, Specific", - repository, - new[] { libraryA1, pluginA1 }, - configSetup, - new[] { libraryA1, pluginA1, pluginB1 })); - } - - // Partial restore of packages to newest available versions implicitly - // leading to an update of already installed packages - { - List configSetup = new List(); - configSetup.Add(pluginA1.Name); - configSetup.Add(pluginB1.Name.VersionInvariant); - - cases.Add(new PackageRestoreTestCase( - "Partial Restore, Implicit Update", - repository, - new[] { libraryA1, pluginA1 }, - configSetup, - new[] { libraryA2, pluginA2, pluginB2 })); - } - - // Full uninstall of all packages because they've been removed from the config - { - List configSetup = new List(); - - cases.Add(new PackageRestoreTestCase( - "Full Uninstall", - repository, - new[] { libraryA2, pluginA2, pluginB2 }, - configSetup, - new MockPackageSpec[0])); - } - - // Uninstall of a leaf package - { - List configSetup = new List(); - configSetup.Add(pluginA2.Name); - - cases.Add(new PackageRestoreTestCase( - "Partial Uninstall, Leaf", - repository, - new[] { libraryA2, pluginA2, pluginB2 }, - configSetup, - new[] { libraryA2, pluginA2 })); - } - - // Uninstall of a package that others depend on - { - List configSetup = new List(); - configSetup.Add(pluginB2.Name); - - // Duality will first uninstall pluginA2, but then re-install it - // while verifying pluginB2, so we expect both an install and an - // uninstall for that package. - cases.Add(new PackageRestoreTestCase( - "Dependency Uninstall, Reinstall", - repository, - new[] { libraryA2, pluginA2, pluginB2 }, - configSetup, - new[] { libraryA2, pluginA2, pluginB2 }, - new[] { libraryA2, pluginA2 }, - new[] { libraryA2, pluginA2 })); - } - - // Uninstall of a package which has an older version that others depend on - { - List configSetup = new List(); - configSetup.Add(pluginD1.Name); - - // Duality will first uninstall pluginA2, but then re-install an - // older version of it because pluginD1 requires that as a dependency. - cases.Add(new PackageRestoreTestCase( - "Dependency Uninstall, Revert to Old", - repository, - new[] { libraryA2, pluginA2, pluginD1 }, - configSetup, - new[] { libraryA1, pluginA1, pluginD1 })); - } - - return cases; - } - - [Test] public void MultiFrameworkPackage() - { - // Let's see how the package manager handles a package with multiple frameworks - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - MockPackageSpec dualityPluginA = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA"); - MockPackageSpec dualityPluginB = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB"); - dualityPluginB.AddDependency("net45", dualityPluginA.Name); - dualityPluginB.AddDependency("netstandard1.1", dualityPluginA.Name); - - List repository = new List(); - repository.Add(dualityPluginA); - repository.Add(dualityPluginB); - - // Prepare the test by setting up remote repository and pre-installed local packages - this.SetupReporistoryForTest(repository); - - // Install pluginB and check if it correctly installs - packageManager.InstallPackage(dualityPluginB.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA, dualityPluginB }); - } - [Test] public void MultiFrameworkPackageWithDifferentDependencies() - { - // Let's see how the package manager handles a package with multiple frameworks but the dependencies also differ per framework - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - MockPackageSpec dualityPluginA = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA"); - MockPackageSpec dualityPluginB = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB"); - MockPackageSpec dualityPluginC = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginC"); - dualityPluginA.AddDependency("netstandard1.1", dualityPluginB.Name); - dualityPluginA.AddDependency("net45", dualityPluginC.Name); - - List repository = new List(); - repository.Add(dualityPluginA); - repository.Add(dualityPluginB); - repository.Add(dualityPluginC); - - // Prepare the test by setting up remote repository and pre-installed local packages - this.SetupReporistoryForTest(repository); - - // Install plugin A which should bring along its .NET Framework 4.5 dependency, but not - // the .NET Standard 1.1 one. - packageManager.InstallPackage(dualityPluginA.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA, dualityPluginC }); - } - [Test] public void MultiFrameworkPackageWithUnsupportedFramework() - { - // Let's see how the package manager handles a package with multiple frameworks but one of the targetframeworks is unsupported! - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - MockPackageSpec dualityPluginA = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA"); - MockPackageSpec dualityPluginB = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB"); - - dualityPluginB.AddDependency("net45", dualityPluginA.Name); - dualityPluginB.AddDependency("foo", new PackageName("SomeNonexistentPackage", new Version(1, 0, 0))); - - List repository = new List(); - repository.Add(dualityPluginA); - repository.Add(dualityPluginB); - - // Prepare the test by setting up remote repository and pre-installed local packages - this.SetupReporistoryForTest(repository); - - // Install pluginB and check if it correctly installs - packageManager.InstallPackage(dualityPluginB.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA, dualityPluginB }); - } - - [Test] public void DuplicatePackage() - { - // Let's try to trick the package manager into having a duplicate version installed! - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - MockPackageSpec dualityPluginA_Old = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA", new Version(0, 9, 0, 0)); - MockPackageSpec dualityPluginA_New = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA", new Version(1, 0, 0, 0)); - MockPackageSpec dualityPluginB = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB", new Version(1, 0, 0, 0)); - MockPackageSpec dualityPluginC = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginC", new Version(1, 0, 0, 0)); - dualityPluginB.AddDependency(dualityPluginA_New.Name); - dualityPluginC.AddDependency(dualityPluginA_Old.Name); - - List repository = new List(); - repository.Add(dualityPluginA_Old); - repository.Add(dualityPluginA_New); - repository.Add(dualityPluginB); - repository.Add(dualityPluginC); - - // Prepare the test by setting up remote repository and pre-installed local packages - this.SetupReporistoryForTest(repository); - - // Install the old version first. Nothing special happens. - packageManager.InstallPackage(dualityPluginA_Old.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA_Old }); - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync."); - - // Install a newer version without uninstalling the old one. - // Expect the newer version to replace the old. - packageManager.InstallPackage(dualityPluginA_New.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA_New }); - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync."); - - // Install an older version without uninstalling the newer one. - // Expect the newer version to persist with no old version being installed. - packageManager.InstallPackage(dualityPluginA_Old.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA_New }); - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync."); - - // Downgrade from new to old explicitly - packageManager.UninstallPackage(dualityPluginA_New.Name); - packageManager.InstallPackage(dualityPluginA_Old.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA_Old }); - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync."); - - // Install a package that depends on the newer version of the package. - // Expect an update, but not a duplicate. - packageManager.InstallPackage(dualityPluginB.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA_New, dualityPluginB }); - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync."); - - // Install a package that depends on the older version of the package. - // Expect the newer version to be used because it was already there. - packageManager.InstallPackage(dualityPluginC.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA_New, dualityPluginB, dualityPluginC }); - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync."); - } - [Test] public void InstallNonExistent() - { - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - // Prepare the test by setting up remote repository and pre-installed local packages - MockPackageSpec dualityPluginA = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA"); - List repository = new List(); - repository.Add(dualityPluginA); - this.SetupReporistoryForTest(repository); - - // Install a non-existent package, invariant version - Assert.Throws(() => - { - packageManager.InstallPackage(new PackageName("Unknown.Doesnt.Exist")); - }); - - // Install a non-existent package, specific version - Assert.Throws(() => - { - packageManager.InstallPackage(new PackageName("Unknown.Doesnt.Exist", new Version(1, 0, 0, 0))); - }); - - // Install an existing package in a non-existent version - Assert.Throws(() => - { - packageManager.InstallPackage(new PackageName(dualityPluginA.Name.Id, new Version(9, 8, 7, 6))); - }); - - // Install a regular, existing package - packageManager.InstallPackage(dualityPluginA.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA }); - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync."); - } - [Test] public void UninstallNonExistent() - { - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - // Prepare the test by setting up remote repository and pre-installed local packages - MockPackageSpec dualityPluginA = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA"); - List repository = new List(); - repository.Add(dualityPluginA); - this.SetupReporistoryForTest(repository); - - // Uninstall a package that is not installed - packageManager.UninstallPackage(dualityPluginA.Name); - - // Uninstall a package that does not exist at all - packageManager.UninstallPackage(new PackageName("Unknown.Doesnt.Exist")); - packageManager.UninstallPackage(new PackageName("Unknown.Doesnt.Exist", new Version(9, 8, 7, 6))); - packageManager.UninstallPackage(new PackageName(dualityPluginA.Name.Id, new Version(9, 8, 7, 6))); - } - [Test] public void UpdateNonExistent() - { - PackageManager packageManager = new PackageManager(this.workEnv, this.setup); - - // Prepare the test by setting up remote repository and pre-installed local packages - MockPackageSpec dualityPluginA = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginA"); - MockPackageSpec dualityPluginB = MockPackageSpec.CreateDualityPlugin("AdamsLair.Duality.TestPluginB"); - List repository = new List(); - repository.Add(dualityPluginA); - repository.Add(dualityPluginB); - this.SetupReporistoryForTest(repository); - - // Install a regular, existing package - packageManager.InstallPackage(dualityPluginA.Name); - this.AssertLocalSetup(packageManager.LocalSetup, new[] { dualityPluginA }); - Assert.IsFalse(packageManager.IsPackageSyncRequired, "Package setup out of sync."); - - // Update the existing package - packageManager.UpdatePackage(dualityPluginA.Name); - - // Update a package that does not exist at all - Assert.Throws(() => - { - packageManager.UpdatePackage(new PackageName("Unknown.Doesnt.Exist")); - }); - - // Update a package that is not installed - Assert.Throws(() => - { - packageManager.UpdatePackage(dualityPluginB.Name); - }); - } - - - private void SetupReporistoryForTest(IEnumerable repository) - { - foreach (MockPackageSpec package in repository) - { - package.CreatePackage(TestPackageBuildPath, TestRepositoryPath); - } - } - private void SetupPackagesForTest(PackageManager packageManager, IEnumerable setup) - { - try - { - // Install all required packages - foreach (MockPackageSpec package in setup) - { - PackageInfo packageInfo = packageManager.GetPackage(package.Name); - if (packageInfo == null || packageInfo.Name != package.Name) - { - Assert.Inconclusive( - "Failed to create the required package setup for the test. Unable to retrieve package '{0}'", - package.Name); - } - - packageManager.InstallPackage(packageInfo.Name); - } - - // Make sure all required packages are really there - foreach (MockPackageSpec package in setup) - { - // Skip checking non-Duality packages, as they do not show up in - // the local package setup and thus would always fail this check. - bool isDualityPackage = package.Tags.Contains(PackageManager.DualityTag); - if (!isDualityPackage) continue; - - LocalPackage localPackage = packageManager.LocalSetup.GetPackage(package.Name); - if (localPackage == null) - { - Assert.Inconclusive( - "Failed to create the required package setup for the test. Install failed for package '{0}'", - package.Name); - } - } - - // Make sure that the install didn't leave the setup out of sync with the install - if (packageManager.IsPackageSyncRequired) - { - Assert.Inconclusive( - "Failed to create the required package setup for the test. " + - "Local setup out of sync with installs."); - } - - // Apply all scheduled copy and delete operations immediately - if (File.Exists(this.workEnv.UpdateFilePath)) - { - PackageUpdateSchedule applyScript = PackageUpdateSchedule.Load(this.workEnv.UpdateFilePath); - applyScript.ApplyChanges(applyScript.Items); - - // Get rid of the other scheduled updates - File.Delete(this.workEnv.UpdateFilePath); - } - } - catch (Exception e) - { - Assert.Inconclusive( - "Failed to create the required package setup for the test because an exception occurred: {0}", - e); - } - } - - private void AssertLocalSetup(PackageSetup actualSetup, IEnumerable expectedSetup) - { - Assert.AreEqual( - expectedSetup.Count(), - actualSetup.Packages.Count, - "Number of registered Duality packages in local setup"); - CollectionAssert.AreEquivalent( - expectedSetup.Select(p => p.Name), - actualSetup.Packages.Select(p => p.Name), - "Registered Duality packages in local setup"); - } - private void AssertUpdateSchedule(IEnumerable installed, IEnumerable uninstalled) - { - bool anyUpdateExpected = installed.Any() || uninstalled.Any(); - bool updateScheduleExists = File.Exists(this.workEnv.UpdateFilePath); - - // Assert that the existence of an update file reflects whether we expect an update - if (!anyUpdateExpected) - { - Assert.IsFalse(updateScheduleExists); - return; - } - else - { - Assert.IsTrue(updateScheduleExists); - } - - // Load the update schedule to check its contents - PackageUpdateSchedule applyScript = PackageUpdateSchedule.Load(this.workEnv.UpdateFilePath); - List updateItems = applyScript.Items.ToList(); - - // Assert that every install has a matching copy for each of its files. - HashSet writtenFiles = new HashSet(); - foreach (MockPackageSpec package in installed) - { - foreach (var pair in package.LocalMapping) - { - this.AssertUpdateScheduleCopy( - updateItems, - package.Name, - pair.Key, - pair.Value); - - // Note that an install can supersede a previous uninstall by copying a - // file into the same location. Keep track of all written files to check this. - bool uniqueCopy = writtenFiles.Add(pair.Value); - - // Assert that we don't copy multiple files to the same target location. - // The package manager should take care of resolving this up front. - Assert.IsTrue(uniqueCopy); - } - } - - // Assert that every uninstall has a matching delete for each of its files. - foreach (MockPackageSpec package in uninstalled) - { - foreach (var pair in package.LocalMapping) - { - // If the file we expect to see deleted was overwritten instead, skip - // the assert to account for update situations where an uninstall is - // immediately followed by an install. - if (writtenFiles.Contains(pair.Value)) - continue; - - this.AssertUpdateScheduleDelete( - updateItems, - package.Name, - pair.Value); - } - } - } - private void AssertUpdateScheduleCopy(IEnumerable items, PackageName package, string source, string target) - { - string sourceAbs = Path.Combine(this.workEnv.RepositoryPath, package.Id + "." + package.Version, source); - string targetAbs = Path.Combine(this.workEnv.RootPath, target); - - foreach (XElement item in items) - { - if (item.Name != PackageUpdateSchedule.CopyItem) continue; - if (!PathOp.ArePathsEqual(item.GetAttributeValue("source"), sourceAbs)) continue; - - string itemTarget = item.GetAttributeValue("target"); - Assert.IsTrue( - PathOp.ArePathsEqual(itemTarget, targetAbs), - "Found copy instruction with the expected source, but the target differs." + Environment.NewLine + - " Matching source: '{0}'" + Environment.NewLine + - " Expected target: '{1}'" + Environment.NewLine + - " Actual target: '{2}'", - sourceAbs, - targetAbs, - itemTarget); - Assert.IsTrue( - File.Exists(sourceAbs), - "Found copy instruction with the expected source, but the source file does not exist." + Environment.NewLine + - " Matching source: '{0}'", - sourceAbs); - return; - } - - Assert.Fail( - "Expected copy instruction, but found no matching item." + Environment.NewLine + - " {0} update schedule items" + Environment.NewLine + - " Expected source: '{1}'" + Environment.NewLine + - " Expected target: '{2}'", - items.Count(), - sourceAbs, - targetAbs); - } - private void AssertUpdateScheduleDelete(IEnumerable items, PackageName package, string target) - { - string targetAbs = Path.Combine(this.workEnv.RootPath, target); - - foreach (XElement item in items) - { - if (item.Name != PackageUpdateSchedule.DeleteItem) continue; - if (PathOp.ArePathsEqual(item.GetAttributeValue("target"), targetAbs)) - { - return; - } - } - - Assert.Fail( - "Expected delete instruction, but found no matching item." + Environment.NewLine + - " {0} update schedule items" + Environment.NewLine + - " Expected target: '{1}'", - items.Count(), - targetAbs); - } - } -} diff --git a/Test/Editor/PackageManagement/PackageOperationTestCase.cs b/Test/Editor/PackageManagement/PackageOperationTestCase.cs deleted file mode 100644 index 3e3b0c28f..000000000 --- a/Test/Editor/PackageManagement/PackageOperationTestCase.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Collections.Generic; -using System.Xml; -using System.Xml.Linq; - -using Duality.IO; - -using NUnit.Framework; - -namespace Duality.Editor.PackageManagement.Tests -{ - /// - /// Describes a test case for a package install / uninstall / update test in . - /// - public class PackageOperationTestCase - { - private string name; - private List setup; - private MockPackageSpec target; - private List installed; - private List uninstalled; - private List results; - private List dualityResults; - private HashSet repository; - - - /// - /// [GET] A list of all packages that are prepared to be present when - /// the operation is performed. - /// - public IReadOnlyList Setup - { - get { return this.setup; } - } - /// - /// [GET] The package on which the test operation will be performed. - /// - public MockPackageSpec Target - { - get { return this.target; } - } - /// - /// [GET] A list of all packages that are expected to have been installed during the test. - /// - public IReadOnlyList Installed - { - get { return this.installed; } - } - /// - /// [GET] A list of all packages that are expected to have been uninstalled during the test. - /// - public IReadOnlyList Uninstalled - { - get { return this.uninstalled; } - } - /// - /// [GET] A list of all packages that are expected to be present after - /// the operation is completed. - /// - public IReadOnlyList Results - { - get { return this.results; } - } - /// - /// [GET] A list of all Duality packages that are expected to be present after - /// the operation is completed. - /// This is a subset of . - /// - public IReadOnlyList DualityResults - { - get { return this.dualityResults; } - } - /// - /// [GET] Enumerates all packages that need to be available in the remote mock - /// repository in order to perform this test. - /// - public IEnumerable Repository - { - get { return this.repository; } - } - - - public PackageOperationTestCase(string name, MockPackageSpec target, IEnumerable results) : this(name, null, target, results) { } - public PackageOperationTestCase(string name, IEnumerable setup, MockPackageSpec target, IEnumerable results) - { - this.name = name; - this.target = target; - this.setup = (setup ?? Enumerable.Empty()).ToList(); - this.results = (results ?? Enumerable.Empty()).ToList(); - this.installed = this.results.Except(this.setup).ToList(); - this.uninstalled = this.setup.Except(this.results).ToList(); - this.dualityResults = this.results - .Where(p => p.Tags.Contains(PackageManager.DualityTag)) - .ToList(); - - this.repository = new HashSet(); - this.repository.Add(this.target); - foreach (MockPackageSpec packageSpec in this.results) - this.repository.Add(packageSpec); - foreach (MockPackageSpec packageSpec in this.setup) - this.repository.Add(packageSpec); - } - - public override string ToString() - { - return this.name; - } - } -} diff --git a/Test/Editor/PackageManagement/PackageRestoreTestCase.cs b/Test/Editor/PackageManagement/PackageRestoreTestCase.cs deleted file mode 100644 index 54c0fc444..000000000 --- a/Test/Editor/PackageManagement/PackageRestoreTestCase.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Collections.Generic; -using System.Xml; -using System.Xml.Linq; - -using Duality.IO; - -using NUnit.Framework; - -namespace Duality.Editor.PackageManagement.Tests -{ - /// - /// Describes a test case for a package restore / verify test in . - /// - public class PackageRestoreTestCase - { - private string name; - private List preSetup; - private List desiredSetup; - private List installed; - private List uninstalled; - private List results; - private List dualityResults; - private List repository; - - - /// - /// [GET] A list of all packages that are prepared to be already present when - /// the restore operation is performed. - /// - public IReadOnlyList PreSetup - { - get { return this.preSetup; } - } - /// - /// [GET] The desired package setup as specified in the config file. - /// - public IReadOnlyList DesiredSetup - { - get { return this.desiredSetup; } - } - /// - /// [GET] A list of all packages that are expected to have been installed during the test. - /// - public IReadOnlyList Installed - { - get { return this.installed; } - } - /// - /// [GET] A list of all packages that are expected to have been uninstalled during the test. - /// - public IReadOnlyList Uninstalled - { - get { return this.uninstalled; } - } - /// - /// [GET] A list of all packages that are expected to be present after - /// the restore operation is completed. - /// - public IReadOnlyList Results - { - get { return this.results; } - } - /// - /// [GET] A list of all Duality packages that are expected to be present after - /// the restore operation is completed. - /// This is a subset of . - /// - public IReadOnlyList DualityResults - { - get { return this.dualityResults; } - } - /// - /// [GET] Enumerates all packages that need to be available in the remote mock - /// repository in order to perform this test. - /// - public IReadOnlyList Repository - { - get { return this.repository; } - } - - - public PackageRestoreTestCase(string name, IEnumerable repository, IEnumerable preSetup, IEnumerable desiredSetup, IEnumerable results) - : this(name, repository, preSetup, desiredSetup, results, null, null) { } - public PackageRestoreTestCase(string name, IEnumerable repository, IEnumerable preSetup, IEnumerable desiredSetup, IEnumerable results, IEnumerable installed, IEnumerable uninstalled) - { - this.name = name; - this.preSetup = preSetup.ToList(); - this.desiredSetup = desiredSetup.ToList(); - this.results = results.ToList(); - this.installed = (installed ?? this.results.Except(this.preSetup)).ToList(); - this.uninstalled = (uninstalled ?? this.preSetup.Except(this.results)).ToList(); - this.dualityResults = this.results - .Where(p => p.Tags.Contains(PackageManager.DualityTag)) - .ToList(); - - this.repository = repository.ToList(); - } - - public override string ToString() - { - return this.name; - } - } -} diff --git a/Tools/NightlyBuilder/Program.cs b/Tools/NightlyBuilder/Program.cs index 14ddf6f7e..d367f2e88 100644 --- a/Tools/NightlyBuilder/Program.cs +++ b/Tools/NightlyBuilder/Program.cs @@ -336,13 +336,13 @@ public static void PerformNightlyBuild(ConfigFile config) } } - if (skip) - { - Console.ForegroundColor = ConsoleColor.Yellow; - Console.WriteLine("dependency mismatch (skip)"); - Console.ResetColor(); - continue; - } + //if (skip) + //{ + // Console.ForegroundColor = ConsoleColor.Yellow; + // Console.WriteLine("dependency mismatch (skip)"); + // Console.ResetColor(); + // continue; + //} XElement elemId = doc.Descendants("id").FirstOrDefault(); XElement elemVersion = doc.Descendants("version").FirstOrDefault(); @@ -357,7 +357,7 @@ public static void PerformNightlyBuild(ConfigFile config) packResult); // If in non-interactive mode, continue to build packages even if one of them failed. - if (config.NonInteractive) + if (true) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("failed"); @@ -503,6 +503,7 @@ private static bool BuildVisualStudioSolution(string solutionFile, string config searchPaths.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Microsoft Visual Studio")); foreach (string baseDir in searchPaths) { + if (!Directory.Exists(baseDir)) continue; foreach (string candidatePath in Directory.EnumerateFiles(baseDir, "msbuild.exe", SearchOption.AllDirectories)) { msBuildPath = candidatePath;