-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bc1944
commit 8541f79
Showing
15 changed files
with
167 additions
and
25 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
SavageTools/SavageTools.Shared/Settings/Super Powers.savage-setting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<%@ Application Codebehind="Global.asax.cs" Inherits="SavageToolsWeb.MvcApplication" Language="C#" %> | ||
<%@ Application Codebehind="Global.asax.cs" Inherits="SavageTools.Web.MvcApplication" Language="C#" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using SavageTools.Settings; | ||
using System.Collections.Generic; | ||
using System.Web.Mvc; | ||
using System.Xml.Serialization; | ||
|
||
namespace SavageTools.Web.Models | ||
{ | ||
public class HomeIndexViewModel | ||
{ | ||
static readonly XmlSerializer SettingXmlSerializer = new XmlSerializer(typeof(Setting)); | ||
static List<Setting> s_Settings; | ||
|
||
public HomeIndexViewModel() | ||
{ | ||
if (s_Settings == null) | ||
{ | ||
var settings = new List<Setting>(); | ||
|
||
var root = new System.IO.DirectoryInfo(MvcApplication.AppDataPath); | ||
foreach (var file in root.GetFiles("*.savage-setting")) | ||
{ | ||
Setting book; | ||
// Open document | ||
using (var stream = file.OpenRead()) | ||
book = (Setting)SettingXmlSerializer.Deserialize(stream); | ||
|
||
settings.Add(book); | ||
} | ||
s_Settings = settings; | ||
} | ||
} | ||
|
||
public IEnumerable<SelectListItem> SettingList() | ||
{ | ||
//yield return new SelectListItem() { Text = "", Value = "" }; | ||
foreach (var setting in s_Settings) | ||
yield return new SelectListItem() { Text = setting.Name, Value = setting.Name }; | ||
|
||
} | ||
|
||
public IEnumerable<SelectListItem> RankList() | ||
{ | ||
//yield return new SelectListItem() { Text = "", Value = "" }; | ||
foreach (var setting in s_Settings) | ||
yield return new SelectListItem() { Text = setting.Name, Value = setting.Name }; | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters