2
0
Эх сурвалжийг харах

2009-04-06 Atsushi Enomoto <[email protected]>

	* Workspace.cs, ResourceCollectionInfo.cs,
	  CategoriesDocument.cs, ServiceDocument.cs : use common internal
	  SyndicationExtension class for extensions.


svn path=/trunk/mcs/; revision=131111
Atsushi Eno 16 жил өмнө
parent
commit
b3852bc8a5

+ 12 - 12
mcs/class/System.ServiceModel.Web/System.ServiceModel.Syndication/CategoriesDocument.cs

@@ -37,22 +37,19 @@ namespace System.ServiceModel.Syndication
 {
 	public abstract class CategoriesDocument
 	{
-		[MonoTODO]
 		public static InlineCategoriesDocument Create (Collection<SyndicationCategory> categories)
 		{
-			throw new NotImplementedException ();
+			return new InlineCategoriesDocument (categories);
 		}
 
-		[MonoTODO]
 		public static ReferencedCategoriesDocument Create (Uri linkToCategoriesDocument)
 		{
-			throw new NotImplementedException ();
+			return new ReferencedCategoriesDocument (linkToCategoriesDocument);
 		}
 
-		[MonoTODO]
 		public static InlineCategoriesDocument Create (Collection<SyndicationCategory> categories, bool isFixed, string scheme)
 		{
-			throw new NotImplementedException ();
+			return new InlineCategoriesDocument (categories, isFixed, scheme);
 		}
 
 		public static CategoriesDocument Load (XmlReader reader)
@@ -75,17 +72,20 @@ namespace System.ServiceModel.Syndication
 
 		public CategoriesDocument ()
 		{
-			AttributeExtensions = new Dictionary<XmlQualifiedName, string> ();
-			ElementExtensions = new SyndicationElementExtensionCollection ();
 		}
 
 		CategoriesDocumentFormatter formatter;
+		SyndicationExtensions extensions = new SyndicationExtensions ();
 
-		public Dictionary<XmlQualifiedName, string> AttributeExtensions { get; private set; }
+		public Dictionary<XmlQualifiedName, string> AttributeExtensions {
+			get { return extensions.Attributes; }
+		}
 
 		public Uri BaseUri { get; set; }
 
-		public SyndicationElementExtensionCollection ElementExtensions { get; private set; }
+		public SyndicationElementExtensionCollection ElementExtensions {
+			get { return extensions.Elements; }
+		}
 
 		public string Language { get; set; }
 
@@ -115,12 +115,12 @@ namespace System.ServiceModel.Syndication
 
 		protected internal virtual void WriteAttributeExtensions (XmlWriter writer, string version)
 		{
-			Utility.WriteAttributeExtensions (AttributeExtensions, writer, version);
+			extensions.WriteAttributeExtensions (writer, version);
 		}
 
 		protected internal virtual void WriteElementExtensions (XmlWriter writer, string version)
 		{
-			Utility.WriteElementExtensions (ElementExtensions, writer, version);
+			extensions.WriteElementExtensions (writer, version);
 		}
 	}
 }

+ 6 - 0
mcs/class/System.ServiceModel.Web/System.ServiceModel.Syndication/ChangeLog

@@ -1,3 +1,9 @@
+2009-04-06  Atsushi Enomoto  <[email protected]>
+
+	* Workspace.cs, ResourceCollectionInfo.cs,
+	  CategoriesDocument.cs, ServiceDocument.cs : use common internal
+	  SyndicationExtension class for extensions.
+
 2009-04-06  Atsushi Enomoto  <[email protected]>
 
 	* AtomPub10CategoriesDocumentFormatter.cs, Atom10FeedFormatter.cs,

+ 8 - 5
mcs/class/System.ServiceModel.Web/System.ServiceModel.Syndication/ResourceCollectionInfo.cs

@@ -40,9 +40,7 @@ namespace System.ServiceModel.Syndication
 		public ResourceCollectionInfo ()
 		{
 			Accepts = new Collection<string> ();
-			AttributeExtensions = new Dictionary<XmlQualifiedName, string> ();
 			Categories = new Collection<CategoriesDocument> ();
-			ElementExtensions = new SyndicationElementExtensionCollection ();
 		}
 
 		public ResourceCollectionInfo (TextSyndicationContent title, Uri link)
@@ -78,16 +76,21 @@ namespace System.ServiceModel.Syndication
 		}
 
 		bool allow_new_entries;
+		SyndicationExtensions extensions = new SyndicationExtensions ();
 
 		public Collection<string> Accepts { get; private set; }
 
