aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-05-31 12:07:40 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-05-31 12:07:40 +0300
commitf03676747c3c4207da0be4e59273cbbca9b79649 (patch)
tree5fe054dea1c4135416ecdfc252ae2f867633bec6 /Software/Visual_Studio/Tango.Core
parent040118073dc67e9daf9792863786f87705f3fff6 (diff)
downloadTango-f03676747c3c4207da0be4e59273cbbca9b79649.tar.gz
Tango-f03676747c3c4207da0be4e59273cbbca9b79649.zip
Implemented PPC data base source from %appdata% on PPC.
Diffstat (limited to 'Software/Visual_Studio/Tango.Core')
-rw-r--r--Software/Visual_Studio/Tango.Core/CoreSettings.cs23
-rw-r--r--Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs47
2 files changed, 23 insertions, 47 deletions
diff --git a/Software/Visual_Studio/Tango.Core/CoreSettings.cs b/Software/Visual_Studio/Tango.Core/CoreSettings.cs
index f02e84615..2f40d0ef0 100644
--- a/Software/Visual_Studio/Tango.Core/CoreSettings.cs
+++ b/Software/Visual_Studio/Tango.Core/CoreSettings.cs
@@ -10,22 +10,29 @@ namespace Tango.Core
public class CoreSettings : SettingsBase
{
/// <summary>
+ /// Gets or sets the default data base source.
+ /// </summary>
+ public static String DefaultDataBaseSource { get; set; }
+
+ /// <summary>
/// Gets or sets the SQL server address.
/// </summary>
- public String SQLServerAddress { get; set; }
+ public String DataBaseSource { get; set; }
+
+ /// <summary>
+ /// Initializes the <see cref="DataBaseSettings"/> class.
+ /// </summary>
+ static CoreSettings()
+ {
+ DefaultDataBaseSource = "localhost\\SQLEXPRESS";
+ }
/// <summary>
/// Initializes a new instance of the <see cref="CoreSettings"/> class.
/// </summary>
public CoreSettings()
{
-
-#if DEBUG
- SQLServerAddress = "localhost\\SQLEXPRESS";
-#else
- SQLServerAddress = "twine01\\SQLTWINE";
-#endif
-
+ DataBaseSource = DefaultDataBaseSource;
}
}
}
diff --git a/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs
index cd1f4b30b..ab0a189ed 100644
--- a/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs
+++ b/Software/Visual_Studio/Tango.Core/Helpers/PathHelper.cs
@@ -12,27 +12,14 @@ namespace Tango.Core.Helpers
/// </summary>
public static class PathHelper
{
- ///// <summary>
- ///// Creates a temporary folder in %temp%\Twine\{Random} and returns the path to that folder.
- ///// </summary>
- ///// <returns></returns>
- //public static String GetTempFolderPath()
- //{
- // String tempDirectory = Path.Combine(Path.GetTempPath(), "Twine", Path.GetRandomFileName());
- // Directory.CreateDirectory(tempDirectory);
- // return tempDirectory;
- //}
-
- ///// <summary>
- ///// Creates a temporary folder and file in %temp%\Twine\{RandomFile} and returns the path to that file.
- ///// </summary>
- ///// <returns></returns>
- //public static String GetTempFilePath()
- //{
- // String tempDirectory = Path.Combine(Path.GetTempPath(), "Twine");
- // Directory.CreateDirectory(tempDirectory);
- // return Path.Combine(tempDirectory, Path.GetRandomFileName());
- //}
+ /// <summary>
+ /// Gets the user tango folder (%appdata%\Twine\Tango).
+ /// </summary>
+ /// <returns></returns>
+ public static String GetUserTangoFolder()
+ {
+ return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango");
+ }
/// <summary>
/// Gets the application startup path.
@@ -43,24 +30,6 @@ namespace Tango.Core.Helpers
return AppDomain.CurrentDomain.BaseDirectory;
}
- ///// <summary>
- ///// Tries to delete the specified folder.
- ///// </summary>
- ///// <param name="path">The folder path.</param>
- ///// <returns></returns>
- //public static bool TryDeleteFolder(String path)
- //{
- // try
- // {
- // Directory.Delete(path, true);
- // return true;
- // }
- // catch
- // {
- // return false;
- // }
- //}
-
/// <summary>
/// Tries to delete the specified file.
/// </summary>