Skip to content

Commit

Permalink
housekeeping: Add logo.png (#73)
Browse files Browse the repository at this point in the history
* housekeeping: Add logo.png

* Height isn't equal to width now

* Enhance readme structure

* Tiny fixes

* Whitespace
  • Loading branch information
worldbeater authored Aug 23, 2021
1 parent 25996db commit aab0f68
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
35 changes: 15 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Observable event generator
<a href="https://github.com/reactivemarbles/observableevents">
<img width="150" src="./images/logo.png"/>
</a>

This project is a .NET 5 source generator which produces `IObservable<T>` for events contained within a object including all base classes.
# Observable Event Generator

# Installation
This project is a .NET 5 source generator which produces `IObservable<T>` for events contained within a object including all base classes. `ObservableEvents` generator will convert events within an assembly and create observable wrappers for them, it is based on [Pharmacist](https://github.com/reactiveui/Pharmacist) and uses [.NET Source Generator](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview) technology.

## NuGet Packages

Expand All @@ -14,33 +16,27 @@ Install the following packages to start using Observable Events.
| ----------------------------- | ----------------- | -------------------------------- |
| [ReactiveMarbles.ObservableEvents.SourceGenerator][Core] | Core - Libary | [![CoreBadge]][Core] |


[Core]: https://www.nuget.org/packages/ReactiveMarbles.ObservableEvents.SourceGenerator/
[CoreBadge]: https://img.shields.io/nuget/v/ReactiveMarbles.ObservableEvents.SourceGenerator.svg

## What does it do?

ObservableEvents generator will convert events within an assembly and create observable wrappers for them.
## Manual Installation

It is based on pharmacist [Pharmacist](https://github.com/reactiveui/Pharmacist) and uses .NET Source Generator technology.

## Installation
Include the following in your .csproj file

```xml
<PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.0.2" PrivateAssets="all" />
<PackageReference
Include="ReactiveMarbles.ObservableEvents.SourceGenerator"
Version="1.0.2"
PrivateAssets="all" />
```

The `PrivateAssets` will prevent the ObservableEvents source generator from being inherited by other projects.

## How to use

### Instance Based
It injects a class for instance based events into your source code which will expose a extension method called `Events()`.

You need to include the namespace `ReactiveMarbles.ObservableEvents` to access to the extension method.

You can then use this to get `IObservable<T>` instances from your events.
It injects a class for instance based events into your source code which will expose a extension method called `Events()`. You need to include the namespace `ReactiveMarbles.ObservableEvents` to access to the extension method. You can then use this to get `IObservable<T>` instances from your events.

```cs
using ReactiveMarbles.ObservableEvents;
Expand All @@ -63,9 +59,8 @@ You must use include a attribute `GenerateStaticEventObservables` on the assembl

```cs
[assembly: GenerateStaticEventObservablesAttribute(typeof(StaticTest))]

public static class StaticTest
{
public static event EventHandler? TestChanged;
}
public static class StaticTest
{
public static event EventHandler? TestChanged;
}
```
Binary file added images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/reactivemarbles/ObservableEvents</PackageProjectUrl>
<PackageDescription>Allows to get an observables for property changed events.</PackageDescription>
<PackageIcon>logo.png</PackageIcon>
<Owners>glennawatson</Owners>
<PackageTags>system.reactive;propertychanged;inpc;reactive;functional</PackageTags>
<PackageReleaseNotes>https://github.com/reactivemarbles/ObservableEvents/releases</PackageReleaseNotes>
Expand All @@ -34,6 +35,7 @@

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
<None Include="$(MSBuildThisFileDirectory)..\images\logo.png" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit aab0f68

Please sign in to comment.