Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Add settings cs.pp file back in for legacy reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Jun 20, 2017
1 parent 4a28323 commit ced32df
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 64 deletions.
60 changes: 30 additions & 30 deletions files/Settings.cs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@

namespace $rootnamespace$.Helpers
{
/// <summary>
/// This is the Settings static class that can be used in your Core solution or in any
/// of your client applications. All settings are laid out the same exact way with getters
/// and setters.
/// </summary>
public static class Settings
{
private static ISettings AppSettings
{
get
{
return CrossSettings.Current;
}
}
/// <summary>
/// This is the Settings static class that can be used in your Core solution or in any
/// of your client applications. All settings are laid out the same exact way with getters
/// and setters.
/// </summary>
public static class Settings
{
private static ISettings AppSettings
{
get
{
return CrossSettings.Current;
}
}

#region Setting Constants
#region Setting Constants

private const string SettingsKey = "settings_key";
private static readonly string SettingsDefault = string.Empty;
private const string SettingsKey = "settings_key";
private static readonly string SettingsDefault = string.Empty;

#endregion
#endregion


public static string GeneralSettings
{
get
{
return AppSettings.GetValueOrDefault<string>(SettingsKey, SettingsDefault);
}
set
{
AppSettings.AddOrUpdateValue<string>(SettingsKey, value);
}
}
public static string GeneralSettings
{
get
{
return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault);
}
set
{
AppSettings.AddOrUpdateValue(SettingsKey, value);
}
}

}
}
}
60 changes: 30 additions & 30 deletions files/SettingsPlatform.cs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@
namespace $rootnamespace$.Helpers
{
/// <summary>
/// This is the Settings static class that can be used in your Core solution or in any
/// of your client applications. All settings are laid out the same exact way with getters
/// and setters.
/// </summary>
public static class Settings
{
private static ISettings AppSettings
{
get
{
return CrossSettings.Current;
}
}
/// <summary>
/// This is the Settings static class that can be used in your Core solution or in any
/// of your client applications. All settings are laid out the same exact way with getters
/// and setters.
/// </summary>
public static class Settings
{
private static ISettings AppSettings
{
get
{
return CrossSettings.Current;
}
}
#region Setting Constants
#region Setting Constants
private const string SettingsKey = "settings_key";
private static readonly string SettingsDefault = string.Empty;
private const string SettingsKey = "settings_key";
private static readonly string SettingsDefault = string.Empty;
#endregion
#endregion
public static string GeneralSettings
{
get
{
return AppSettings.GetValueOrDefault<string>(SettingsKey, SettingsDefault);
}
set
{
AppSettings.AddOrUpdateValue<string>(SettingsKey, value);
}
}
public static string GeneralSettings
{
get
{
return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault);
}
set
{
AppSettings.AddOrUpdateValue(SettingsKey, value);
}
}
}
}
}*/
3 changes: 2 additions & 1 deletion nuget/Plugin.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@

<!--NetStandard/PCL-->
<file src="src\Plugin.Settings\bin\Release\netstandard1.0\Plugin.Settings.*" target="lib\netstandard1.0" />

<file src="files\Settings.cs.pp" target="content\netstandard1.0\Helpers\Settings.cs.pp" />

<!--Xamarin.Android-->
<file src="src\Plugin.Settings.Android\bin\Release\Plugin.Settings.*" target="lib\MonoAndroid10" />

Expand Down
6 changes: 3 additions & 3 deletions src/Plugin.Settings.Abstractions/ISettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public interface ISettings
/// <param name="fileName">Name of file for settings to be stored and retrieved </param>
/// <returns>Value or default</returns>
Double GetValueOrDefault(string key, Double defaultValue, string fileName = null);


/// <summary>
/// Adds or updates the value
Expand Down Expand Up @@ -155,7 +155,7 @@ public interface ISettings
/// <param name="fileName">Name of file for settings to be stored and retrieved </param>
/// <returns>True of was added or updated and you need to save it.</returns>
bool AddOrUpdateValue(string key, Double value, string fileName = null);


/// <summary>
/// Removes a desired key from the settings
Expand All @@ -178,4 +178,4 @@ public interface ISettings
/// <returns>True if contains key, else false</returns>
bool Contains(string key, string fileName = null);
}
}
}

0 comments on commit ced32df

Please sign in to comment.