Commit f7d5426

mokhan <mokhan@ce5e1baf-6525-42e4-a1b2-857ea38da20a>
2009-04-28 20:27:19
git-svn-id: https://svn.xp-dev.com/svn/mokhan-mo.money@195 ce5e1baf-6525-42e4-a1b2-857ea38da20a
1 parent e8654c4
Changed files (2)
trunk
product
MoMoney.Service
trunk/product/MoMoney.Service/Infrastructure/Logging/LogFileTasks2.cs
@@ -0,0 +1,32 @@
+using System.IO;
+using Gorilla.Commons.Infrastructure.Reflection;
+
+namespace MoMoney.Service.Infrastructure.Logging
+{
+    public interface ILogFileTasks
+    {
+        string get_the_contents_of_the_log_file();
+        string get_the_path_to_the_log_file();
+    }
+
+    public class LogFileTasks2 : ILogFileTasks
+    {
+        public string get_the_contents_of_the_log_file()
+        {
+            using (
+                var file_stream = new FileStream(get_the_path_to_the_log_file(), FileMode.Open, FileAccess.Read,
+                                                 FileShare.ReadWrite))
+            {
+                using (var reader = new StreamReader(file_stream))
+                {
+                    return reader.ReadToEnd();
+                }
+            }
+        }
+
+        public string get_the_path_to_the_log_file()
+        {
+            return Path.Combine(this.startup_directory(), @"logs\log.txt");
+        }
+    }
+}
\ No newline at end of file
trunk/product/MoMoney.Service/MoMoney.Service.csproj
@@ -81,7 +81,7 @@
     <Compile Include="Application\NotificationMessage.cs" />
     <Compile Include="Application\RegisterNewCompanyCommand.cs" />
     <Compile Include="Application\SaveNewBillCommand.cs" />
-    <Compile Include="Infrastructure\Logging\LogFileTasks.cs" />
+    <Compile Include="Infrastructure\Logging\LogFileTasks2.cs" />
     <Compile Include="Infrastructure\ProjectTasks.cs" />
     <Compile Include="Infrastructure\Updating\CancelUpdate.cs" />
     <Compile Include="Infrastructure\Updating\CancelUpdateSpecs.cs" />