-		public Dictionary<XmlQualifiedName, string> AttributeExtensions { get; private set; }
+		public Dictionary<XmlQualifiedName, string> AttributeExtensions {
+			get { return extensions.Attributes; }
+		}
 
 		public Uri BaseUri { get; set; }
 
 		public Collection<CategoriesDocument> Categories { get; private set; }
 
-		public SyndicationElementExtensionCollection ElementExtensions { get; private set; }
+		public SyndicationElementExtensionCollection ElementExtensions {
+			get { return extensions.Elements; }
+		}
 
 		public Uri Link { get; set; }
 
@@ -118,7 +121,7 @@ namespace System.ServiceModel.Syndication
 
 		protected internal virtual void WriteAttributeExtensions (XmlWriter writer, string version)
 		{
-			Utility.WriteElementExtensions (ElementExtensions, writer, version);
+			extensions.WriteAttributeExtensions (writer, version);
 		}
 	}
 }

+ 9 - 6
mcs/class/System.ServiceModel.Web/System.ServiceModel.Syndication/ServiceDocument.cs

@@ -68,8 +68,6 @@ namespace System.ServiceModel.Syndication
 
 		public ServiceDocument ()
 		{
-			AttributeExtensions = new Dictionary<XmlQualifiedName, string> ();
-			ElementExtensions = new SyndicationElementExtensionCollection ();
 			Workspaces = new Collection<Workspace> ();
 		}
 
@@ -82,12 +80,17 @@ namespace System.ServiceModel.Syndication
 		}
 
 		ServiceDocumentFormatter formatter;
+		SyndicationExtensions extensions = new SyndicationExtensions ();
 
-		public Dictionary<XmlQualifiedName, string> AttributeExtensions { get; private set; }
+		public Dictionary<XmlQualifiedName, string> AttributeExtensions {
+			get { return extensions.Attributes; }
+		}
 
 		public Uri BaseUri { get; set; }
 
-		public SyndicationElementExtensionCollection ElementExtensions { get; private set; }
+		public SyndicationElementExtensionCollection ElementExtensions {
+			get { return extensions.Elements; }
+		}
 
 		public string Language { get; set; }
 
@@ -139,12 +142,12 @@ namespace System.ServiceModel.Syndication
 
 		protected internal virtual void WriteAttributeExtensions (XmlWriter writer, string version)
 		{
-			Utility.WriteAttributeExtensions (AttributeExtensions, writer, version);
+			extensions.WriteAttributeExtensions (writer, version);
 		}
 
 		protected internal virtual void WriteElementExtensions (XmlWriter writer, string version)
 		{
-			Utility.WriteElementExtensions (ElementExtensions, writer, version);
+			extensions.WriteElementExtensions (writer, version);
 		}
 	}
 }

+ 10 - 6
mcs/class/System.ServiceModel.Web/System.ServiceModel.Syndication/Workspace.cs

@@ -39,9 +39,7 @@ namespace System.ServiceModel.Syndication
 	{
 		public Workspace ()
 		{
-			AttributeExtensions = new Dictionary<XmlQualifiedName, string> ();
 			Collections = new Collection<ResourceCollectionInfo> ();
-			ElementExtensions = new SyndicationElementExtensionCollection ();
 		}
 
 		public Workspace (TextSyndicationContent title, IEnumerable<ResourceCollectionInfo> collections)
@@ -58,13 +56,19 @@ namespace System.ServiceModel.Syndication
 		{
 		}
 
-		public Dictionary<XmlQualifiedName, string> AttributeExtensions { get; private set; }
+		SyndicationExtensions extensions = new SyndicationExtensions ();
+
+		public Dictionary<XmlQualifiedName, string> AttributeExtensions {
+			get { return extensions.Attributes; }
+		}
 
 		public Uri BaseUri { get; set; }
 
 		public Collection<ResourceCollectionInfo> Collections { get; private set; }
 
-		public SyndicationElementExtensionCollection ElementExtensions { get; private set; }
+		public SyndicationElementExtensionCollection ElementExtensions {
+			get { return extensions.Elements; }
+		}
 
 		public TextSyndicationContent Title { get; set; }
 
@@ -87,12 +91,12 @@ namespace System.ServiceModel.Syndication
 
 		protected internal virtual void WriteAttributeExtensions (XmlWriter writer, string version)
 		{
-			Utility.WriteAttributeExtensions (AttributeExtensions, writer, version);
+			extensions.WriteAttributeExtensions (writer, version);
 		}
 
 		protected internal virtual void WriteElementExtensions (XmlWriter writer, string version)
 		{
-			Utility.WriteElementExtensions (ElementExtensions, writer, version);
+			extensions.WriteElementExtensions (writer, version);
 		}
 	}
 }