ExamFeed.cs CampusAppWP8::Feed::Exams::ExamFeed CampusAppWP8::Feed::Exams //----------------------------------------------------------------------- //<copyrightfile="ExamFeed.cs"company="BTU/IIT"> //Companycopyrighttag. //</copyright> //<author>stubbfel</author> //<sience>02.09.2013</sience> //---------------------------------------------------------------------- namespaceCampusAppWP8.Feed.Exams { usingSystem.IO; usingCampusAppWP8.Model; usingCampusAppWP8.Model.Exams; usingCampusAppWP8.Resources; usingCampusAppWP8.Utility; publicclassExamFeed:XmlModel<ExamListModel> { #regionConstructor publicExamFeed() :base(ModelType.FileAndFeed,Constants.FileExamApp_ExamFeed,Constants.UrlExamApp_ExamFeed) { this.IsFileUpToDateOnLoad+=newIsFileUpToDate(this.CheckIsFileUpToDate); this.IsModelUpToDateOnLoad+=newIsModelUpToDate(this.CheckIsModelUpToDate); this.IsFileUpToDateOnSave+=newIsFileUpToDate(this.CheckIsFileUpToDate); this.ValidRootName=Constants.ExamXmlValidRootName; } #endregion #regionMethod privateboolCheckIsModelUpToDate(ExamListModelmodel) { if(model==null) { returnfalse; } returntrue; } privateboolCheckIsFileUpToDate(ExamListModelmodel,FileInfofileInfo) { if(fileInfo==null||!fileInfo.Exists||fileInfo.Length<1) { returnfalse; } if(model!=null) { returnUtilities.DayDifference(Utilities.DifferenceType.Less,fileInfo.LastWriteTime,30.0); } returntrue; } #endregion } }