Skip to content

Commit 2fd9814

Browse files
authored
Merge pull request #33 from WindowsAppCommunity/arlo/event-stream-handlers
Implement Entity, User, Project, Publisher and containing role/non-role collections
2 parents d836c4b + 42c8aab commit 2fd9814

51 files changed

Lines changed: 4229 additions & 86 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/IModifiableProject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// Represents a project that can be modified.
55
/// </summary>
6-
public interface IModifiableProject : IReadOnlyProject, IModifiableEntity, IModifiableImagesCollection, IModifiableUserRoleCollection, IModifiableAccentColor, IModifiableFeaturesCollection
6+
public interface IModifiableProject : IReadOnlyProject, IReadOnlyProject<IModifiableProjectCollection<IReadOnlyProject>>, IModifiableEntity, IModifiableImagesCollection, IModifiableUserRoleCollection, IModifiableAccentColor, IModifiableFeaturesCollection
77
{
88
/// <summary>
99
/// Updates the publisher for this project.

src/IModifiablePublisher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
/// <summary>
44
/// Represents a content publisher that can be modified.
55
/// </summary>
6-
public interface IModifiablePublisher : IReadOnlyPublisher, IModifiableEntity, IModifiableAccentColor, IModifiableUserRoleCollection
6+
public interface IModifiablePublisher : IReadOnlyPublisher<IModifiablePublisherCollection<IReadOnlyPublisher>>, IReadOnlyPublisher, IModifiableEntity, IModifiableAccentColor, IModifiableUserRoleCollection
77
{
88
}

src/IReadOnlyEntity.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
using OwlCore.ComponentModel;
2+
13
namespace WindowsAppCommunity.Sdk;
24

35
/// <summary>
46
/// Represents a read-only entity with common properties and events.
57
/// </summary>
6-
public interface IReadOnlyEntity : IReadOnlyConnectionsCollection, IReadOnlyLinksCollection, IReadOnlyImagesCollection
8+
public interface IReadOnlyEntity : IReadOnlyConnectionsCollection, IReadOnlyLinksCollection, IReadOnlyImagesCollection, IHasId
79
{
810
/// <summary>
911
/// The name of the entity.
@@ -49,7 +51,7 @@ public interface IReadOnlyEntity : IReadOnlyConnectionsCollection, IReadOnlyLink
4951
/// Raised when <see cref="ForgetMe"/> is updated.
5052
/// </summary>
5153
event EventHandler<bool?>? ForgetMeUpdated;
52-
54+
5355
/// <summary>
5456
/// Raised when <see cref="IsUnlisted"/> is updated.
5557
/// </summary>

src/IReadOnlyFeaturesCollection.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ public interface IReadOnlyFeaturesCollection
1313
/// <summary>
1414
/// Raised when <see cref="Features"/> is updated.
1515
/// </summary>
16-
public event EventHandler<string[]>? FeaturesUpdated;
16+
public event EventHandler<string[]>? FeaturesAdded;
17+
18+
/// <summary>
19+
/// Raised when <see cref="Features"/> is updated.
20+
/// </summary>
21+
public event EventHandler<string[]>? FeaturesRemoved;
1722
}

src/IReadOnlyLinksCollection.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ public interface IReadOnlyLinksCollection
1111
Link[] Links { get; }
1212

1313
/// <summary>
14-
/// Raised when <see cref="Links"/> is updated.
14+
/// Raised when <see cref="Links"/> are added.
1515
/// </summary>
16-
event EventHandler<Link[]>? LinksUpdated;
16+
event EventHandler<Link[]>? LinksAdded;
17+
18+
/// <summary>
19+
/// Raised when <see cref="Links"/> are removed.
20+
/// </summary>
21+
event EventHandler<Link[]>? LinksRemoved;
1722
}

src/IReadOnlyProject.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace WindowsAppCommunity.Sdk;
1+
using OwlCore.ComponentModel;
2+
3+
namespace WindowsAppCommunity.Sdk;
24

