68 lines
2.2 KiB
C#
68 lines
2.2 KiB
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="UserProfilFile.cs" company="BTU/IIT">
|
|
// Company copyright tag.
|
|
// </copyright>
|
|
// <author>stubbfel</author>
|
|
// <sience>23.07.2013</sience>
|
|
//----------------------------------------------------------------------
|
|
namespace CampusAppWP8.File.Setting
|
|
{
|
|
using System.IO;
|
|
using CampusAppWP8.Model;
|
|
using CampusAppWP8.Model.Setting;
|
|
using CampusAppWP8.Resources;
|
|
|
|
/// <summary>
|
|
/// Class for handle the user-profile-file
|
|
/// </summary>
|
|
public class UserProfilFile : XmlModel<UserProfilModel>
|
|
{
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="UserProfilFile" /> class.
|
|
/// </summary>
|
|
public UserProfilFile()
|
|
: base(ModelType.File, Constants.FileProfil_User)
|
|
{
|
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDateOnLoad);
|
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDateOnSave);
|
|
}
|
|
|
|
// Constructor
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
|
/// </summary>
|
|
/// <param name="model">model object</param>
|
|
/// <param name="info">file info object</param>
|
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
|
private bool CheckIsFileUpToDateOnLoad(UserProfilModel model, FileInfo info)
|
|
{
|
|
if (model == null)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
|
/// </summary>
|
|
/// <param name="model">model object</param>
|
|
/// <param name="info">file info object</param>
|
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
|
private bool CheckIsFileUpToDateOnSave(UserProfilModel model, FileInfo info)
|
|
{
|
|
if (model != null && !model.HasChanged())
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|