OSDN Git Service

投稿できるようになった!
[futonwriter/old_trunk.git] / HatenaDiaryClient / Models / Hatena / HatenaFotolife.cs
index bdb6cf9..79b7b9d 100644 (file)
@@ -9,14 +9,8 @@ namespace Azyobuzi.HatenaDiaryClient.Models.Hatena
 {
     public class HatenaFotolife
     {
-        private string userName;
-        private string password;
-
-        public HatenaFotolife(string userName, string password)
-        {
-            this.userName = userName;
-            this.password = password;
-        }
+        public string UserName { set; get; }
+        public string Password { set; get; }
 
         public FotolifeEntry Upload(string title, string fileName, string folder = null)
         {
@@ -81,8 +75,8 @@ namespace Azyobuzi.HatenaDiaryClient.Models.Hatena
                 "http://f.hatena.ne.jp/atom/post",
                 new XDocument(entry),
                 Encoding.GetEncoding("shift_jis"),
-                this.userName,
-                this.password);
+                this.UserName,
+                this.Password);
             return new FotolifeEntry(reXml.Root);
         }
 
@@ -92,8 +86,8 @@ namespace Azyobuzi.HatenaDiaryClient.Models.Hatena
                 WsseAtomConnection.Get(
                     "http://f.hatena.ne.jp/atom/edit/" + id,
                     Encoding.UTF8,
-                    this.userName,
-                    this.password
+                    this.UserName,
+                    this.Password
                 )
                 .Root
             );
@@ -113,16 +107,16 @@ namespace Azyobuzi.HatenaDiaryClient.Models.Hatena
                     .ToString()
                 ),
                 null,
-                this.userName,
-                this.password);
+                this.UserName,
+                this.Password);
         }
 
         public void DeleteEntry(string id)
         {
             WsseAtomConnection.Delete(
                 "http://f.hatena.ne.jp/atom/edit/" + id,
-                this.userName,
-                this.password);
+                this.UserName,
+                this.Password);
         }
 
         public IEnumerable<FotolifeEntry> GetEntrys(int page = 1)
@@ -130,8 +124,8 @@ namespace Azyobuzi.HatenaDiaryClient.Models.Hatena
             return WsseAtomConnection.Get(
                 "http://f.hatena.ne.jp/atom/feed?page=" + page.ToString(),
                 Encoding.UTF8,
-                this.userName,
-                this.password
+                this.UserName,
+                this.Password
             )
             .Root
             .Elements(XmlNamespaces.Atom02Spec + "entry")