Permalink
Browse files

Fix #14

  • Loading branch information...
paulbarbu committed Sep 30, 2012
1 parent 4713fbc commit a09e50a0f2f9dd489a14d48caccc3a1068460dbb
View
@@ -1,3 +1,5 @@
+docs/html
+docs/latex
src/data/*
*.pyc
webchat-vhost.conf
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -6,7 +6,7 @@
namespace webchat.Communication {
/// <summary>
- /// The Publisher interface used for defining publishing behaviour
+ /// Defines behaviour of publisher classes
/// </summary>
/// <typeparam name="T">The type of the Clients property
/// that the class implementing this interface will hold</typeparam>
@@ -17,7 +17,7 @@ public interface IPublisher<T> {
T Clients { get; }
/// <summary>
- /// Define how to message is actually sent to the clients
+ /// Define how the message is actually sent to the clients
/// </summary>
/// <param name="channel">The channel to publish messages on, this may be used for categorizing messages</param>
/// <param name="message">The message to be sent to every client</param>
@@ -7,7 +7,7 @@
namespace webchat.Communication {
/// <summary>
- /// Concrete implementation of IPublisher
+ /// Concrete implementation of <see cref="IPublisher<T>"/>
/// </summary>
public class Publisher : IPublisher<ConcurrentQueue<StreamWriter>> {
/// <summary>
@@ -21,7 +21,8 @@ public class Publisher : IPublisher<ConcurrentQueue<StreamWriter>> {
private readonly ConcurrentQueue<StreamWriter> clients = new ConcurrentQueue<StreamWriter>();
/// <summary>
- /// Publish a certain message on a certain channel to all clients stored in <see cref="clients"/>
+ /// Publish a certain message on a certain channel to all clients by using the stream set up in
+ /// <see cref="Controllers.EventStreamController"/>
/// </summary>
/// <param name="channel">The channel to publish messages on, this may be used for categorizing messages</param>
/// <param name="message">The message to be sent to every client</param>
@@ -34,7 +35,7 @@ public class Publisher : IPublisher<ConcurrentQueue<StreamWriter>> {
}
/// <summary>
- /// The access to the private <see cref="clients"/> attribute is made through this getter
+ /// Get a list of all connected clients
/// </summary>
public ConcurrentQueue<StreamWriter> Clients {
get { return clients; }
@@ -12,17 +12,17 @@
namespace webchat.Controllers
{
/// <summary>
- /// ChatController handles the main page of the appliaction
+ /// Handles the main page of the appliaction
/// </summary>
/// <remarks>In order to enter the chat the user must be authenticated
- /// <seealso cref="AuthenticationFilterAttribute"/></remarks>
+ /// <seealso cref="Filters.AuthenticationFilterAttribute"/></remarks>
[AuthenticationFilter]
public class ChatController : Controller
{
/// <summary>
/// Load the initial page where the user can send messages and join additional rooms
/// </summary>
- /// <returns>Returns a <see cref="ChatModel"/></returns>
+ /// <returns>Returns a <see cref="Models.ChatModel"/></returns>
public ActionResult Index() {
ChatModel model = new ChatModel();
@@ -16,9 +16,10 @@
namespace webchat.Controllers
{
/// <summary>
- /// Handle the Eventstream connections
+ /// Handle the EventStream connections
/// </summary>
- /// <remarks>The user cannot access this if he's not authenticated <seealso cref="AuthenticationFilterAttribute"/></remarks>
+ /// <remarks>The user cannot access this if he's not authenticated
+ /// <seealso cref="Filters.AuthenticationFilterAttribute"/></remarks>
public class EventStreamController : ApiController {
/// <summary>
/// Prepare the response headers for the EventStream
@@ -15,6 +15,7 @@ namespace webchat.Controllers
/// <summary>
/// The controller that handles the authentication page
/// </summary>
+ /// <remarks><seealso cref="Filters.AuthenticationFilterAttribute"/></remarks>
public class IndexController : Controller
{
/// <summary>
@@ -35,7 +36,7 @@ public class IndexController : Controller
/// <param name="indexModel">The model that has the user's data binded to</param>
/// <param name="captchaValid">Whether the captcha is valid or not</param>
/// <param name="captchaErrorMessage">If the user failed to provide a valid captcha this holds the reason</param>
- /// <returns>Returns an <see cref="IndexModel"/> populated with data
+ /// <returns>Returns an <see cref="Models.IndexModel"/> populated with data
/// if the user submitted invalid data or redirects the user to the chat if he logged in</returns>
/// <remarks>This also handles the CSRF token which prevents an attacker to submit the form remotely.
/// If the user doesn't provide some rooms to join, he's automatically connected to a default one</remarks>
@@ -16,16 +16,16 @@ namespace webchat.Controllers
/// Handle the incoming messages
/// </summary>
/// <remarks>In order to send messages the user must be authenticated
- /// <seealso cref="AuthenticationFilterAttribute"/></remarks>
+ /// <seealso cref="Filters.AuthenticationFilterAttribute"/></remarks>
[AuthenticationFilter]
public class MessageController : Controller
{
/// <summary>
/// Publish the message to every chat user on the corresponding channel
/// </summary>
/// <param name="m">The model which contains the intended message and channel
- /// <seealso cref="MessageModel"/></param>
- /// <returns>Returns a <seealso cref="HttpStatusCode"/> which represents
+ /// <seealso cref="Models.MessageModel"/></param>
+ /// <returns>Returns a HttpStatusCode which represents
/// whether the opperation was successful or not</returns>
[HttpPost]
[ValidateInput(false)]
@@ -17,14 +17,14 @@ namespace webchat.Controllers
/// Handles the PONG part of the PING PONG protocol
/// </summary>
/// <remarks>In order to be able to respond to pings the user must be authenticated
- /// <seealso cref="AuthenticationFilterAttribute"/></remarks>
+ /// <seealso cref="Filters.AuthenticationFilterAttribute"/></remarks>
[AuthenticationFilter]
public class PongController : Controller
{
/// <summary>
/// Restore the user's state in the application if he has an active connection to it
/// </summary>
- /// <returns>Returns a <seealso cref="HttpStatusCode"/> which represents
+ /// <returns>Returns a HttpStatusCode which represents
/// whether the opperation was successful or not</returns>
[HttpPost]
public HttpStatusCode Index()
@@ -16,17 +16,17 @@ namespace webchat.Controllers
/// Handle the joning and leaving of rooms (channels)
/// </summary>
/// <remarks>In order to be able to join or leave rooms the user must be authenticated
- /// <seealso cref="AuthenticationFilterAttribute"/></remarks>
+ /// <seealso cref="Filters.AuthenticationFilterAttribute"/></remarks>
[AuthenticationFilter]
public class RoomController : Controller
{
/// <summary>
/// Join a list of rooms
/// </summary>
- /// <param name="roomsModel">The List of rooms to be joined</param>
+ /// <param name="roomsModel">The list of rooms to be joined</param>
/// <returns>Returns the user's currently joined rooms as JSON</returns>
/// <remarks>This may also return a localized error string if the room names are invalid
- /// <seealso cref="RoomsValidationAttribute"/></remarks>
+ /// <seealso cref="Validators.RoomsValidationAttribute"/></remarks>
[HttpPost]
[ValidateInput(false)]
public string Join(RoomsModel roomsModel)
@@ -57,7 +57,7 @@ public string Join(RoomsModel roomsModel)
/// or returns "" if the user left the only room he was connected to</returns>
/// <remarks>This may also return a localized error string if the user tries
/// to leave a room he's not connected to
- /// <seealso cref="JoinedRoomValidationAttribute"/></remarks>
+ /// <seealso cref="Validators.JoinedRoomValidationAttribute"/></remarks>
[HttpPost]
[ValidateInput(false)]
public string Leave(LeaveModel leaveModel) {
@@ -10,7 +10,7 @@
namespace webchat.Database {
/// <summary>
- /// A concrete implementation for <see cref="IDatabase"/>
+ /// A concrete implementation of <see cref="IDatabase"/>
/// </summary>
public class Db : IDatabase {
/// <summary>
@@ -58,8 +58,8 @@ public class Db : IDatabase {
/// <summary>
/// The Database's constructor
/// </summary>
- /// <param name="p">A concrete implementation of an IPublisher</param>
- /// <param name="l">A concrete implementation of an <see cref="ILogger"/></param>
+ /// <param name="p">A concrete implementation of an <see cref="Communication.IPublisher<T>"/></param>
+ /// <param name="l">A concrete implementation of an <see cref="Logging.ILogger"/></param>
public Db(IPublisher<ConcurrentQueue<StreamWriter>> p, ILogger l) {
Pub = p;
Logger = l;
@@ -70,7 +70,6 @@ public class Db : IDatabase {
/// </summary>
/// <param name="rooms">Which rooms the user joined</param>
/// <param name="nick">The user's nickname</param>
- /// <remarks>This also adds the user to <see cref="Users"/></remarks>
public void AddUser(IEnumerable<string> rooms, string nick) {
lock(roomUserListLock) {
foreach(var room in rooms) {
@@ -147,7 +146,7 @@ public class Db : IDatabase {
/// Get the users currently connected
/// </summary>
/// <returns>Returns a Dictionary&lt;string, HashSet&lt;string&gt;&gt;
- /// of rooms as keys and user HashSet&lt;string&gt; as values</returns>
+ /// of rooms as keys and users as values for the HastSet&lt;string&gt;</returns>
public Dictionary<string, HashSet<string>> GetUsers() {
lock(roomUserListLock) return RoomUsersList.ToDictionary(k => k.Key, k => k.Value);
}
@@ -33,7 +33,7 @@ public interface IDatabase {
/// Get the users currently connected
/// </summary>
/// <returns>Returns a Dictionary&lt;string, HashSet&lt;string&gt;&gt;
- /// of rooms as keys and user HashSet&lt;string&gt; as values</returns>
+ /// of rooms as keys and users as values for the HastSet&lt;string&gt;</returns>
Dictionary<string, HashSet<string>> GetUsers();
/// <summary>
@@ -7,7 +7,7 @@
namespace webchat.Filters {
/// <summary>
- /// AuthorizationFilter used to check whether the user logged in or not
+ /// Checks whether the user is logged in or not
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public class AuthenticationFilterAttribute : AuthorizeAttribute, IAuthorizationFilter {
View
@@ -22,17 +22,17 @@ namespace webchat {
public class MvcApplication : System.Web.HttpApplication {
/// <summary>
- /// A singleton of a <see cref="Publisher"/> to use throughout the application
+ /// A singleton of a <see cref="Communication.IPublisher<T>"/> to use throughout the application
/// </summary>
public static IPublisher<ConcurrentQueue<StreamWriter>> Pub = new Publisher();
/// <summary>
- /// A singleton of an <see cref="ILogger"/> to use throughout the application
+ /// A singleton of an <see cref="Logging.ILogger"/> to use throughout the application
/// </summary>
public static ILogger Logger = new Logger();
/// <summary>
- /// A singleton of an <see cref="IDatabase"/> to use throughout the application
+ /// A singleton of an <see cref="Database.IDatabase"/> to use throughout the application
/// </summary>
public static IDatabase Db = new Db(Pub, Logger);
@@ -6,7 +6,7 @@
namespace webchat.Helpers {
/// <summary>
- /// Binding helpers used in the Models.Binders
+ /// Binding helpers used by Models.Binders
/// </summary>
public class BindingHelper {
/// <summary>
@@ -8,7 +8,7 @@
namespace webchat.Models.Binders {
/// <summary>
- /// Binder for user sent messages
+ /// Binder for <see cref="MessageModel"/>
/// </summary>
public class MessageModelBinder : DefaultModelBinder {
/// <summary>
@@ -7,7 +7,7 @@
namespace webchat.Models.Binders {
/// <summary>
- /// Binder for rooms
+ /// Binder for <see cref="RoomsModel"/>
/// </summary>
public class RoomsModelBinder : DefaultModelBinder {
/// <summary>
@@ -5,13 +5,14 @@
namespace webchat.Models {
/// <summary>
- /// Model for the ChatController
+ /// Model for the <see cref="Controllers.ChatController"/>
/// </summary>
public class ChatModel {
/// <summary>
/// A copy of the database used to display the connected users on every room
/// </summary>
public Dictionary<string, HashSet<string>> Users { get; set; }
+
/// <summary>
/// The rooms the user connected to
/// </summary>
@@ -8,7 +8,7 @@
namespace webchat.Models {
/// <summary>
- /// Model for the IndexController
+ /// Model for the <see cref="Controllers.IndexController"/>
/// </summary>
public class IndexModel : RoomsModel {
/// <summary>
@@ -7,7 +7,7 @@
namespace webchat.Models {
/// <summary>
- /// Model used by RoomController when the user leaves rooms
+ /// Model used by <see cref="Controllers.RoomController"/> when the user leaves rooms
/// </summary>
public class LeaveModel {
/// <summary>
@@ -9,7 +9,7 @@
namespace webchat.Models {
/// <summary>
- /// Model used by MessageController
+ /// Model used by <see cref="Controllers.MessageController"/>
/// </summary>
[ModelBinder(typeof(MessageModelBinder))]
public class MessageModel {
@@ -8,7 +8,8 @@
namespace webchat.Models {
/// <summary>
- /// Model used by IndexController and RoomController for joining rooms
+ /// Model used by <see cref="Controllers.IndexController"/> and
+ /// <see cref="Controllers.RoomController"/> for joining rooms
/// </summary>
[ModelBinder(typeof(RoomsModelBinder))]
public class RoomsModel {
View
@@ -17,7 +17,7 @@ public class Pinger {
private Timer timer;
/// <summary>
- /// Pinger's constructor
+ /// The constructor
/// </summary>
/// <param name="i">The time interval between two PINGs</param>
public Pinger(int i = 60000) {
@@ -28,7 +28,7 @@ public class Pinger {
/// <summary>
/// Send the PING by using the <see cref="MvcApplication.Pub"/> and
- /// logging the action using <see cref="MvcApplication.Logger"/>
+ /// log the action using <see cref="MvcApplication.Logger"/>
///
/// The backup is done by <see cref="MvcApplication.Db"/>
/// </summary>
@@ -24,7 +24,7 @@ public RoomsValidationAttribute()
/// </summary>
/// <param name="value">A List&lt;string&gt; of rooms to be checked</param>
/// <returns>Returns true if all rooms are valid, else false</returns>
- /// <remarks>A room name is considered valid if it matches the regex: ^[\w]+$</remarks>
+ /// <remarks>A room name is considered valid if it matches the regex: <c>^[\\w]+$</c></remarks>
public override bool IsValid(object value) {
List<string> rooms = (List<string>)value;

0 comments on commit a09e50a

Please sign in to comment.