From 5267460391c0da4da78226a3a820af976ad32b02 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 8 Oct 2013 20:14:42 -0400 Subject: [PATCH] added IServerEvents --- .../MediaBrowser.Model.Portable.csproj | 6 + .../MediaBrowser.Model.net35.csproj | 9 + MediaBrowser.Model/ApiClient/IServerEvents.cs | 104 +++++++++++ .../ApiClient/ServerEventArgs.cs | 171 ++++++++++++++++++ MediaBrowser.Model/MediaBrowser.Model.csproj | 2 + MediaBrowser.Mono.userprefs | 4 +- Nuget/MediaBrowser.Common.Internal.nuspec | 4 +- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 +- 9 files changed, 299 insertions(+), 7 deletions(-) create mode 100644 MediaBrowser.Model/ApiClient/IServerEvents.cs create mode 100644 MediaBrowser.Model/ApiClient/ServerEventArgs.cs diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj index 926c680b8..d91d72e80 100644 --- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj +++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj @@ -68,6 +68,12 @@ ApiClient\IApiClient.cs + + ApiClient\IServerEvents.cs + + + ApiClient\ServerEventArgs.cs + Configuration\BaseApplicationConfiguration.cs diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj index 8d7ad5721..4d62b472d 100644 --- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj +++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj @@ -52,6 +52,15 @@ + + ApiClient\HttpResponseEventArgs.cs + + + ApiClient\IServerEvents.cs + + + ApiClient\ServerEventArgs.cs + Configuration\BaseApplicationConfiguration.cs diff --git a/MediaBrowser.Model/ApiClient/IServerEvents.cs b/MediaBrowser.Model/ApiClient/IServerEvents.cs new file mode 100644 index 000000000..23ec51559 --- /dev/null +++ b/MediaBrowser.Model/ApiClient/IServerEvents.cs @@ -0,0 +1,104 @@ +using System; + +namespace MediaBrowser.Model.ApiClient +{ + /// + /// Interface IServerEvents + /// + public interface IServerEvents + { + /// + /// Occurs when [user deleted]. + /// + event EventHandler UserDeleted; + /// + /// Occurs when [scheduled task started]. + /// + event EventHandler ScheduledTaskStarted; + /// + /// Occurs when [scheduled task ended]. + /// + event EventHandler ScheduledTaskEnded; + /// + /// Occurs when [package installing]. + /// + event EventHandler PackageInstalling; + /// + /// Occurs when [package installation failed]. + /// + event EventHandler PackageInstallationFailed; + /// + /// Occurs when [package installation completed]. + /// + event EventHandler PackageInstallationCompleted; + /// + /// Occurs when [package installation cancelled]. + /// + event EventHandler PackageInstallationCancelled; + /// + /// Occurs when [user updated]. + /// + event EventHandler UserUpdated; + /// + /// Occurs when [plugin uninstalled]. + /// + event EventHandler PluginUninstalled; + /// + /// Occurs when [library changed]. + /// + event EventHandler LibraryChanged; + + /// + /// Occurs when [browse command]. + /// + event EventHandler BrowseCommand; + /// + /// Occurs when [play command]. + /// + event EventHandler PlayCommand; + /// + /// Occurs when [playstate command]. + /// + event EventHandler PlaystateCommand; + /// + /// Occurs when [message command]. + /// + event EventHandler MessageCommand; + /// + /// Occurs when [system command]. + /// + event EventHandler SystemCommand; + /// + /// Occurs when [notification added]. + /// + event EventHandler NotificationAdded; + /// + /// Occurs when [notification updated]. + /// + event EventHandler NotificationUpdated; + /// + /// Occurs when [notifications marked read]. + /// + event EventHandler NotificationsMarkedRead; + /// + /// Occurs when [server restarting]. + /// + event EventHandler ServerRestarting; + /// + /// Occurs when [server shutting down]. + /// + event EventHandler ServerShuttingDown; + /// + /// Occurs when [sessions updated]. + /// + event EventHandler SessionsUpdated; + /// + /// Occurs when [restart required]. + /// + event EventHandler RestartRequired; + /// + /// Occurs when [user data changed]. + /// + event EventHandler UserDataChanged; + } +} diff --git a/MediaBrowser.Model/ApiClient/ServerEventArgs.cs b/MediaBrowser.Model/ApiClient/ServerEventArgs.cs new file mode 100644 index 000000000..d3212caf4 --- /dev/null +++ b/MediaBrowser.Model/ApiClient/ServerEventArgs.cs @@ -0,0 +1,171 @@ +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Plugins; +using MediaBrowser.Model.Session; +using MediaBrowser.Model.Tasks; +using MediaBrowser.Model.Updates; +using System; + +namespace MediaBrowser.Model.ApiClient +{ + /// + /// Class UserDeletedEventArgs + /// + public class UserDeletedEventArgs : EventArgs + { + /// + /// Gets or sets the id. + /// + /// The id. + public string Id { get; set; } + } + + public class UserDataChangedEventArgs : EventArgs + { + /// + /// Gets or sets the user. + /// + /// The user. + public UserDataChangeInfo ChangeInfo { get; set; } + } + + /// + /// Class UserUpdatedEventArgs + /// + public class UserUpdatedEventArgs : EventArgs + { + /// + /// Gets or sets the user. + /// + /// The user. + public UserDto User { get; set; } + } + + /// + /// Class ScheduledTaskStartedEventArgs + /// + public class ScheduledTaskStartedEventArgs : EventArgs + { + /// + /// Gets or sets the name. + /// + /// The name. + public string Name { get; set; } + } + + /// + /// Class ScheduledTaskEndedEventArgs + /// + public class ScheduledTaskEndedEventArgs : EventArgs + { + /// + /// Gets or sets the result. + /// + /// The result. + public TaskResult Result { get; set; } + } + + /// + /// Class PackageInstallationEventArgs + /// + public class PackageInstallationEventArgs : EventArgs + { + /// + /// Gets or sets the installation info. + /// + /// The installation info. + public InstallationInfo InstallationInfo { get; set; } + } + + /// + /// Class PluginUninstallEventArgs + /// + public class PluginUninstallEventArgs : EventArgs + { + /// + /// Gets or sets the plugin info. + /// + /// The plugin info. + public PluginInfo PluginInfo { get; set; } + } + + /// + /// Class LibraryChangedEventArgs + /// + public class LibraryChangedEventArgs : EventArgs + { + /// + /// Gets or sets the update info. + /// + /// The update info. + public LibraryUpdateInfo UpdateInfo { get; set; } + } + + /// + /// Class BrowseRequestEventArgs + /// + public class BrowseRequestEventArgs : EventArgs + { + /// + /// Gets or sets the request. + /// + /// The request. + public BrowseRequest Request { get; set; } + } + + /// + /// Class PlayRequestEventArgs + /// + public class PlayRequestEventArgs : EventArgs + { + /// + /// Gets or sets the request. + /// + /// The request. + public PlayRequest Request { get; set; } + } + + /// + /// Class PlaystateRequestEventArgs + /// + public class PlaystateRequestEventArgs : EventArgs + { + /// + /// Gets or sets the request. + /// + /// The request. + public PlaystateRequest Request { get; set; } + } + + /// + /// Class MessageCommandEventArgs + /// + public class MessageCommandEventArgs : EventArgs + { + /// + /// Gets or sets the request. + /// + /// The request. + public MessageCommand Request { get; set; } + } + + /// + /// Class SystemCommandEventArgs + /// + public class SystemCommandEventArgs : EventArgs + { + /// + /// Gets or sets the command. + /// + /// The command. + public SystemCommand Command { get; set; } + } + + /// + /// Class SessionUpdatesEventArgs + /// + public class SessionUpdatesEventArgs : EventArgs + { + public SessionInfoDto[] Sessions { get; set; } + } +} diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index adb05149a..fd450b585 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -45,6 +45,8 @@ + + diff --git a/MediaBrowser.Mono.userprefs b/MediaBrowser.Mono.userprefs index 1cbdc7c0a..3f004b5b0 100644 --- a/MediaBrowser.Mono.userprefs +++ b/MediaBrowser.Mono.userprefs @@ -5,9 +5,9 @@ - + - + diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index ff1ee204c..4fecf8fee 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.223 + 3.0.224 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption. Copyright © Media Browser 2013 - + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 2a650c467..29a9eb123 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.223 + 3.0.224 MediaBrowser.Common Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 2d30823a3..c26497b39 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.223 + 3.0.224 Media Browser.Server.Core Media Browser Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Media Browser Server. Copyright © Media Browser 2013 - +