Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Commit

Permalink
So. Much. Docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
vainamov committed Mar 11, 2019
1 parent d5fff78 commit 463d9ab
Show file tree
Hide file tree
Showing 31 changed files with 620 additions and 116 deletions.
2 changes: 1 addition & 1 deletion Config/SettingsProvider.cs
Expand Up @@ -25,7 +25,7 @@ public static class SettingsProvider
ConfigManager.Instance.Values = JsonConvert.DeserializeObject<ConfigValues>(JsonConvert.SerializeObject(model));
ConfigManager.Instance.Save();

Target.All.SendPackageTo(new Package(PackageType.MetaResponse, new ServerMetaResponsePackageContent {
Target.All.SendPackage(new Package(PackageType.MetaResponse, new ServerMetaResponsePackageContent {
GuestsAllowed = ConfigManager.Instance.Values.GuestsAllowed,
Name = ConfigManager.Instance.Values.ServerName,
RegistrationAllowed = ConfigManager.Instance.Values.RegistrationAllowed
Expand Down
10 changes: 9 additions & 1 deletion Extensibility/Events/ConnectEventArgs.cs
Expand Up @@ -3,12 +3,20 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for the <see cref="EventType.Connected"/> event.
/// Provides the data for the <see cref="EventType.Connected"/> event.
/// </summary>
public class ConnectEventArgs
{
/// <summary>
/// The <see cref="Networking.Client"/> connecting.
/// </summary>
public Client Client { get; }


/// <summary>
/// Initializes a new instance of the <see cref="ConnectEventArgs"/> class.
/// </summary>
/// <param name="client"> The <see cref="Networking.Client"/> connecting.</param>
public ConnectEventArgs(Client client) {
this.Client = client;
}
Expand Down
15 changes: 14 additions & 1 deletion Extensibility/Events/CreateElementEventArgs.cs
Expand Up @@ -3,14 +3,27 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for all create events.
/// Provides the data for all create events.
/// </summary>
/// <typeparam name="TElement">A creatable element.</typeparam>
public class CreateElementEventArgs<TElement> : ICancellableEvent
{
/// <summary>
/// The <see cref="User"/> creating the <see cref="TElement"/>.
/// </summary>
public User Creator { get; }

/// <summary>
/// The element created by the <see cref="User"/>.
/// </summary>
public TElement Element { get; }


/// <summary>
/// Initializes a new instance of the <see cref="CreateElementEventArgs{TElement}"/> class.
/// </summary>
/// <param name="creator">The <see cref="User"/> creating the <see cref="TElement"/>.</param>
/// <param name="element">The element created by the <see cref="User"/>.</param>
public CreateElementEventArgs(User creator, TElement element) {
this.Creator = creator;
this.Element = element;
Expand Down
22 changes: 20 additions & 2 deletions Extensibility/Events/CustomEventArgs.cs
@@ -1,11 +1,29 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for the <see cref="EventType.Custom"/> event.
/// Provides the data for the <see cref="EventType.Custom"/> event.
/// </summary>
public class CustomEventArgs
{
// TODO
/// <summary>
/// The name of this <see cref="CustomEventArgs"/>.
/// </summary>
public string Name { get; }

/// <summary>
/// The content of this <see cref="CustomEventArgs"/>.
/// </summary>
public object[] Content { get; }


/// <summary>
/// Initializes a new instance of the <see cref="CustomEventArgs"/> class.
/// </summary>
/// <param name="name">The name of this <see cref="CustomEventArgs"/>.</param>
/// <param name="content">The content of this <see cref="CustomEventArgs"/>.</param>
public CustomEventArgs(string name, params object[] content) {
this.Name = name;
this.Content = content;
}
}
}
25 changes: 24 additions & 1 deletion Extensibility/Events/DisconnectEventArgs.cs
Expand Up @@ -3,15 +3,38 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for the <see cref="EventType.Disconnected"/> event.
/// Provides the data for the <see cref="EventType.Disconnected"/> event.
/// </summary>
public class DisconnectEventArgs
{
/// <summary>
/// The <see cref="Client"/> disconnecting.
/// </summary>
public Client Client { get; }

/// <summary>
/// The code of the disconnect provided by the socket.
/// </summary>
public ushort Code { get; }

/// <summary>
/// The reason of the disconnect provided by the socket.
/// </summary>
public string Reason { get; }

/// <summary>
/// Determines whether the disconnect was clean.
/// </summary>
public bool WasClean { get; }


/// <summary>
/// Initializes a new instance of the <see cref="DisconnectEventArgs"/> class.
/// </summary>
/// <param name="client">The <see cref="Client"/> disconnecting.</param>
/// <param name="code">The code of the disconnect provided by the socket.</param>
/// <param name="reason">The reason of the disconnect provided by the socket.</param>
/// <param name="wasClean">Whether the disconnect was clean.</param>
public DisconnectEventArgs(Client client, ushort code, string reason, bool wasClean) {
this.Client = client;
this.Code = code;
Expand Down
15 changes: 14 additions & 1 deletion Extensibility/Events/EditElementEventArgs.cs
Expand Up @@ -3,14 +3,27 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for all edit events.
/// Provides the data for all edit events.
/// </summary>
/// <typeparam name="TElement">An editable element.</typeparam>
public class EditElementEventArgs<TElement> : ICancellableEvent
{
/// <summary>
/// The <see cref="User"/> editing the <see cref="TElement"/>.
/// </summary>
public User Editor { get; }

/// <summary>
/// The element the <see cref="User"/> edited.
/// </summary>
public TElement Element { get; }


/// <summary>
/// Initializes a new instance of the <see cref="EditElementEventArgs{TElement}"/> class.
/// </summary>
/// <param name="editor">The <see cref="User"/> editing the <see cref="TElement"/>.</param>
/// <param name="element">The element the <see cref="User"/> edited.</param>
public EditElementEventArgs(User editor, TElement element) {
this.Editor = editor;
this.Element = element;
Expand Down
4 changes: 3 additions & 1 deletion Extensibility/Events/EventType.cs
@@ -1,4 +1,5 @@
using Neo.Core.Communication;
using System;
using Neo.Core.Communication;
using Neo.Core.Networking;
using Neo.Core.Shared;

Expand Down Expand Up @@ -157,6 +158,7 @@ public enum EventType
/// <summary>
/// This event is raised when a <see cref="User"/> is typing.
/// </summary>
[Obsolete]
Typing,

/// <summary>
Expand Down
16 changes: 16 additions & 0 deletions Extensibility/Events/InputEventArgs.cs
Expand Up @@ -2,11 +2,27 @@

namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides the data for the <see cref="EventType.Input"/> event.
/// </summary>
public class InputEventArgs : ICancellableEvent
{
/// <summary>
/// The sender of the input.
/// </summary>
public User Sender { get; }

/// <summary>
/// The input sent.
/// </summary>
public string Input { get; }


/// <summary>
/// Initializes a new instance of the <see cref="InputEventArgs"/> class.
/// </summary>
/// <param name="sender">The sender of the input.</param>
/// <param name="input">The input sent.</param>
public InputEventArgs(User sender, string input) {
this.Sender = sender;
this.Input = input;
Expand Down
15 changes: 14 additions & 1 deletion Extensibility/Events/JoinElementEventArgs.cs
Expand Up @@ -3,14 +3,27 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for all join events.
/// Provides the data for all join events.
/// </summary>
/// <typeparam name="TElement">A joinable element.</typeparam>
public class JoinElementEventArgs<TElement> : ICancellableEvent
{
/// <summary>
/// The <see cref="User"/> joining the <see cref="TElement"/>.
/// </summary>
public User Joiner { get; }

/// <summary>
/// The element the <see cref="User"/> joined.
/// </summary>
public TElement Element { get; }


/// <summary>
/// Initializes a new instance of the <see cref="JoinElementEventArgs{TElement}"/> class.
/// </summary>
/// <param name="joiner">The <see cref="User"/> joining the <see cref="TElement"/>.</param>
/// <param name="element">The element the <see cref="User"/> joined.</param>
public JoinElementEventArgs(User joiner, TElement element) {
this.Joiner = joiner;
this.Element = element;
Expand Down
15 changes: 14 additions & 1 deletion Extensibility/Events/LeaveElementEventArgs.cs
Expand Up @@ -3,14 +3,27 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for all leave events.
/// Provides the data for all leave events.
/// </summary>
/// <typeparam name="TElement">A leavable element.</typeparam>
public class LeaveElementEventArgs<TElement> : ICancellableEvent
{
/// <summary>
/// The <see cref="User"/> leaving the <see cref="TElement"/>.
/// </summary>
public User Leaver { get; }

/// <summary>
/// The element the <see cref="User"/> left.
/// </summary>
public TElement Element { get; }


/// <summary>
/// Initializes a new instance of the <see cref="LeaveElementEventArgs{TElement}"/> class.
/// </summary>
/// <param name="leaver">The <see cref="User"/> leaving the <see cref="TElement"/>.</param>
/// <param name="element">The element the <see cref="User"/> left.</param>
public LeaveElementEventArgs(User leaver, TElement element) {
this.Leaver = leaver;
this.Element = element;
Expand Down
16 changes: 14 additions & 2 deletions Extensibility/Events/ReceiveElementEventArgs.cs
Expand Up @@ -3,15 +3,27 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for all receive events.
/// Provides the data for all receive events.
/// </summary>
/// <typeparam name="TElement">A receivable element.</typeparam>
public class ReceiveElementEventArgs<TElement> : ICancellableEvent
{
// TODO
/// <summary>
/// The sender of the <see cref="TElement"/>.
/// </summary>
public Client Sender { get; }

/// <summary>
/// The element received.
/// </summary>
public TElement Element { get; }


/// <summary>
/// Initializes a new instance of the <see cref="ReceiveElementEventArgs{TElement}"/> class.
/// </summary>
/// <param name="sender">The sender of the <see cref="TElement"/>.</param>
/// <param name="element">The received element.</param>
public ReceiveElementEventArgs(Client sender, TElement element) {
this.Sender = sender;
this.Element = element;
Expand Down
15 changes: 14 additions & 1 deletion Extensibility/Events/RemoveElementEventArgs.cs
Expand Up @@ -3,14 +3,27 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for all remove events.
/// Provides the data for all remove events.
/// </summary>
/// <typeparam name="TElement">A removable element.</typeparam>
public class RemoveElementEventArgs<TElement> : ICancellableEvent
{
/// <summary>
/// The <see cref="User"/> removing the <see cref="TElement"/>.
/// </summary>
public User Remover { get; }

/// <summary>
/// The element to remove.
/// </summary>
public TElement Element { get; }


/// <summary>
/// Initializes a new instance of the <see cref="RemoveElementEventArgs{TElement}"/> class.
/// </summary>
/// <param name="remover">The <see cref="User"/> removing the <see cref="TElement"/>.</param>
/// <param name="element">The element to remove.</param>
public RemoveElementEventArgs(User remover, TElement element) {
this.Remover = remover;
this.Element = element;
Expand Down
20 changes: 19 additions & 1 deletion Extensibility/Events/TypingEventArgs.cs
Expand Up @@ -4,15 +4,33 @@
namespace Neo.Core.Extensibility.Events
{
/// <summary>
/// Provides data for the <see cref="EventType.Typing"/> event.
/// Provides the data for the <see cref="EventType.Typing"/> event.
/// </summary>
[Obsolete]
public class TypingEventArgs
{
/// <summary>
/// The <see cref="Shared.User"/> typing.
/// </summary>
public User User { get; }

/// <summary>
/// The <see cref="Channel"/> in which this <see cref="TypingEventArgs"/> was invoked.
/// </summary>
public Channel Channel { get; }

/// <summary>
/// The input of the <see cref="Shared.User"/> so far.
/// </summary>
public string CurrentInput { get; }


/// <summary>
/// Initializes a new instance of the <see cref="TypingEventArgs"/> class.
/// </summary>
/// <param name="user">The <see cref="Shared.User"/> typing.</param>
/// <param name="channel">The <see cref="Channel"/> in which this <see cref="TypingEventArgs"/> was invoked.</param>
/// <param name="currentInput">The input of the <see cref="Shared.User"/> so far.</param>
public TypingEventArgs(User user, Channel channel, string currentInput) {
this.User = user;
this.Channel = channel;
Expand Down
16 changes: 15 additions & 1 deletion Extensibility/Listener.cs
Expand Up @@ -2,12 +2,26 @@

namespace Neo.Core.Extensibility
{
// TODO: Add docs
/// <summary>
/// Represents an event listener of a <see cref="Extensibility.Plugin"/>.
/// </summary>
public class Listener
{
/// <summary>
/// The handler to execute.
/// </summary>
public MethodInfo Method { get; }

/// <summary>
/// The <see cref="Plugin"/> this <see cref="Listener"/> belongs to.
/// </summary>
public Plugin Plugin { get; }

/// <summary>
/// Initializes a new instance of the <see cref="Listener"/> class.
/// </summary>
/// <param name="method">The handler to execute.</param>
/// <param name="plugin">The <see cref="Plugin"/> this <see cref="Listener"/> belongs to.</param>
public Listener(MethodInfo method, Plugin plugin) {
this.Method = method;
this.Plugin = plugin;
Expand Down

0 comments on commit 463d9ab

Please sign in to comment.