Skip to content

Commit

Permalink
Merge pull request #6 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Version 1.0.0
  • Loading branch information
ricaun authored Aug 28, 2024
2 parents 585841f + 03b3408 commit 54c876e
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 30 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v1

- name: NuGet Setup
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
Expand All @@ -32,4 +32,5 @@ jobs:
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
SignFile: ${{ secrets.SIGN_FILE }}
SignPassword: ${{ secrets.SIGN_PASSWORD }}
InstallationFiles: ${{ secrets.INSTALLATION_FILES }}
NugetApiUrl: ${{ secrets.NUGET_API_URL }}
NugetApiKey: ${{ secrets.NUGET_API_KEY }}
2 changes: 1 addition & 1 deletion Build/.nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "./build.schema.json",
"Solution": "../Revit.Busy.sln"
"Solution": "../ricaun.Revit.UI.Busy.sln"
}
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.0] / 2023-08-27
### Features
- `RevitBusyService` and `RevitBusyControl` to check the busy state of Revit.
### Updated
- Rename `Revit.Busy` to `ricaun.Revit.UI.Busy`.

## [0.2.2] / 2023-08-14
### Features
- Add `XmlnsPrefix` and `XmlnsDefinition` to `Revit.Busy` namespace.
Expand Down Expand Up @@ -38,7 +44,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Add `RevitBusyService`

[vNext]: ../../compare/1.0.0...HEAD
[1.0.0]: ../../compare/1.0.0
[1.0.0]: ../../compare/0.2.2...1.0.0
[0.2.2]: ../../compare/0.2.1...0.2.2
[0.2.1]: ../../compare/0.2.0...0.2.1
[0.2.0]: ../../compare/0.1.2...0.2.0
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>0.2.2</Version>
<Version>1.0.0</Version>
</PropertyGroup>
</Project>
76 changes: 66 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,92 @@
# Revit.Busy
# ricaun.Revit.UI.Busy

