Nettoyages et refactorisations.

* ITitle.cs:
* RssFeeds.cs:
* Blog.cs:
* BasePost.cs:
* YaEvent.cs:
* Estimate.cs:
* BaseEvent.cs:
* Activity.cs:
* UTBlogEntryCollection.cs:
* UUTBlogEntryCollection.cs: refactorisation: Les titres obtiennent
  une interface logicielle dédiée.

* ErrorHtmlFormatter.cs: Pour note: conception à revoir

* PerformerProfile.cs: refactorisation: Les identifiant deviennent
  génériques

* IRating.cs:
* IComment.cs:
* IIdentified.cs: refactorisation: Les identifiant et commentaires
  deviennent génériques

* ITagBackup.cs: refactorisation: un meilleur nom pour cette interface
  qui n'a pas encore d'implementeur.

* UserNameBase.cs: xml doc

* UserSkill.cs:
* UserSkillComment.cs: Les commentaire deviennent génériques

* OtherWebException.cs: classe obsolete

* ViewRenderer.cs: classe obsolète

* YavscModel.csproj: nettoyages de classes obsoletes, ajout des
  nouvelles interfaces et de la classe de base implementant l'
  "activité".
This commit is contained in:
2015-11-23 12:48:59 +01:00
parent 66993346cb
commit d430d73915
24 changed files with 195 additions and 233 deletions

View File

@ -1,3 +1,7 @@
2015-11-23 Paul Schneider <paul@pschneider.fr>
* ErrorHtmlFormatter.cs: Pour note: conception à revoir
2015-11-23 Paul Schneider <paul@pschneider.fr>
* FrontOfficeController.cs: Démarre l'implementation des

View File

