yavsc/Yavsc/Models/Messaging/BaseEvent.cs

63 lines
1.7 KiB
C#
Raw Normal View History

2016-05-17 18:22:18 +02:00
//
// BaseEvent.cs
2015-11-17 22:03:42 +01:00
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2016-05-17 18:22:18 +02:00
2015-11-17 22:03:42 +01:00
using System.ComponentModel.DataAnnotations;
2016-05-17 18:22:18 +02:00
namespace Yavsc.Models.Messaging
2015-11-17 22:03:42 +01:00
{
2016-11-30 16:45:44 +01:00
using Interfaces;
2015-11-17 22:03:42 +01:00
/// <summary>
2016-05-17 18:22:18 +02:00
/// Base event.
2015-11-17 22:03:42 +01:00
/// </summary>
2016-09-17 03:36:34 +02:00
public class BaseEvent : IEvent {
public BaseEvent()
{
Topic = GetType().Name;
}
public BaseEvent(string topic)
{
Topic = topic;
}
public string Topic { get; set; }
public string Sender { get; set; }
public string Message { get; set; }
}
public class GeneralEvent: BaseEvent, ITitle
2015-11-17 22:03:42 +01:00
{
/// <summary>
2016-05-17 18:22:18 +02:00
/// The title.
/// </summary>
[Required(ErrorMessageResourceName="ChooseATitle")]
[Display(Name="Title")]
public string Title { get; set; }
/// <summary>
/// The description.
2015-11-17 22:03:42 +01:00
/// </summary>
2016-05-17 18:22:18 +02:00
[Required(ErrorMessageResourceName="ChooseADescription")]
[Display(Name="Description")]
public string Description { get; set; }
2015-11-17 22:03:42 +01:00
}
2016-05-17 18:22:18 +02:00
}