mv favoritfeed to favoritfile
This commit is contained in:
@@ -101,7 +101,7 @@
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Feed\Departments\DepartmentFavoriteFeed.cs" />
|
||||
<Compile Include="File\Departments\DepartmentFavoriteFile.cs" />
|
||||
<Compile Include="Const.cs" />
|
||||
<Compile Include="Feed\Exams\ExamFeed.cs" />
|
||||
<Compile Include="Feed\Mensa\MensaFeedSBFMain.cs" />
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="DepartmentFavoriteFeed.cs" company="BTU/IIT">
|
||||
// <copyright file="DepartmentFavoriteFile.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>01.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Feed.Departments
|
||||
namespace CampusAppWP8.File.Departments
|
||||
{
|
||||
using System.IO;
|
||||
using CampusAppWP8.Model;
|
||||
@@ -15,7 +15,7 @@ namespace CampusAppWP8.Feed.Departments
|
||||
/// <summary>
|
||||
/// Feed object to handle favorite department feeds.
|
||||
/// </summary>
|
||||
public class DepartmentFavoriteFeed : XmlModel<DepartmentModel>
|
||||
public class DepartmentFavoriteFile: XmlModel<DepartmentModel>
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace CampusAppWP8.Feed.Departments
|
||||
/// Initializes a new instance of the <see cref="DepartmentFavoriteFeed" /> class.
|
||||
/// </summary>
|
||||
/// <param name="autoLoad">automatic loading of the data</param>
|
||||
public DepartmentFavoriteFeed(bool autoLoad = true)
|
||||
public DepartmentFavoriteFile(bool autoLoad = true)
|
||||
: base(ModelType.File, Constants.FileDepartment_Favorite_Name, string.Empty)
|
||||
{
|
||||
this.IsFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDateOnLoad);
|
||||
@@ -11,6 +11,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.File.Departments;
|
||||
using CampusAppWP8.Model.Departments;
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Controls;
|
||||
@@ -57,18 +58,18 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
if (this.isNewInstance)
|
||||
{
|
||||
if ((DepartmentIndexPage.FavoriteFeed == null) || (DepartmentIndexPage.FavoriteFeed.GetModel() == null))
|
||||
if ((DepartmentIndexPage.FavoriteFile == null) || (DepartmentIndexPage.FavoriteFile.GetModel() == null))
|
||||
{
|
||||
DepartmentModel tempModel = null;
|
||||
|
||||
if ((tempModel = App.LoadFromIsolatedStorage<DepartmentModel>(Constants.IsolatedStorage_DepartmentFavoriteModel)) != null)
|
||||
{
|
||||
if (DepartmentIndexPage.FavoriteFeed == null)
|
||||
if (DepartmentIndexPage.FavoriteFile == null)
|
||||
{
|
||||
DepartmentIndexPage.FavoriteFeed = new Feed.Departments.DepartmentFavoriteFeed(false);
|
||||
DepartmentIndexPage.FavoriteFile = new DepartmentFavoriteFile(false);
|
||||
}
|
||||
|
||||
DepartmentIndexPage.FavoriteFeed.Model = tempModel;
|
||||
DepartmentIndexPage.FavoriteFile.Model = tempModel;
|
||||
this.isSourceSet = false;
|
||||
}
|
||||
}
|
||||
@@ -78,7 +79,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
if (this.isSourceSet == false)
|
||||
{
|
||||
this.ContentPanel.ItemsSource = DepartmentIndexPage.GetFavoriteFeed().GetModel().Faculties[0].Chairs;
|
||||
this.ContentPanel.ItemsSource = DepartmentIndexPage.GetFavoriteFile().GetModel().Faculties[0].Chairs;
|
||||
this.isSourceSet = true;
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
|
||||
{
|
||||
App.SaveToIsolatedStorage<DepartmentModel>(Constants.IsolatedStorage_DepartmentFavoriteModel, DepartmentIndexPage.FavoriteFeed.GetModel());
|
||||
App.SaveToIsolatedStorage<DepartmentModel>(Constants.IsolatedStorage_DepartmentFavoriteModel, DepartmentIndexPage.FavoriteFile.GetModel());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +143,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
Button btn = this.lastClickedBtn as Button;
|
||||
TextBlock btnText = btn.Content as TextBlock;
|
||||
|
||||
if (DepartmentIndexPage.GetFavoriteFeed().GetModel().Faculties[0].RemoveChair(btnText.Text) == true)
|
||||
if (DepartmentIndexPage.GetFavoriteFile().GetModel().Faculties[0].RemoveChair(btnText.Text) == true)
|
||||
{
|
||||
MessageBox.Show(AppResources.DeleteSucceeded);
|
||||
}
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
namespace CampusAppWP8.Pages.Departments
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Feed.Departments;
|
||||
using CampusAppWP8.File.Departments;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWP8.Utility.Lui.MessageBoxes;
|
||||
using Microsoft.Phone.Controls;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
/// <summary>
|
||||
/// Page with a list of the faculties.
|
||||
@@ -30,7 +30,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
/// <summary>
|
||||
/// Department feed object for storing the favorite list.
|
||||
/// </summary>
|
||||
private static DepartmentFavoriteFeed favorite = null;
|
||||
private static DepartmentFavoriteFile favorite = null;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DepartmentIndexPage" /> class.
|
||||
@@ -54,10 +54,10 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
if (DepartmentIndexPage.favorite == null)
|
||||
{
|
||||
DepartmentIndexPage.favorite = new DepartmentFavoriteFeed(false);
|
||||
DepartmentIndexPage.favorite = new DepartmentFavoriteFile(false);
|
||||
}
|
||||
|
||||
DepartmentIndexPage.favorite.OnFailedFile += new DepartmentFavoriteFeed.OnFailed(this.CheckFavoriteFeed);
|
||||
DepartmentIndexPage.favorite.OnFailedFile += new DepartmentFavoriteFile.OnFailed(this.CheckFavoriteFeed);
|
||||
DepartmentIndexPage.favorite.LoadData();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
/// <summary>
|
||||
/// Gets or sets the favorite feed object.
|
||||
/// </summary>
|
||||
public static DepartmentFavoriteFeed FavoriteFeed
|
||||
public static DepartmentFavoriteFile FavoriteFile
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -112,7 +112,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
/// Return the feed object of the favorite departments.
|
||||
/// </summary>
|
||||
/// <returns>feed object</returns>
|
||||
public static DepartmentFavoriteFeed GetFavoriteFeed()
|
||||
public static DepartmentFavoriteFile GetFavoriteFile()
|
||||
{
|
||||
return DepartmentIndexPage.favorite; // DepartmentIndexPage.favorite;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
DepartmentIndexPage.favorite.Model = new Model.Departments.DepartmentModel();
|
||||
}
|
||||
|
||||
if (DepartmentIndexPage.favorite.GetModel().Faculties.Count() == 0)
|
||||
if (DepartmentIndexPage.favorite.GetModel().Faculties.Count == 0)
|
||||
{
|
||||
DepartmentIndexPage.favorite.Model.Faculties.Add(new Model.Departments.FacultyModel("favorites"));
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace CampusAppWP8.Pages.Departments
|
||||
|
||||
if (tempModel != null)
|
||||
{
|
||||
DepartmentIndexPage.GetFavoriteFeed().GetModel().Faculties[0].AddChair(tempModel);
|
||||
DepartmentIndexPage.GetFavoriteFile().GetModel().Faculties[0].AddChair(tempModel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user