Author: fmantek
Date: Fri Sep 7 09:35:28 2007
New Revision: 240
Removed:
trunk/clients/cs/src/extensions/geokmlpoint.cs
trunk/clients/cs/src/extensions/geokmlpos.cs
Modified:
trunk/clients/cs/src/core/atombase.cs
trunk/clients/cs/src/core/utilities.cs
trunk/clients/cs/src/extensions/exif.cs
trunk/clients/cs/src/extensions/gdatanametable.cs
trunk/clients/cs/src/extensions/georsswhere.cs
trunk/clients/cs/src/extensions/simplecontainer.cs
trunk/clients/cs/src/extensions/simpleelement.cs
trunk/clients/cs/src/gphotos/photoentry.cs
trunk/clients/cs/src/unittests/photostest.cs
Log:
More changes to the picasa extensions. Moved GeoRss into the same new system.
Started accessor addtions to photoentry
Modified: trunk/clients/cs/src/core/atombase.cs
==============================================================================
--- trunk/clients/cs/src/core/atombase.cs (original)
+++ trunk/clients/cs/src/core/atombase.cs Fri Sep 7 09:35:28 2007
@@ -329,31 +329,7 @@
/// <returns>Object</returns>
public Object FindExtension(string localName, string ns)
{
- foreach (object ob in this.ExtensionElements)
- {
- XmlNode node = ob as XmlNode;
- if (node != null)
- {
- if (compareXmlNess(node.LocalName, localName,
node.NamespaceURI, ns))
- {
- return ob;
- }
- }
- else
- {
- // only if the elements do implement the
ExtensionElementFactory
- // do we know if it's xml name/namespace
- IExtensionElementFactory ele = ob as
IExtensionElementFactory;
- if (ele != null)
- {
- if (compareXmlNess(ele.XmlName, localName,
ele.XmlNameSpace, ns))
- {
- return ob;
- }
- }
- }
- }
- return null;
+ return Utilities.FindExtension(this.ExtensionElements, localName,
ns);
}
/// <summary>
@@ -384,31 +360,9 @@
/// <returns>none</returns>
public ArrayList FindExtensions(string localName, string ns, ArrayList
arr)
{
- foreach (object ob in this.ExtensionElements)
- {
- XmlNode node = ob as XmlNode;
- if (node != null)
- {
- if (compareXmlNess(node.LocalName, localName,
node.NamespaceURI, ns))
- {
- arr.Add(ob);
- }
- }
- else
- {
- // only if the elements do implement the
ExtensionElementFactory
- // do we know if it's xml name/namespace
- IExtensionElementFactory ele = ob as
IExtensionElementFactory;
- if (ele != null)
- {
- if (compareXmlNess(ele.XmlName, localName,
ele.XmlNameSpace, ns))
- {
- arr.Add(ob);
- }
- }
- }
- }
- return arr;
+ return Utilities.FindExtensions(this.ExtensionElements,
+ localName, ns, arr);
+
}
/// <summary>
@@ -429,47 +383,47 @@
return arr.Count;
}
+
/// <summary>
/// all extension elements that match a namespace/localname
/// given will be removed and replaced with the new ones.
/// the input array can contain several different
/// namespace/localname combinations
+ /// if the passed list is NULL or empty, this will just result
+ /// in additions
/// </summary>
/// <param name="newList">a list of xmlnodes or
IExtensionElementFactory objects</param>
/// <returns>int - the number of deleted extensions</returns>
-
public int ReplaceExtensions(ArrayList newList)
{
- Tracing.Assert(newList != null, "newList should not be null");
- if (newList == null)
- {
- throw new ArgumentNullException("newList");
- }
- int count = 0;
+ int count = 0;
// get rid of all of the old ones matching the specs
- foreach (Object ob in newList)
+ if (newList != null)
{
- string localName = null;
- string ns = null;
- XmlNode node = ob as XmlNode;
- if (node != null)
- {
- localName = node.LocalName;
- ns = node.NamespaceURI;
- }
- else
+ foreach (Object ob in newList)
{
- IExtensionElementFactory ele = ob as
IExtensionElementFactory;
- if (ele != null)
+ string localName = null;
+ string ns = null;
+ XmlNode node = ob as XmlNode;
+ if (node != null)
{
- localName = ele.XmlName;
- ns = ele.XmlNameSpace;
+ localName = node.LocalName;
+ ns = node.NamespaceURI;
+ }
+ else
+ {
+ IExtensionElementFactory ele = ob as
IExtensionElementFactory;
+ if (ele != null)
+ {
+ localName = ele.XmlName;
+ ns = ele.XmlNameSpace;
+ }
+ }
+
+ if (localName != null)
+ {
+ count += DeleteExtensions(localName, ns);
}
- }
-
- if (localName != null)
- {
- count += DeleteExtensions(localName, ns);
}
}
// now add the new ones
@@ -477,29 +431,25 @@
{
this.ExtensionElements.Add(ob);
}
-
return count;
}
-
-
- private bool compareXmlNess(string l1, string l2, string ns1, string
ns2)
+ /// <summary>
+ /// all extension elements that match a namespace/localname
+ /// given will be removed and the new one will be inserted
+ /// </summary>
+ /// <param name="localName">the local name to find</param>
+ /// <param name="ns">the namespace to match, if null, ns is
ignored</param>
+ /// <param name="element">the new element to put in</param>
+ public void ReplaceExtension(string localName, string ns, Object obj)
{
- if (String.Compare(l1,l2)==0)
- {
- if (ns1 == null)
- {
- return true;
- }
- else if (String.Compare(ns1, ns2)==0)
- {
- return true;
- }
- }
- return false;
+ DeleteExtensions(localName, ns);
+ this.ExtensionElements.Add(obj);
}
-
+
+
+
//////////////////////////////////////////////////////////////////////
/// <summary>Saves the object as XML.</summary>
/// <param name="stream">stream to save to</param>
Modified: trunk/clients/cs/src/core/utilities.cs
==============================================================================
--- trunk/clients/cs/src/core/utilities.cs (original)
+++ trunk/clients/cs/src/core/utilities.cs Fri Sep 7 09:35:28 2007
@@ -430,6 +430,110 @@
}
/////////////////////////////////////////////////////////////////////////////
+ /// <summary>
+ /// Finds a specific ExtensionElement based on it's local name
+ /// and it's namespace. If namespace is NULL, the first one where
+ /// the localname matches is found. If there are extensionelements
that do
+ /// not implment ExtensionElementFactory, they will not be taken into
account
+ /// Primary use of this is to find XML nodes
+ /// </summary>
+ /// <param name="arrList">the array to search through</param>
+ /// <param name="localName">the xml local name of the element to
find</param>
+ /// <param name="ns">the namespace of the elementToPersist</param>
+ /// <returns>Object</returns>
+ public static Object FindExtension(ArrayList arrList, string
localName, string ns)
+ {
+ if (arrList == null)
+ {
+ return null;
+ }
+ foreach (object ob in arrList)
+ {
+ XmlNode node = ob as XmlNode;
+ if (node != null)
+ {
+ if (compareXmlNess(node.LocalName, localName,
node.NamespaceURI, ns))
+ {
+ return ob;
+ }
+ }
+ else
+ {
+ // only if the elements do implement the
ExtensionElementFactory
+ // do we know if it's xml name/namespace
+ IExtensionElementFactory ele = ob as
IExtensionElementFactory;
+ if (ele != null)
+ {
+ if (compareXmlNess(ele.XmlName, localName,
ele.XmlNameSpace, ns))
+ {
+ return ob;
+ }
+ }
+ }
+ }
+ return null;
+ }
+ /// <summary>
+ /// Finds all ExtensionElement based on it's local name
+ /// and it's namespace. If namespace is NULL, allwhere
+ /// the localname matches is found. If there are extensionelements
that do
+ /// not implment ExtensionElementFactory, they will not be taken into
account
+ /// Primary use of this is to find XML nodes
+ /// </summary>
+ /// <param name="arrList">the array to search through</param>
+ /// <param name="localName">the xml local name of the element to
find</param>
+ /// <param name="ns">the namespace of the elementToPersist</param>
+ /// <param name="arr">the array to fill</param>
+ /// <returns>none</returns>
+ public static ArrayList FindExtensions(ArrayList arrList, string
localName, string ns, ArrayList arr)
+ {
+ foreach (object ob in arrList)
+ {
+ XmlNode node = ob as XmlNode;
+ if (node != null)
+ {
+ if (compareXmlNess(node.LocalName, localName,
node.NamespaceURI, ns))
+ {
+ arr.Add(ob);
+ }
+ }
+ else
+ {
+ // only if the elements do implement the
ExtensionElementFactory
+ // do we know if it's xml name/namespace
+ IExtensionElementFactory ele = ob as
IExtensionElementFactory;
+ if (ele != null)
+ {
+ if (compareXmlNess(ele.XmlName, localName,
ele.XmlNameSpace, ns))
+ {
+ arr.Add(ob);
+ }
+ }
+ }
+ }
+ return arr;
+ }
+
+ private static bool compareXmlNess(string l1, string l2, string ns1,
string ns2)
+ {
+ if (String.Compare(l1,l2)==0)
+ {
+ if (ns1 == null)
+ {
+ return true;
+ }
+ else if (String.Compare(ns1, ns2)==0)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+
+
+
}
/////////////////////////////////////////////////////////////////////////////
Modified: trunk/clients/cs/src/extensions/exif.cs
==============================================================================
--- trunk/clients/cs/src/extensions/exif.cs (original)
+++ trunk/clients/cs/src/extensions/exif.cs Fri Sep 7 09:35:28 2007
@@ -47,12 +47,16 @@
public const string NSExif =
"http://schemas.google.com/photos/exif/2007";
/// <summary>static string to specify the used exif prefix</summary>
public const string ExifPrefix = "exif";
+ /// <summary>
+ /// represents the tags container element
+ /// </summary>
+ public const string ExifTags = "tags";
}
/// <summary>
- /// MediaGroup container element for the MediaRss namespace
+ /// Tags container element for the Exif namespace
/// </summary>
public class ExifTags : SimpleContainer
{
@@ -60,7 +64,7 @@
/// base constructor, creates an exif:tags representation
/// </summary>
public ExifTags() :
- base("tags",
+ base(ExifNameTable.ExifTags,
ExifNameTable.ExifPrefix,
ExifNameTable.NSExif)
{
Modified: trunk/clients/cs/src/extensions/gdatanametable.cs
==============================================================================
--- trunk/clients/cs/src/extensions/gdatanametable.cs (original)
+++ trunk/clients/cs/src/extensions/gdatanametable.cs Fri Sep 7 09:35:28 2007
@@ -132,27 +132,7 @@
public const string XmlSendNotificationsElement =
"sendEventNotifications";
#endregion
-#region GEO specific
-
- /// <summary>static string to specify the GeoRSS namespace
supported</summary>
- public const string NSGeoRss = "http://www.georss.org/georss/";
- /// <summary>static string to specify the GeoRSS prefix used</summary>
- public const string geoRssPrefix = "georss";
- /// <summary>static string to specify the KML namespapce
supported</summary>
- public const string NSGeoKml = "http://www.opengis.net/gml";
- /// <summary>static string to specify the KML prefix used</summary>
- public const string geoKmlPrefix = "georss";
-
- /// <summary>static string to specify the the where element</summary>
- public const string GeoRssWhereElement = "where";
- /// <summary>static string to specify the the point element</summary>
- public const string GeoKmlPointElement = "point";
- /// <summary>static string to specify the the pos element</summary>
- public const string GeoKmlPosElement = "pos";
-
-
-#endregion
- }
+ }
/////////////////////////////////////////////////////////////////////////////
}
Modified: trunk/clients/cs/src/extensions/georsswhere.cs
==============================================================================
--- trunk/clients/cs/src/extensions/georsswhere.cs (original)
+++ trunk/clients/cs/src/extensions/georsswhere.cs Fri Sep 7 09:35:28 2007
@@ -15,99 +15,231 @@
using System;
using System.Xml;
-//using System.Collections;
-//using System.Text;
+using System.Globalization;
using Google.GData.Client;
namespace Google.GData.Extensions.Location {
- /// <summary>
- /// GEORSS schema extension describing a location.
+
+ /// <summary>
+ /// helper to instantiate all factories defined in here and attach
+ /// them to a base object
+ /// </summary>
+ public class GeoRssExtensions
+ {
+ /// <summary>
+ /// helper to add all MediaRss extensions to a base object
+ /// </summary>
+ /// <param name="baseObject"></param>
+ public static void AddExtension(AtomBase baseObject)
+ {
+ baseObject.AddExtension(new GeoRssWhere());
+ }
+ }
+
+
+ /// <summary>
+ /// short table for constants related to mediaRss declarations
/// </summary>
- public class GeoRssWhere : IExtensionElement, IExtensionElementFactory
+ public class GeoNametable
{
- GeoKmlPoint point;
+ /// <summary>static string to specify the georss namespace
+ /// </summary>
+ /// <summary>static string to specify the GeoRSS namespace
supported</summary>
+ public const string NSGeoRss = "http://www.georss.org/georss/";
+ /// <summary>static string to specify the GeoRSS prefix used</summary>
+ public const string geoRssPrefix = "georss";
+ /// <summary>static string to specify the KML namespapce
supported</summary>
+ public const string NSGeoKml = "http://www.opengis.net/gml";
+ /// <summary>static string to specify the KML prefix used</summary>
+ public const string geoKmlPrefix = "gml";
+ /// <summary>static string to specify the the where element</summary>
+ public const string GeoRssWhereElement = "where";
+ /// <summary>static string to specify the the point element</summary>
+ public const string GeoKmlPointElement = "point";
+ /// <summary>static string to specify the the pos element</summary>
+ public const string GeoKmlPositionElement = "pos";
+ }
+
+ /// <summary>
+ /// GEORSS schema extension describing a location. You are only supposed
to deal with that one,
+ /// not it's subelements.
+ /// </summary>
+ public class GeoRssWhere : SimpleContainer
+ {
+ /// <summary>
+ /// default constructor for a GeoRSS where element
+ /// </summary>
+ public GeoRssWhere() :
+ base(GeoNametable.GeoRssWhereElement,
+ GeoNametable.geoRssPrefix,
+ GeoNametable.NSGeoRss)
+ {
+ this.ExtensionFactories.Add(new GeoKmlPoint());
+ }
- #region GeoRSS where Parser
- //////////////////////////////////////////////////////////////////////
- /// <summary>Parses an xml node to create a GeoRSS object.</summary>
- /// <param name="node">georsswhere node</param>
- /// <param name="parser">AtomFeedParser to use</param>
- /// <returns>the created GeoRSSWhere object</returns>
- //////////////////////////////////////////////////////////////////////
- public IExtensionElement CreateInstance(XmlNode node, AtomFeedParser
parser)
- {
- Tracing.TraceCall();
- GeoRssWhere geoWhere = null;
- Tracing.Assert(node != null, "node should not be null");
- if (node == null)
+ /// <summary>
+ /// accessor for the Lattitude part
+ /// </summary>
+ public double Lattitude
+ {
+ get
{
- throw new ArgumentNullException("node");
+ GeoKmlPosition position = GetPosition(false);
+ if (position == null)
+ {
+ return -1;
+ }
+ return position.Lattitude;
+
}
+ set
+ {
+ GeoKmlPosition position = GetPosition(true);
+ position.Lattitude = value;
+
+ }
+ }
- object localname = node.LocalName;
- if (localname.Equals(GDataParserNameTable.GeoRssWhereElement))
+ /// <summary>
+ /// accessor for the Longitude part
+ /// </summary>
+ public double Longitude
+ {
+ get
{
- geoWhere = new GeoRssWhere();
- if (node.HasChildNodes)
+ GeoKmlPosition position = GetPosition(false);
+ if (position == null)
{
- XmlNode childNode = node.FirstChild;
- while (childNode != null && childNode is XmlElement)
- {
- if (childNode.LocalName ==
GDataParserNameTable.GeoKmlPointElement)
- {
- geoWhere.point = GeoKmlPoint.Parse(childNode,
parser);
- }
- // additional KML elements should go here
- childNode = childNode.NextSibling;
- }
+ return -1;
}
+ return position.Longitude;
+ }
+ set
+ {
+ GeoKmlPosition position = GetPosition(true);
+ position.Longitude = value;
}
- return geoWhere;
}
- #endregion
- #region overloaded from IExtensionElementFactory
+
- //////////////////////////////////////////////////////////////////////
- /// <summary>Returns the constant representing this XML
element.</summary>
- //////////////////////////////////////////////////////////////////////
- public string XmlName
+ /// <summary>
+ /// finds our position element, if we don't have one
+ /// creates a new one depending on the fCreate parameter
+ /// </summary>
+ /// </// <param name="fCreate">creates the subelements on true</param>
+ /// <returns>GeoKmlPosition</returns>
+ protected GeoKmlPosition GetPosition(bool fCreate)
{
- get { return GDataParserNameTable.GeoRssWhereElement; }
+ GeoKmlPoint point = FindExtension(GeoNametable.GeoKmlPointElement,
+ GeoNametable.NSGeoKml) as
GeoKmlPoint;
+
+ GeoKmlPosition position = null;
+
+ if (point == null && fCreate == true)
+ {
+ point = new GeoKmlPoint();
+ this.ExtensionElements.Add(point);
+ }
+ if (point != null)
+ {
+ position =
point.FindExtension(GeoNametable.GeoKmlPositionElement,
+ GeoNametable.NSGeoKml) as
GeoKmlPosition;
+
+
+ if (position == null && fCreate == true)
+ {
+ position = new GeoKmlPosition("0 0");
+ point.ExtensionElements.Add(position);
+ }
+ }
+ return position;
}
+ }
- //////////////////////////////////////////////////////////////////////
- /// <summary>Returns the constant representing this XML
element.</summary>
- //////////////////////////////////////////////////////////////////////
- public string XmlNameSpace
+ /// <summary>
+ /// KmlPoint. Specifies a particular location, by means of a gml position
+ /// element, appears as a child of a georss where element
+ /// </summary>
+ public class GeoKmlPoint : SimpleContainer
+ {
+ public GeoKmlPoint() :
+ base(GeoNametable.GeoKmlPointElement,
+ GeoNametable.geoKmlPrefix,
+ GeoNametable.NSGeoKml)
{
- get { return GDataParserNameTable.NSGeoRss; }
+ this.ExtensionFactories.Add(new GeoKmlPosition());
}
+ }
- //////////////////////////////////////////////////////////////////////
- /// <summary>Returns the constant representing this XML
element.</summary>
- //////////////////////////////////////////////////////////////////////
- public string XmlPrefix
+ /// <summary>
+ /// KmlPos Specifies a latitude/longitude, seperated by a space
+ /// appears as a child of a geokmlpoint element
+ /// </summary>
+ public class GeoKmlPosition : SimpleElement
+ {
+ /// <summary>
+ /// default constructor, creates a position element
+ /// </summary>
+ public GeoKmlPosition() :
+ base(GeoNametable.GeoKmlPositionElement,
+ GeoNametable.geoKmlPrefix,
+ GeoNametable.NSGeoKml)
+ {
+ }
+
+ /// <summary>
+ /// default constructor, takes an initial value
+ /// </summary>
+ /// <param name="initValue"></param>
+ public GeoKmlPosition(string initValue) :
+ base(GeoNametable.GeoKmlPositionElement,
+ GeoNametable.geoKmlPrefix,
+ GeoNametable.NSGeoKml, initValue)
{
- get { return GDataParserNameTable.geoRssPrefix; }
}
-
/// <summary>
- /// Persistence method for the Who object
+ /// accessor for Lattitude. Works by dynamically parsing
+ /// the string that is stored in Value. Will THROW if
+ /// that string is incorrectly formated
/// </summary>
- /// <param name="writer">the xmlwriter to write into</param>
- public void Save(XmlWriter writer)
+ public double Lattitude
{
+ get
+ {
+ string []values = this.Value.Split(new char[] {' '});
+ return Convert.ToDouble(values[0],
CultureInfo.InvariantCulture);
+ }
+ set
+ {
+ string []values = this.Value.Split(new char[] {' '});
+ this.Value = value.ToString(CultureInfo.InvariantCulture) + "
" + values[1];
+ }
+ }
- if (this.point != null)
+ /// <summary>
+ /// accessor for Longitude. Works by dynamically parsing
+ /// the string that is stored in Value. Will THROW if
+ /// that string is incorrectly formated
+ /// </summary>
+ public double Longitude
+ {
+ get
+ {
+ string []values = this.Value.Split(new char[] {' '});
+ return Convert.ToDouble(values[1],
CultureInfo.InvariantCulture);
+ }
+ set
{
- writer.WriteStartElement(XmlPrefix, XmlName, XmlNameSpace);
- this.point.Save(writer);
- writer.WriteEndElement();
+ string []values = this.Value.Split(new char[] {' '});
+ this.Value = values[0] + " " +
value.ToString(CultureInfo.InvariantCulture);
}
}
- #endregion
}
+
+
+
+
}
Modified: trunk/clients/cs/src/extensions/simplecontainer.cs
==============================================================================
--- trunk/clients/cs/src/extensions/simplecontainer.cs (original)
+++ trunk/clients/cs/src/extensions/simplecontainer.cs Fri Sep 7 09:35:28 2007
@@ -72,6 +72,20 @@
set {this.extensions = value;}
}
+ /// <summary>
+ /// Finds a specific ExtensionElement based on it's local name
+ /// and it's namespace. If namespace is NULL, the first one where
+ /// the localname matches is found. If there are extensionelements
that do
+ /// not implment ExtensionElementFactory, they will not be taken into
account
+ /// </summary>
+ /// <param name="localName">the xml local name of the element to
find</param>
+ /// <param name="ns">the namespace of the elementToPersist</param>
+ /// <returns>Object</returns>
+ public Object FindExtension(string localName, string ns)
+ {
+ return Utilities.FindExtension(this.extensions, localName, ns);
+ }
+
//////////////////////////////////////////////////////////////////////
/// <summary>the list of extensions for this container
/// the elements in that list MUST implement IExtensionElementFactory
Modified: trunk/clients/cs/src/extensions/simpleelement.cs
==============================================================================
--- trunk/clients/cs/src/extensions/simpleelement.cs (original)
+++ trunk/clients/cs/src/extensions/simpleelement.cs Fri Sep 7 09:35:28 2007
@@ -64,6 +64,7 @@
this.value = value;
}
+
//////////////////////////////////////////////////////////////////////
/// <summary>accesses the Attribute list. The keys are the attribute
names
/// the values the attribute values</summary>
Modified: trunk/clients/cs/src/gphotos/photoentry.cs
==============================================================================
--- trunk/clients/cs/src/gphotos/photoentry.cs (original)
+++ trunk/clients/cs/src/gphotos/photoentry.cs Fri Sep 7 09:35:28 2007
@@ -52,8 +52,67 @@
GPhotoExtensions.AddExtension(this);
MediaRssExtensions.AddExtension(this);
ExifExtensions.AddExtension(this);
- AddExtension(new GeoRssWhere());
+ GeoRssExtensions.AddExtension(this);
}
+
+ /// <summary>
+ /// getter/setter for the GeoRssWhere extension element
+ /// </summary>
+ public GeoRssWhere Location
+ {
+ get
+ {
+ return FindExtension(GeoNametable.GeoRssWhereElement,
+ GeoNametable.NSGeoRss) as GeoRssWhere;
+ }
+ set
+ {
+ ReplaceExtension(GeoNametable.GeoRssWhereElement,
+ GeoNametable.NSGeoRss,
+ value);
+ }
+ }
+
+ /// <summary>
+ /// getter/setter for the ExifTags extension element
+ /// </summary>
+ public ExifTags Exif
+ {
+ get
+ {
+ return FindExtension(ExifNameTable.ExifTags,
+ ExifNameTable.NSExif) as ExifTags;
+ }
+ set
+ {
+ ReplaceExtension(ExifNameTable.ExifTags,
+ ExifNameTable.NSExif,
+ value);
+ }
+ }
+
+ /// <summary>
+ /// returns the media:rss group container element
+ /// </summary>
+ public MediaGroup Media
+ {
+ get
+ {
+ return FindExtension(MediaRssNameTable.MediaRssGroup,
+ MediaRssNameTable.NSMediaRss) as
MediaGroup;
+ }
+ set
+ {
+ ReplaceExtension(MediaRssNameTable.MediaRssGroup,
+ MediaRssNameTable.NSMediaRss,
+ value);
+ }
+ }
+
+
+
+
+
}
}
Modified: trunk/clients/cs/src/unittests/photostest.cs
==============================================================================
--- trunk/clients/cs/src/unittests/photostest.cs (original)
+++ trunk/clients/cs/src/unittests/photostest.cs Fri Sep 7 09:35:28 2007
@@ -26,6 +26,10 @@
using Google.GData.Client.UnitTests;
using Google.GData.Extensions;
using Google.GData.Photos;
+using Google.GData.Extensions.Exif;
+using Google.GData.Extensions.Location;
+using Google.GData.Extensions.MediaRss;
+
@@ -84,8 +88,6 @@
PicasaService service = new PicasaService("unittests");
query.KindParameter = new PicasaQuery.Kinds[2]
{PicasaQuery.Kinds.album, PicasaQuery.Kinds.tag};
- int iCount;
-
if (this.defaultPhotosUri != null)
{
if (this.userName != null)
@@ -124,8 +126,6 @@
PhotoQuery query = new PhotoQuery();
PicasaService service = new PicasaService("unittests");
- int iCount;
-
if (this.defaultPhotosUri != null)
{
if (this.userName != null)
@@ -138,7 +138,7 @@
service.RequestFactory = this.factory;
query.Uri = new Uri(this.defaultPhotosUri);
- AtomFeed feed = service.Query(query);
+ PhotoFeed feed = service.Query(query);
ObjectModelHelper.DumpAtomObject(feed,CreateDumpFileName("PhotoAuthTest"));
iCount = feed.Entries.Count;
@@ -148,10 +148,29 @@
Tracing.TraceMsg("Found a Feed " + feed.ToString());
DisplayExtensions(feed);
- foreach (AtomEntry entry in feed.Entries)
+ foreach (PhotoEntry entry in feed.Entries)
{
Tracing.TraceMsg("Found an entry " + entry.ToString());
DisplayExtensions(entry);
+
+ GeoRssWhere w = entry.Location;
+ if (w != null)
+ {
+ Tracing.TraceMsg("Found an location " +
w.Lattitude + w.Longitude);
+ }
+
+ ExifTags tags = entry.Exif;
+ if (tags != null)
+ {
+ Tracing.TraceMsg("Found an exif block ");
+ }
+
+ MediaGroup group = entry.Media;
+ if (group != null)
+ {
+ Tracing.TraceMsg("Found a media Group");
+ }
+
}
}
@@ -171,8 +190,6 @@
AlbumQuery query = new AlbumQuery();
PicasaService service = new PicasaService("unittests");
- int iCount;
-
if (this.defaultPhotosUri != null)
{
if (this.userName != null)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---