@ -59,6 +59,7 @@ namespace Yavsc.Formatters
public ErrorHtmlFormatter
(HttpStatusCode errorCode, string title):base("text/html")
{
// FIXME this is not a place for this property
ErrorCode = errorCode;
Title = title;

View File

@ -33,7 +33,7 @@ namespace Yavsc.Model.Blogs
/// <summary>
/// Base post.
/// </summary>
public class BasePost: IRating {
public class BasePost: IRating, ITitle {
/// <summary>
/// The identifier.
/// </summary>

View File

@ -8,7 +8,7 @@ namespace Yavsc.Model.Blogs
/// <summary>
/// Blog.
/// </summary>
public class Blog
public class Blog: ITitle
{
string title;

View File

@ -26,7 +26,7 @@ namespace Yavsc.Model.Blogs
/// <summary>
/// Unique User and Title blog entry collection.
/// </summary>
public class UTBlogEntryCollection : BlogEntryCollection {
public class UTBlogEntryCollection : BlogEntryCollection, ITitle {
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Blogs.UTBlogEntryCollection"/> class.
@ -41,7 +41,8 @@ namespace Yavsc.Model.Blogs
/// Gets the title.
/// </summary>
/// <value>The title.</value>
public string Title { get { return _title; } }
public string Title { get { return _title; }
set { _title = value; } }
/// <summary>
/// Returns a <see cref="System.String"/> that represents the current <see cref="Yavsc.Model.Blogs.UUTBlogEntryCollection"/>.

View File

@ -26,7 +26,7 @@ namespace Yavsc.Model.Blogs
/// <summary>
/// Unique User and Title blog entry collection.
/// </summary>
public class UUTBlogEntryCollection : UUBlogEntryCollection {
public class UUTBlogEntryCollection : UUBlogEntryCollection, ITitle {
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Blogs.UUTBlogEntryCollection"/> class.
/// </summary>
@ -41,7 +41,8 @@ namespace Yavsc.Model.Blogs
/// Gets the title.
/// </summary>
/// <value>The title.</value>
public string Title { get { return _title; } }
public string Title { get { return _title; }
set { _title = value; } }
/// <summary>
/// Returns a <see cref="System.String"/> that represents the current <see cref="Yavsc.Model.Blogs.UUTBlogEntryCollection"/>.

View File

@ -0,0 +1,70 @@
//
// BaseEvent.cs
//
// 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/>.
using System;
using System.Web.Http;
using System.ComponentModel.DataAnnotations;
using Yavsc.Model;
namespace Yavsc.Model.Calendar
{
/// <summary>
/// Base event.
/// </summary>
public class BaseEvent: ITitle
{
/// <summary>
/// The title.
/// </summary>
[Required(ErrorMessage="Please, choose a .")]
[Display(ResourceType=typeof(LocalizedText),Name="Title")]
public string Title { get; set; }
/// <summary>
/// The description.
/// </summary>
[Required(ErrorMessage="Please, choose a Description.")]
[Display(ResourceType=typeof(LocalizedText),Name="Description")]
public string Description { get; set; }
/// <summary>
/// The location.
/// </summary>
[Required(ErrorMessage="Please, choose a Location.")]
[Display(ResourceType=typeof(LocalizedText),Name="Location")]
public Position Location { get; set; }
/// <summary>
/// The start date.
/// </summary>
[Required(ErrorMessage="Please, choose a Start Date.")]
[Display(ResourceType=typeof(LocalizedText),Name="StartDate")]
public DateTime StartDate { get; set; }
/// <summary>
/// Gets or sets the end date.
/// </summary>
/// <value>The end date.</value>
[Required(ErrorMessage="Please, choose an End Date.")]
[Display(ResourceType=typeof(LocalizedText),Name="EndDate")]
public DateTime EndDate { get; set; }
}
}

View File

@ -26,46 +26,6 @@ using Yavsc.Model;
namespace Yavsc.Model.Calendar
{
/// <summary>
/// Base event.
/// </summary>
public class BaseEvent
{
/// <summary>
/// The title.
/// </summary>
[Required(ErrorMessage="Please, choose a .")]
[Display(ResourceType=typeof(LocalizedText),Name="Title")]
public string Title { get; set; }
/// <summary>
/// The description.
/// </summary>
[Required(ErrorMessage="Please, choose a Description.")]
[Display(ResourceType=typeof(LocalizedText),Name="Description")]
public string Description { get; set; }
/// <summary>
/// The location.
/// </summary>
[Required(ErrorMessage="Please, choose a Location.")]
[Display(ResourceType=typeof(LocalizedText),Name="Location")]
public Position Location { get; set; }
/// <summary>
/// The start date.
/// </summary>
[Required(ErrorMessage="Please, choose a Start Date.")]
[Display(ResourceType=typeof(LocalizedText),Name="StartDate")]
public DateTime StartDate { get; set; }
/// <summary>
/// Gets or sets the end date.
/// </summary>
/// <value>The end date.</value>
[Required(ErrorMessage="Please, choose an End Date.")]
[Display(ResourceType=typeof(LocalizedText),Name="EndDate")]
public DateTime EndDate { get; set; }
}
/// <summary>
/// NF event.
/// </summary>

View File

@ -1,3 +1,41 @@
2015-11-23 Paul Schneider <paul@pschneider.fr>
* ITitle.cs:
* RssFeeds.cs:
* Blog.cs:
* BasePost.cs:
* YaEvent.cs:
* Estimate.cs:
* BaseEvent.cs:
* Activity.cs:
* UTBlogEntryCollection.cs:
* UUTBlogEntryCollection.cs: refactorisation: Les titres
obtiennent une interface logicielle dédiée.
* PerformerProfile.cs: refactorisation: Les identifiant
deviennent génériques
* IRating.cs:
* IComment.cs:
* IIdentified.cs: refactorisation: Les identifiant et
commentaires deviennent génériques
* ITagBackup.cs: refactorisation: un meilleur nom pour cette
interface qui n'a pas encore d'implementeur.
* UserNameBase.cs: xml doc
* UserSkill.cs:
* UserSkillComment.cs: Les commentaire deviennent génériques
* OtherWebException.cs: classe obsolete
* ViewRenderer.cs: classe obsolète
* YavscModel.csproj: nettoyages de classes obsoletes, ajout
des nouvelles interfaces et de la classe de base implementant
l' "activité".
2015-11-23 Paul Schneider <paul@pschneider.fr>
* SimpleBookingQuery.cs: Implémente une simple commande de

View File

@ -0,0 +1,49 @@
//
// Activity.cs
//
// 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/>.
using System;
namespace Yavsc.Model.FrontOffice
{
public class Activity: IComment<string>, ITitle
{
#region ITitle implementation
public string Title {
get;
set;
}
#endregion
#region IComment implementation
public string Comment {
get;
set;
}
#endregion
#region IIdentified implementation
public string Id {
get;
set;
}
#endregion
}
}

View File

@ -34,7 +34,7 @@ namespace Yavsc.Model.FrontOffice
/// <summary>
/// Performer profile.
/// </summary>
public class PerformerProfile: UserNameBase, IRating, IIdentified
public class PerformerProfile: UserNameBase, IRating, IIdentified<long>
{
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Skill.PerformerProfile"/> class.

View File

@ -24,7 +24,7 @@ using System;
namespace Yavsc.Model
{
public interface IComment: IIdentified {
public interface IComment<T>: IIdentified<T> {
string Comment { get; set; }
}
}

View File

@ -22,9 +22,9 @@ using System;
namespace Yavsc.Model
{
public interface IIdentified
public interface IIdentified<T>
{
long Id { get; set; }
T Id { get; set; }
}
}

View File

@ -26,7 +26,7 @@ namespace Yavsc.Model
/// <summary>
/// I rating.
/// </summary>
public interface IRating: IIdentified
public interface IRating: IIdentified<long>
{
/// <summary>
/// Gets or sets the rate.

View File

@ -30,7 +30,7 @@ namespace Yavsc.Model
/// <summary>
/// I tag handler.
/// </summary>
public interface ITagHandler {
public interface ITagBackup {
/// <summary>
/// Backup this instance.
/// Should set ViewData["Tags"] with
@ -43,11 +43,6 @@ namespace Yavsc.Model
/// </summary>
void Restore();
/// <summary>
/// Invoke this instance.
/// </summary>
void Invoke();
/// <summary>
/// Gets or sets the name.
/// </summary>

View File

@ -1,10 +1,10 @@
//
// IViewRenderer.cs
//
// ITitle.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 Paul Schneider
// 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
@ -18,24 +18,13 @@
//
// 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/>.
using System;
using System.Configuration;
using System.Collections.Specialized;
using System.Data;
using System.Web.Mvc;
namespace Yavsc.Model
{
/// <summary>
/// I view renderer.
/// </summary>
public interface IViewRenderer : IRenderer {
/// <summary>
/// Gets the template route part.
/// </summary>
/// <value>The template.</value>
string Template { get; }
public interface ITitle
{
string Title { get; set; }
}
}

View File

@ -1,79 +0,0 @@
//
// JsonReaderError.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// 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/>.
using System;
using System.Net;
using System.IO;
using Newtonsoft.Json;
namespace Yavsc.Model
{
/// <summary>
/// Google error exception.
/// </summary>
public class OtherWebException : WebException
{
/// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>The title.</value>
public string Title { get; set; }
/// <summary>
/// Gets or sets the content.
/// </summary>
/// <value>The content.</value>
public string Content { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Google.GoogleErrorException"/> class.
/// </summary>
/// <param name="ex">Ex.</param>
public OtherWebException (WebException ex) {
// ASSERT ex != null;
Title = ex.Message;
using (var stream = ex.Response.GetResponseStream())
using (var reader = new StreamReader(stream))
{
Content = reader.ReadToEnd();
}
}
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Google.GoogleErrorException"/> class.
/// </summary>
/// <param name="ex">Ex.</param>
/// <param name="message">Message.</param>
[Obsolete]
public OtherWebException(Exception ex, string message) {
Content = message;
Title = ex.Message;
}
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Google.GoogleErrorException"/> class.
/// </summary>
/// <param name="ex">Ex.</param>
[Obsolete]
public OtherWebException(Exception ex) {
Content = ex.Message;
Title = ex.GetType().FullName;
}
}
}

View File

@ -25,6 +25,9 @@ using System.ComponentModel.DataAnnotations;
namespace Yavsc.Model.RolesAndMembers
{
/// <summary>
/// User name base.
/// </summary>
public class UserNameBase {
/// <summary>
/// Gets or sets the name of the user.

View File

@ -25,7 +25,7 @@ namespace Yavsc.Model
/// <summary>
/// Rss feeds entry.
/// </summary>
public class RssFeedsEntry {
public class RssFeedsEntry: ITitle {
/// <summary>
/// Gets or sets the title.
/// </summary>

View File

@ -26,7 +26,7 @@ namespace Yavsc.Model.Skill
/// <summary>
/// User skill.
/// </summary>
public class UserSkill : IComment, IRating
public class UserSkill : IComment<long>, IRating
{
/// <summary>
/// Gets or sets the identifier for this

View File

@ -27,7 +27,7 @@ namespace Yavsc.Model.Skill
/// <summary>
/// User skill comment.
/// </summary>
public class UserSkillComment: UserSkillReference, IComment
public class UserSkillComment: UserSkillReference, IComment<long>
{
/// <summary>

View File

@ -1,70 +0,0 @@
//
// ViewRenderer.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// 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/>.
using System;
using System.Configuration;
using System.Collections.Specialized;
using System.Data;
using System.Web.Mvc;
namespace Yavsc.Model
{
/// <summary>
/// View renderer.
/// </summary>
public abstract class ViewRenderer<T> : IViewRenderer {
#region IRenderer implementation
/// <summary>
/// Get the specified c.
/// </summary>
/// <param name="c">C.</param>
public object Get (Controller c)
{
return Name;
}
/// <summary>
/// Gets the template route part.
/// </summary>
/// <value>The template.</value>
public string Template {
get {
return "Tag.aspx";
}
}
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name {
get {
throw new NotImplementedException ();
}
set {
throw new NotImplementedException ();
}
}
#endregion
}
}

View File

@ -8,7 +8,7 @@ namespace Yavsc.Model.WorkFlow
/// Estimate.
/// </summary>
[Serializable]
public class Estimate
public class Estimate : ITitle
{
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.WorkFlow.Estimate"/> class.

View File

@ -80,9 +80,6 @@
<Compile Include="Google\CalendarList.cs" />
<Compile Include="Google\CalendarListEntry.cs" />
<Compile Include="IRenderer.cs" />
<Compile Include="ITagHandler.cs" />
<Compile Include="IViewRenderer.cs" />
<Compile Include="ViewRenderer.cs" />
<Compile Include="RssFeeds.cs" />
<Compile Include="FrontOffice\Commande.cs" />
<Compile Include="FrontOffice\Catalog\Brand.cs" />
@ -123,7 +120,6 @@
<Compile Include="FrontOffice\CommandStatus.cs" />
<Compile Include="FrontOffice\CommandSet.cs" />
<Compile Include="FrontOffice\Catalog\Billing\Price.cs" />
<Compile Include="OtherWebException.cs" />
<Compile Include="WorkFlow\Automate.cs" />
<Compile Include="Google\CalendarEventList.cs" />
<Compile Include="Google\GDate.cs" />
@ -201,6 +197,10 @@
<Compile Include="FrontOffice\PerformerProfile.cs" />
<Compile Include="FrontOffice\SimpleBookingQuery.cs" />
<Compile Include="Skill\SkillEntity.cs" />
<Compile Include="FrontOffice\Activity.cs" />
<Compile Include="ITagBackup.cs" />
<Compile Include="ITitle.cs" />
<Compile Include="Calendar\BaseEvent.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>