diff --git a/.github/workflows/Nuke.yml b/.github/workflows/Nuke.yml
index a8610dc39..3e560292c 100644
--- a/.github/workflows/Nuke.yml
+++ b/.github/workflows/Nuke.yml
@@ -9,8 +9,8 @@ jobs:
runs-on: windows-2022
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Nuke Build
- run: ./.nuke/build.cmd --GitHubToken ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
+ run: ./.nuke/build.cmd PublishGitHub --GitHubToken ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/Qodana.yml b/.github/workflows/Qodana.yml
index 6ba3b0da1..38ce916ad 100644
--- a/.github/workflows/Qodana.yml
+++ b/.github/workflows/Qodana.yml
@@ -14,13 +14,14 @@ jobs:
pull-requests: write
checks: write
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 'Qodana Scan'
- uses: JetBrains/qodana-action@v2023.2
+ uses: JetBrains/qodana-action@main
with:
- args: --linter,jetbrains/qodana-dotnet:2023.3-eap
+ pr-mode: false
+ github-token: ${{ secrets.GITHUB_TOKEN }}
env:
- QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
\ No newline at end of file
+ QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
diff --git a/.nuke/build.ps1 b/.nuke/build.ps1
index 927e2a3d4..13bd335e4 100644
--- a/.nuke/build.ps1
+++ b/.nuke/build.ps1
@@ -13,7 +13,7 @@ Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference
###########################################################################
$SolutionDirectory = Split-Path $PSScriptRoot -Parent
-$BuildProjectFile = "$SolutionDirectory\Build\Build.csproj"
+$BuildProjectFile = "$SolutionDirectory\build\Build.csproj"
$TempDirectory = "$SolutionDirectory\.nuke\temp"
$DotNetGlobalFile = "$SolutionDirectory\global.json"
diff --git a/Changelog.md b/Changelog.md
index 75ca4800e..3bcc5dcc5 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,5 +1,53 @@
# Changelog
+# 2023-12-25 **2024.0.11**
+
+In this release RevitLookup welcomes you with improved visuals, support for templates to fine-tune data display, improved navigation, in-depth color support, let's take a look
+
+## General
+
+- **Navigation**. Updated navigation allows `Ctrl + Click` in the tree or grid to open any selected item or group of items in a new tab.
+ This also allows you to analyze items that RevitLookup doesn't support, how about looking at StackTrace for exceptions
+ ![изображение](https://github.com/jeremytammik/RevitLookup/assets/20504884/0c13c6da-772f-453b-9d34-bff609c04d95)
+
+- **Color Preview**. Changes to the user interface give us the ability to customize the display of any type of data.
+ And now you will be able to visually see how materials or ribbon looks like.
+ `Autodesk.Revit.DB.Color` and `System.Windows.Media.Color` are supported
+ ![изображение](https://github.com/jeremytammik/RevitLookup/assets/20504884/3b736961-26fa-4a24-b916-bb7c4fddfda9)
+
+## Improvements
+
+- **Update available notification**. Updates are now checked automatically and an icon is now displayed in the navigation area if a new version is available
+
+ ![изображение](https://github.com/jeremytammik/RevitLookup/assets/20504884/b7ab5fd0-b927-4b9a-805c-91e45fbd9f14)
+
+- **Background effects** Available on windows 11 only.
+
+ Acrylic:
+
+ ![изображение](https://github.com/jeremytammik/RevitLookup/assets/20504884/259012f7-f19d-4779-8b17-4be96a404023)
+
+ Blur:
+
+ ![изображение](https://github.com/jeremytammik/RevitLookup/assets/20504884/e8046bf0-ae48-446e-94e3-e3fdc59898e4)
+
+ The visual representation of the background depends on your desktop image and current theme
+
+- **Color extensions** Convert color to other formats HEX, CMYK, etc. Color name identification, `en` and `ru` localizations available.
+ `Autodesk.Revit.DB.Color` and `System.Windows.Media.Color` are supported
+ ![изображение](https://github.com/jeremytammik/RevitLookup/assets/20504884/668a9c5c-3239-4100-8829-63fc71c880fb)
+
+## Bugs
+
+- Fixed incorrect display when switching themes on windows 10 https://github.com/jeremytammik/RevitLookup/issues/194
+- Returned deleted notification when checking for updates
+
+## Misc
+
+- Updated developer's [guide](https://github.com/jeremytammik/RevitLookup/blob/dev/Contributing.md#styles).
+
+Here, I'm wrapping things up. Wishing everyone a splendid New Year and a joyous Christmas ahead. As always, yours truly @Nice3point 🎅
+
# 2023-12-01 **2024.0.10**
## General
diff --git a/Contributing.md b/Contributing.md
index ff7e0ae41..f6755f8b3 100644
--- a/Contributing.md
+++ b/Contributing.md
@@ -22,8 +22,8 @@ The naming should be descriptive and direct, giving a clear idea of the function
## Prerequisites for Compiling RevitLookup
-- .Net 7 SDK or newer
-- Visual Studio 2022 / JetBrains Rider 2022.3 or newer
+- .Net 8 SDK or newer
+- Visual Studio 2022 / JetBrains Rider 2023.3 or newer
## Architecture
@@ -160,4 +160,45 @@ public sealed class ElementDescriptor : Descriptor, IDescriptorConnector
.AddShortcut(bindableElement, ModifierKeys.Alt, Key.F7);
}
}
-```
\ No newline at end of file
+```
+
+## Styles
+
+The application UI is divided into templates, where each template can be customized for different types of data.
+There are several different rules for customizing TreeView, DataGrid row, DataGrid cell and they are all located in the file `RevitLookup/Views/Pages/Abstraction/SnoopViewBase.Styles.cs`.
+
+Suggested methods search for a style/template by name:
+
+```C#
+public override DataTemplate SelectTemplate(object item, DependencyObject container)
+{
+ if (item is null) return null;
+
+ var descriptor = (Descriptor) item;
+ var presenter = (FrameworkElement) container;
+ var templateName = descriptor.Value.Descriptor switch
+ {
+ ColorDescriptor => "DataGridColorCellTemplate",
+ ColorMediaDescriptor => "DataGridColorCellTemplate",
+ _ => "DefaultLookupDataGridCellTemplate"
+ };
+
+ return (DataTemplate) presenter.FindResource(templateName);
+}
+```
+
+The templates themselves are located in the `RevitLookup/Views/Controls` folder.
+For example, in the `RevitLookup/Views/Controls/DataGrid/DataGridCellTemplate.xaml` file there is a cell template that displays the text:
+
+```xaml
+
+
+
+```
+
+References to additional files must be registered in `RevitLookup/Views/Resources/RevitLookup.Ui.xaml`.
\ No newline at end of file
diff --git a/RevitLookup.UI/Controls/DynamicScrollViewer/PassiveScrollViewer.xaml b/RevitLookup.UI/Controls/DynamicScrollViewer/PassiveScrollViewer.xaml
deleted file mode 100644
index 16ddc979e..000000000
--- a/RevitLookup.UI/Controls/DynamicScrollViewer/PassiveScrollViewer.xaml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/RevitLookup.UI/Controls/InfoBadge/InfoBadge.cs b/RevitLookup.UI/Controls/InfoBadge/InfoBadge.cs
deleted file mode 100644
index adcfd2b45..000000000
--- a/RevitLookup.UI/Controls/InfoBadge/InfoBadge.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// This Source Code Form is subject to the terms of the MIT License.
-// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
-// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
-// All Rights Reserved.
-
-namespace Wpf.Ui.Controls.InfoBadge;
-
-internal class InfoBadge : System.Windows.Controls.Control { }
diff --git a/RevitLookup.UI/Controls/InfoBadge/InfoBadge.xaml b/RevitLookup.UI/Controls/InfoBadge/InfoBadge.xaml
deleted file mode 100644
index aba250787..000000000
--- a/RevitLookup.UI/Controls/InfoBadge/InfoBadge.xaml
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/RevitLookup.UI/RevitLookup.UI.csproj b/RevitLookup.UI/RevitLookup.UI.csproj
deleted file mode 100644
index afd22d5b7..000000000
--- a/RevitLookup.UI/RevitLookup.UI.csproj
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
- true
- latest
- x64
- true
- net48
- true
- enable
- CS8603;CS8618;CS8629;CS8600;CS0414;CS4014;CS8604;CS8765;CS8602;CS0168
-
-
- true
- full
- $(DefineConstants);DEBUG
-
-
- true
- none
- $(DefineConstants);RELEASE
-
-
- Wpf.Ui
- true
- false
-
-
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/RevitLookup.sln b/RevitLookup.sln
index 9d43cd291..b6925a243 100644
--- a/RevitLookup.sln
+++ b/RevitLookup.sln
@@ -3,12 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RevitLookup", "RevitLookup\RevitLookup.csproj", "{05C77115-2277-4DFC-8F95-BE37E5F1130F}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Installer", "Installer\Installer.csproj", "{B3814652-9158-4056-A721-1A380DE74BAE}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "Build\Build.csproj", "{64D9C223-D070-46CD-A635-04FD4E1BEC3C}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{374DC381-78CC-4FC7-A566-EB8C71C6369F}"
ProjectSection(SolutionItems) = preProject
Readme.md = Readme.md
@@ -17,11 +11,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Build\Build.Configuration.cs = Build\Build.Configuration.cs
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RevitLookup.UI", "RevitLookup.UI\RevitLookup.UI.csproj", "{CE5C104B-D76E-49DA-8BD6-BF472224AEC0}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Installer", "install\Installer.csproj", "{B3814652-9158-4056-A721-1A380DE74BAE}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "build\Build.csproj", "{64D9C223-D070-46CD-A635-04FD4E1BEC3C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RevitLookup", "source\RevitLookup\RevitLookup.csproj", "{05C77115-2277-4DFC-8F95-BE37E5F1130F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RevitLookup.UI", "source\RevitLookup.UI\RevitLookup.UI.csproj", "{CE5C104B-D76E-49DA-8BD6-BF472224AEC0}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RevitLookup.UI.Demo", "RevitLookup.UI.Demo\RevitLookup.UI.Demo.csproj", "{67B8906F-21B0-4CE3-82F7-8E608B9D53CA}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RevitLookup.UI.Demo", "source\RevitLookup.UI.Demo\RevitLookup.UI.Demo.csproj", "{67B8906F-21B0-4CE3-82F7-8E608B9D53CA}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "Benchmarks\Benchmarks.csproj", "{827646DF-D373-4D40-8F0B-1E9842E3CE9A}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "source\Benchmarks\Benchmarks.csproj", "{827646DF-D373-4D40-8F0B-1E9842E3CE9A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/RevitLookup.sln.DotSettings b/RevitLookup.sln.DotSettings
index ce29fdbf9..a6bc09183 100644
--- a/RevitLookup.sln.DotSettings
+++ b/RevitLookup.sln.DotSettings
@@ -22,6 +22,7 @@ Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
True
True
True
+ True
True
True
True
diff --git a/RevitLookup/Services/LookupService.cs b/RevitLookup/Services/LookupService.cs
deleted file mode 100644
index 1982aa9ed..000000000
--- a/RevitLookup/Services/LookupService.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2003-2023 by Autodesk, Inc.
-//
-// Permission to use, copy, modify, and distribute this software in
-// object code form for any purpose and without fee is hereby granted,
-// provided that the above copyright notice appears in all copies and
-// that both that copyright notice and the limited warranty and
-// restricted rights notice below appear in all supporting
-// documentation.
-//
-// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
-// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
-// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
-// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
-// UNINTERRUPTED OR ERROR FREE.
-//
-// Use, duplication, or disclosure by the U.S. Government is subject to
-// restrictions set forth in FAR 52.227-19 (Commercial Computer
-// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
-// (Rights in Technical Data and Computer Software), as applicable.
-
-using System.Windows;
-using System.Windows.Controls;
-using Microsoft.Extensions.DependencyInjection;
-using RevitLookup.Core;
-using RevitLookup.Core.Objects;
-using RevitLookup.Services.Contracts;
-using RevitLookup.Services.Enums;
-using Wpf.Ui;
-
-namespace RevitLookup.Services;
-
-public sealed class LookupService(IServiceScopeFactory scopeFactory) : ILookupService
-{
- private Window _owner;
- private Task _activeTask;
- private readonly IServiceProvider _serviceProvider = scopeFactory.CreateScope().ServiceProvider;
-
- public ILookupServiceDependsStage Snoop(SnoopableType snoopableType)
- {
- _activeTask = _serviceProvider.GetService()!.SnoopAsync(snoopableType);
- return this;
- }
-
- public ILookupServiceDependsStage Snoop(SnoopableObject snoopableObject)
- {
- _serviceProvider.GetService()!.Snoop(snoopableObject);
- return this;
- }
-
- public ILookupServiceShowStage DependsOn(IServiceProvider provider)
- {
- _owner = (Window) provider.GetService();
- return this;
- }
-
- public ILookupServiceExecuteStage Show() where T : Page
- {
- if (_activeTask is null)
- {
- ShowPage();
- }
- else
- {
- _activeTask = _activeTask.ContinueWith(_ => ShowPage(), TaskScheduler.FromCurrentSynchronizationContext());
- }
-
- return this;
-
- void ShowPage()
- {
- var window = (Window) _serviceProvider.GetService();
-
- if (_owner is null)
- {
- window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
- }
- else
- {
- window.Left = _owner.Left + 47;
- window.Top = _owner.Top + 49;
- }
-
- window.Show(RevitApi.UiApplication.MainWindowHandle);
- _serviceProvider.GetService().Navigate(typeof(T));
- }
- }
-
- public void Execute(Action handler) where T : class
- {
- if (_activeTask is null)
- {
- InvokeHandler();
- }
- else
- {
- _activeTask = _activeTask.ContinueWith(_ => InvokeHandler(), TaskScheduler.FromCurrentSynchronizationContext());
- }
-
- return;
-
- void InvokeHandler()
- {
- var service = _serviceProvider.GetService();
- handler.Invoke(service);
- }
- }
-}
\ No newline at end of file
diff --git a/RevitLookup/Views/Pages/EventsView.xaml b/RevitLookup/Views/Pages/EventsView.xaml
deleted file mode 100644
index dec83d89c..000000000
--- a/RevitLookup/Views/Pages/EventsView.xaml
+++ /dev/null
@@ -1,243 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/RevitLookup/Views/Pages/SnoopView.xaml b/RevitLookup/Views/Pages/SnoopView.xaml
deleted file mode 100644
index 61dcc42fc..000000000
--- a/RevitLookup/Views/Pages/SnoopView.xaml
+++ /dev/null
@@ -1,252 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/RevitLookup/Views/Pages/SnoopViewBase.xaml.cs b/RevitLookup/Views/Pages/SnoopViewBase.xaml.cs
deleted file mode 100644
index 81f49db71..000000000
--- a/RevitLookup/Views/Pages/SnoopViewBase.xaml.cs
+++ /dev/null
@@ -1,404 +0,0 @@
-// Copyright 2003-2023 by Autodesk, Inc.
-//
-// Permission to use, copy, modify, and distribute this software in
-// object code form for any purpose and without fee is hereby granted,
-// provided that the above copyright notice appears in all copies and
-// that both that copyright notice and the limited warranty and
-// restricted rights notice below appear in all supporting
-// documentation.
-//
-// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
-// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
-// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
-// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
-// UNINTERRUPTED OR ERROR FREE.
-//
-// Use, duplication, or disclosure by the U.S. Government is subject to
-// restrictions set forth in FAR 52.227-19 (Commercial Computer
-// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
-// (Rights in Technical Data and Computer Software), as applicable.
-
-using System.Collections;
-using System.ComponentModel;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Input;
-using CommunityToolkit.Mvvm.Input;
-using RevitLookup.Core.Contracts;
-using RevitLookup.Core.Enums;
-using RevitLookup.Core.Objects;
-using RevitLookup.Services.Contracts;
-using RevitLookup.ViewModels.Contracts;
-using RevitLookup.Views.Extensions;
-using RevitLookup.Views.Utils;
-using Wpf.Ui.Controls;
-using DataGrid = Wpf.Ui.Controls.DataGrid;
-using TreeView = Wpf.Ui.Controls.TreeView;
-using TreeViewItem = System.Windows.Controls.TreeViewItem;
-
-namespace RevitLookup.Views.Pages;
-
-public class SnoopViewBase : Page, INavigableView, INavigationAware
-{
- private readonly ISettingsService _settingsService;
- private readonly DataGrid _dataGridControl;
-
- protected SnoopViewBase(ISettingsService settingsService)
- {
- _settingsService = settingsService;
- AddShortcuts();
- }
-
- protected UIElement SearchBoxControl { get; init; }
- protected TreeView TreeViewControl { get; init; }
-
- protected DataGrid DataGridControl
- {
- get => _dataGridControl;
- init
- {
- _dataGridControl = value;
- OnDataGridChanged(value);
- }
- }
-
- public ISnoopViewModel ViewModel { get; protected init; }
-
- protected void OnTreeSourceChanged(object sender, IEnumerable enumerable)
- {
- if (IsLoaded)
- {
- SetupTreeView();
- return;
- }
-
- Loaded += OnLoaded;
-
- void OnLoaded(object o, RoutedEventArgs args)
- {
- Loaded -= OnLoaded;
- SetupTreeView();
- }
- }
-
- ///
- /// Execute collector for selection
- ///
- protected void OnTreeSelectionChanged(object sender, RoutedPropertyChangedEventArgs