[![Revit 2017](https://img.shields.io/badge/Revit-2017+-blue.svg)](../..)
[![Visual Studio 2022](https://img.shields.io/badge/Visual%20Studio-2022-blue)](../..)
[![Revit 2017](https://img.shields.io/badge/Revit-2017+-blue.svg)](https://github.com/ricaun-io/ricaun.Revit.UI.Busy)
[![Visual Studio 2022](https://img.shields.io/badge/Visual%20Studio-2022-blue)](https://github.com/ricaun-io/ricaun.Revit.UI.Busy)
[![Nuke](https://img.shields.io/badge/Nuke-Build-blue)](https://nuke.build/)
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Build](../../actions/workflows/Build.yml/badge.svg)](../../actions)
[![Build](https://github.com/ricaun-io/ricaun.Revit.UI.Busy/actions/workflows/Build.yml/badge.svg)](https://github.com/ricaun-io/ricaun.Revit.UI.Busy/actions)
[![nuget](https://img.shields.io/nuget/v/ricaun.Revit.UI.Busy?logo=nuget&label=nuget&color=blue)](https://www.nuget.org/packages/ricaun.Revit.UI.Busy)

`Revit.Busy` package provides a static control to manage the busy state of Revit using the `Idling` event.
[![ricaun.Revit.UI.Busy](https://raw.githubusercontent.com/ricaun-io/ricaun.Revit.UI.Busy/develop/assets/ricaun.Revit.UI.Busy.png)](https://github.com/ricaun-io/ricaun.Revit.UI.Busy)

`ricaun.Revit.UI.Busy` package provides a static control to monitor the busy state of Revit UI using the `Idling` event.

This project was generated by the [ricaun.AppLoader](https://ricaun.com/AppLoader/) Revit plugin.

## Exemple
## RevitBusyControl

`RevitBusyControl` is a static control to monitor the busy state of Revit UI using the `Idling` event, this class need to be initialized.

### Initialize
Static initialization of the `Revit.Busy` control.
Static initialization of the `ricaun.Revit.UI.Busy` control.
```c#
UIControlledApplication application;
RevitBusyControl.Initialize(application);
```

### Binding
### RevitBusyService
The `RevitBusyService` class is available in the static `Control` property.
```c#
RevitBusyService revitBusyService = RevitBusyControl.Control;
```

### IsRevitBusy
To check if Revit is busy, use the `IsRevitBusy` property.
```c#
bool isRevitBuzy = RevitBusyControl.Control.IsRevitBusy;
```

### Binding in wpf

Binding to the `IsRevitBusy` property.
To use binding with the static `RevitBusyControl` is needed to reference the assembly `ricaun.Revit.UI.Busy` or using the `http://schemas.revit.busy.com/2024/xaml/presentation` xmlns.
```xml
xmlns:busy="http://schemas.revit.busy.com/2024/xaml/presentation"
```

The `IsRevitBusy` property can be used in the binding using the static `Control` with the `RevitBusyService`.

```xml
{Binding IsRevitBusy, Source={x:Static busy:RevitBusyControl.Control}}
```

### RevitBusyService

The `RevitBusyService` class provides a service to manage the busy state of Revit using the `Idling` event.
```c#
UIControlledApplication application;
RevitBusyService revitBusyService = new RevitBusyService(application);
```

The `RevitBusyService` need to be disposed to clear the `Idling` event.
```c#
revitBusyService.Dispose();
```

The `IsRevitBusy` property can be used to check if Revit is busy.
```c#
bool isRevitBuzy = revitBusyService.IsRevitBusy;
```

The `INotifyPropertyChanged` is available in the `RevitBusyService` class.
```c#
revitBusyService.PropertyChanged += (sender, e) =>
{
if (e.PropertyName == nameof(revitBusyService.IsRevitBusy))
{
// Do something
}
};
```

The `SetInterval` method can be used to set the interval between checks; by default, the value is 1000 milliseconds.
```c#
revitBusyService.SetInterval(1000);
```

## License

This project is [licensed](LICENSE) under the [MIT License](https://en.wikipedia.org/wiki/MIT_License).

---

Do you like this project? Please [star this project on GitHub](../../stargazers)!
Do you like this project? Please [star this project on GitHub](https://github.com/ricaun-io/ricaun.Revit.UI.Busy/stargazers)!
Binary file added assets/ricaun.Revit.UI.Busy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Revit.Busy;
using ricaun.Revit.UI.Busy;
using ricaun.Revit.UI;
using ricaun.Revit.UI.Tasks;
using System;
namespace Revit.Busy.Example.Revit
namespace ricaun.Revit.UI.Busy.Example.Revit
{
[AppLoader]
public class App : IExternalApplication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Autodesk.Revit.UI;
using System;

namespace Revit.Busy.Example.Revit.Commands
namespace ricaun.Revit.UI.Busy.Example.Revit.Commands
{
[Transaction(TransactionMode.Manual)]
public class Command : IExternalCommand, IExternalCommandAvailability
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Window x:Class="Revit.Busy.Example.Revit.Views.BusyView"
<Window x:Class="ricaun.Revit.UI.Busy.Example.Revit.Views.BusyView"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Revit.Busy.Example.Revit.Views"
xmlns:local="clr-namespace:ricaun.Revit.UI.Busy.Example.Revit.Views"
xmlns:busy="http://schemas.revit.busy.com/2024/xaml/presentation"
mc:Ignorable="d"
Background="WhiteSmoke">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Windows;
using System.Windows.Data;

namespace Revit.Busy.Example.Revit.Views
namespace ricaun.Revit.UI.Busy.Example.Revit.Views
{
[PropertyChanged.AddINotifyPropertyChangedInterface]
public partial class BusyView : Window
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</PropertyGroup>

<PropertyGroup>
<PackageId>Revit.Busy.Example</PackageId>
<PackageId>ricaun.Revit.UI.Busy.Example</PackageId>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -123,7 +123,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Revit.Busy\Revit.Busy.csproj" />
<ProjectReference Include="..\ricaun.Revit.UI.Busy\ricaun.Revit.UI.Busy.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Revit.Busy.sln → ricaun.Revit.UI.Busy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33424.131
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Revit.Busy", "Revit.Busy\Revit.Busy.csproj", "{3BAB660A-FADA-4AF0-BE2E-23B7FC5067FC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ricaun.Revit.UI.Busy", "ricaun.Revit.UI.Busy\ricaun.Revit.UI.Busy.csproj", "{3BAB660A-FADA-4AF0-BE2E-23B7FC5067FC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "Build\Build.csproj", "{A64A0CA4-19A5-4F53-8F22-19D1FDF0F6B4}"
EndProject
Expand All @@ -15,7 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{44
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Revit.Busy.Example", "Revit.Busy.Example\Revit.Busy.Example.csproj", "{CE1D2870-ABE0-4096-95DB-6D6DB724A2E9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ricaun.Revit.UI.Busy.Example", "ricaun.Revit.UI.Busy.Example\ricaun.Revit.UI.Busy.Example.csproj", "{CE1D2870-ABE0-4096-95DB-6D6DB724A2E9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System.Windows.Markup;
[assembly: XmlnsPrefix("http://schemas.revit.busy.com/2024/xaml/presentation", "revit.busy")]
[assembly: XmlnsDefinition("http://schemas.revit.busy.com/2024/xaml/presentation", "Revit.Busy")]
[assembly: XmlnsDefinition("http://schemas.revit.busy.com/2024/xaml/presentation", "ricaun.Revit.UI.Busy")]
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using ricaun.Revit.UI;
using System;

namespace Revit.Busy.Revit
namespace ricaun.Revit.UI.Busy.Revit
{
//[AppLoader]
public class App : IExternalApplication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Autodesk.Revit.UI;

namespace Revit.Busy
namespace ricaun.Revit.UI.Busy
{
/// <summary>
/// RevitBusyControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Runtime.CompilerServices;
using System.Windows.Threading;

namespace Revit.Busy
namespace ricaun.Revit.UI.Busy
{
/// <summary>
/// RevitBusyService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</PropertyGroup>

<PropertyGroup>
<PackageId>Revit.Busy</PackageId>
<PackageId>ricaun.Revit.UI.Busy</PackageId>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 54c876e

Please sign in to comment.