Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Laval <jeremie.laval@gmail.com>2012-03-22 17:31:36 +0400
committerJeremie Laval <jeremie.laval@gmail.com>2012-03-22 17:31:36 +0400
commit2870299867eca63b1091c0a18da50cf43f7729c9 (patch)
tree0c348e4f187dffeb83e62303dff9a577deb4943a /AppleDocWizard
parent6dddc88992c7dd95b2152b74e4819a15573cc8f0 (diff)
[macdoc] Externalize base configuration folder path in AppleDocHandler.
The value returned by Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData) differs per user (root or not). We thus hardcode the parameter to the root-user value in macdoc when we check for doc freshness.
Diffstat (limited to 'AppleDocWizard')
-rw-r--r--AppleDocWizard/AppleDocHandler.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/AppleDocWizard/AppleDocHandler.cs b/AppleDocWizard/AppleDocHandler.cs
index e36c8bb..55678c1 100644
--- a/AppleDocWizard/AppleDocHandler.cs
+++ b/AppleDocWizard/AppleDocHandler.cs
@@ -48,9 +48,15 @@ namespace macdoc
readonly XNamespace docsetNamespace = "http://developer.apple.com/rss/docset_extensions";
readonly XNamespace atomNamespace = "http://www.w3.org/2005/Atom";
+ readonly string baseApplicationPath;
XDocument appleFeed;
+ public AppleDocHandler (string baseApplicationPath)
+ {
+ this.baseApplicationPath = baseApplicationPath;
+ }
+
// We load the atom field that contains a timeline of the modifications down to documentation by Apple
XDocument LoadAppleFeed (string feedUrl)
{
@@ -126,7 +132,7 @@ namespace macdoc
public bool CheckMergedDocumentationFreshness (AppleDocInformation infos)
{
- var statusFile = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "macdoc");
+ var statusFile = Path.Combine (baseApplicationPath, "macdoc");
if (!Directory.Exists (statusFile)) {
Directory.CreateDirectory (statusFile);
return true;
@@ -205,7 +211,7 @@ namespace macdoc
merger.MergeDocumentation ();
mdocArchive.Dispose ();
- var statusFile = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "macdoc", "merge.status");
+ var statusFile = Path.Combine (baseApplicationPath, "macdoc", "merge.status");
File.WriteAllText (statusFile, infos.Version.ToString ());
FireAppleDocEvent (new AppleDocEventArgs () { Stage = ProcessStage.Finished });
}