35
/// <summary>
46
/// Represents a project.
@@ -10,8 +12,8 @@ public interface IReadOnlyProject : IReadOnlyProject<IReadOnlyProjectCollection>
1012
/// <summary>
1113
/// Represents a project.
1214
/// </summary>
13-
public interface IReadOnlyProject<out TDependencyCollection> : IReadOnlyEntity, IReadOnlyImagesCollection, IReadOnlyUserRoleCollection, IReadOnlyAccentColor, IReadOnlyFeaturesCollection
14-
where TDependencyCollection : IReadOnlyProjectCollection
15+
public interface IReadOnlyProject<out TDependencyCollection> : IReadOnlyEntity, IReadOnlyImagesCollection, IReadOnlyUserRoleCollection, IReadOnlyAccentColor, IReadOnlyFeaturesCollection, IHasId
16+
where TDependencyCollection : IReadOnlyProjectCollection<IReadOnlyProject>
1517
{
1618
/// <summary>
1719
/// The projects that this project depends on.
@@ -31,7 +33,7 @@ public interface IReadOnlyProject<out TDependencyCollection> : IReadOnlyEntity,
3133
/// <summary>
3234
/// Raised when <see cref="Dependencies"/> are updated.
3335
/// </summary>
34-
public event EventHandler<IReadOnlyPublisher> PublisherUpdated;
36+
public event EventHandler<IReadOnlyPublisher>? PublisherUpdated;
3537

3638
/// <summary>
3739
/// Gets the publisher for this project.

src/IReadOnlyProjectCollection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using OwlCore.ComponentModel;
23

34
namespace WindowsAppCommunity.Sdk;
45

@@ -12,7 +13,7 @@ public interface IReadOnlyProjectCollection : IReadOnlyProjectCollection<IReadOn
1213
/// <summary>
1314
/// Represents a collection of projects.
1415
/// </summary>
15-
public interface IReadOnlyProjectCollection<TProject>
16+
public interface IReadOnlyProjectCollection<TProject> : IHasId
1617
where TProject : IReadOnlyProject
1718
{
1819
/// <summary>

src/IReadOnlyPublisher.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace WindowsAppCommunity.Sdk;
1+
using OwlCore.ComponentModel;
2+
3+
namespace WindowsAppCommunity.Sdk;
24

35
/// <summary>
46
/// Represents a publisher, a collection of projects and collaborators who publish content to users.
@@ -10,16 +12,16 @@ public interface IReadOnlyPublisher : IReadOnlyPublisher<IReadOnlyPublisherColle
1012
/// <summary>
1113
/// Represents a publisher, a collection of projects and collaborators who publish content to users.
1214
/// </summary>
13-
public interface IReadOnlyPublisher<TPublisherCollection> : IReadOnlyEntity, IReadOnlyAccentColor, IReadOnlyUserRoleCollection
14-
where TPublisherCollection : IReadOnlyPublisherCollection
15+
public interface IReadOnlyPublisher<TPublisherCollection> : IReadOnlyEntity, IReadOnlyAccentColor, IReadOnlyUserRoleCollection, IReadOnlyProjectCollection, IHasId
16+
where TPublisherCollection : IReadOnlyPublisherCollection<IReadOnlyPublisher>
1517
{
1618
/// <summary>
1719
/// The collection of publishers that this publisher belongs to.
1820
/// </summary>
19-
public TPublisherCollection ParentPublishers { get; set; }
21+
public TPublisherCollection ParentPublishers { get; }
2022

2123
/// <summary>
2224
/// The collection of publishers that belong to this publisher.
2325
/// </summary>
24-
public TPublisherCollection ChildPublishers { get; set; }
26+
public TPublisherCollection ChildPublishers { get; }
2527
}

src/IReadOnlyPublisherCollection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using OwlCore.ComponentModel;
23

34
namespace WindowsAppCommunity.Sdk;
45

@@ -12,7 +13,7 @@ public interface IReadOnlyPublisherCollection : IReadOnlyPublisherCollection<IRe
1213
/// <summary>
1314
/// Represents a collection of publishers that can be read but not modified.
1415
/// </summary>
15-
public interface IReadOnlyPublisherCollection<TPublisher>
16+
public interface IReadOnlyPublisherCollection<TPublisher> : IHasId
1617
where TPublisher : IReadOnlyPublisher
1718
{
1819
/// <summary>

src/IReadOnlyUser.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
namespace WindowsAppCommunity.Sdk;
1+
using OwlCore.ComponentModel;
2+
3+
namespace WindowsAppCommunity.Sdk;
24

35
/// <summary>
46
/// Represents a user.
57
/// </summary>
6-
public interface IReadOnlyUser : IReadOnlyEntity, IReadOnlyPublisherRoleCollection, IReadOnlyProjectRoleCollection
8+
public interface IReadOnlyUser : IReadOnlyEntity, IReadOnlyPublisherRoleCollection, IReadOnlyProjectRoleCollection, IHasId
79
{
810
}

0 commit comments

Comments
 (0)