This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Improved the Service class comments by adding the missing exception i…

…nformation
  • Loading branch information...
1 parent ee615fb commit 91a01cf41d24142c9baa1f06b56b3a42be5be8d7 @PedroLamas committed Apr 15, 2012
View
@@ -3,4 +3,7 @@ Thumbs.db
*.vspscc
*.suo
*.log
-[Bb]in
+[Bb]in
+*.cache
+*.Cache
+_ReSharper*/
@@ -13,6 +13,7 @@
// </license>
// ****************************************************************************
+using System;
using Microsoft.Phone.Tasks;
namespace Cimbalino.Phone.Toolkit.Services
@@ -26,6 +27,7 @@ public class BingMapsDirectionsService : IBingMapsDirectionsService
/// Shows the Bing Maps application with driving directions displayed for the specified ending location.
/// </summary>
/// <param name="endingLocation">The ending location for which driving directions are displayed.</param>
+ /// <exception cref="InvalidOperationException">Start and End cannot both be invalid.</exception>
public void Show(LabeledMapLocation endingLocation)
{
Show(null, endingLocation);
@@ -36,6 +38,7 @@ public void Show(LabeledMapLocation endingLocation)
/// </summary>
/// <param name="startingLocation">The starting location for which driving directions are displayed.</param>
/// <param name="endingLocation">The ending location for which driving directions are displayed.</param>
+ /// <exception cref="InvalidOperationException">Start and End cannot both be invalid.</exception>
public void Show(LabeledMapLocation startingLocation, LabeledMapLocation endingLocation)
{
new BingMapsDirectionsTask()
@@ -13,6 +13,7 @@
// </license>
// ****************************************************************************
+using System;
using System.Device.Location;
using Microsoft.Phone.Tasks;
@@ -26,6 +27,7 @@ public class BingMapsService : IBingMapsService
/// <summary>
/// Shows the Bing Maps application centered on the user's current location.
/// </summary>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
public void Show()
{
new BingMapsTask().Show();
@@ -35,6 +37,7 @@ public void Show()
/// Shows the Bing Maps application centered on the user's current location, with the specified initial zoom level.
/// </summary>
/// <param name="zoomLevel">The initial zoom level of the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
public void Show(double zoomLevel)
{
Show(null, null, zoomLevel);
@@ -44,6 +47,7 @@ public void Show(double zoomLevel)
/// Shows the Bing Maps application centered on the specified location.
/// </summary>
/// <param name="center">The location that will be used as the center point for the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
public void Show(GeoCoordinate center)
{
new BingMapsTask()
@@ -57,6 +61,7 @@ public void Show(GeoCoordinate center)
/// </summary>
/// <param name="center">The location that will be used as the center point for the map.</param>
/// <param name="zoomLevel">The initial zoom level of the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
public void Show(GeoCoordinate center, double zoomLevel)
{
Show(center, null, zoomLevel);
@@ -66,6 +71,7 @@ public void Show(GeoCoordinate center, double zoomLevel)
/// Shows the Bing Maps application centered on the current user location, with locations matching the specified search term tagged on the map.
/// </summary>
/// <param name="searchTerm">The search term that is used to find and tag locations on the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
public void Show(string searchTerm)
{
new BingMapsTask()
@@ -79,6 +85,7 @@ public void Show(string searchTerm)
/// </summary>
/// <param name="searchTerm">The search term that is used to find and tag locations on the map.</param>
/// <param name="zoomLevel">The initial zoom level of the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
public void Show(string searchTerm, double zoomLevel)
{
Show(null, searchTerm, zoomLevel);
@@ -90,6 +97,7 @@ public void Show(string searchTerm, double zoomLevel)
/// <param name="center">The location that will be used as the center point for the map.</param>
/// <param name="searchTerm">The search term that is used to find and tag locations on the map.</param>
/// <param name="zoomLevel">The initial zoom level of the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
public void Show(GeoCoordinate center, string searchTerm, double zoomLevel)
{
new BingMapsTask()
@@ -13,6 +13,7 @@
// </license>
// ****************************************************************************
+using System.Security;
using System.Windows;
namespace Cimbalino.Phone.Toolkit.Services
@@ -26,6 +27,7 @@ public class ClipboardService : IClipboardService
/// Sets Unicode text data to store on the clipboard.
/// </summary>
/// <param name="text">A string that contains the Unicode text data to store on the clipboard.</param>
+ /// <exception cref="SecurityException">Invoked this method from outside a user-initiated context -or- Clipboard access user dialog box was not confirmed.</exception>
public void SetText(string text)
{
Clipboard.SetText(text);
@@ -13,6 +13,7 @@
// </license>
// ****************************************************************************
+using System;
using Microsoft.Phone.Tasks;
namespace Cimbalino.Phone.Toolkit.Services
@@ -26,13 +27,15 @@ public interface IBingMapsDirectionsService
/// Shows the Bing Maps application with driving directions displayed for the specified ending location.
/// </summary>
/// <param name="endingLocation">The ending location for which driving directions are displayed.</param>
+ /// <exception cref="InvalidOperationException">Start and End cannot both be invalid.</exception>
void Show(LabeledMapLocation endingLocation);
/// <summary>
/// Shows the Bing Maps application with driving directions displayed for the specified starting and ending locations.
/// </summary>
/// <param name="startingLocation">The starting location for which driving directions are displayed.</param>
/// <param name="endingLocation">The ending location for which driving directions are displayed.</param>
+ /// <exception cref="InvalidOperationException">Start and End cannot both be invalid.</exception>
void Show(LabeledMapLocation startingLocation, LabeledMapLocation endingLocation);
}
}
@@ -13,6 +13,7 @@
// </license>
// ****************************************************************************
+using System;
using System.Device.Location;
namespace Cimbalino.Phone.Toolkit.Services
@@ -25,38 +26,44 @@ public interface IBingMapsService
/// <summary>
/// Shows the Bing Maps application centered on the user's current location.
/// </summary>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
void Show();
/// <summary>
/// Shows the Bing Maps application centered on the user's current location, with the specified initial zoom level.
/// </summary>
/// <param name="zoomLevel">The initial zoom level of the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
void Show(double zoomLevel);
/// <summary>
/// Shows the Bing Maps application centered on the specified location.
/// </summary>
/// <param name="center">The location that will be used as the center point for the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
void Show(GeoCoordinate center);
/// <summary>
/// Shows the Bing Maps application centered on the specified location, with the specified initial zoom level.
/// </summary>
/// <param name="center">The location that will be used as the center point for the map.</param>
/// <param name="zoomLevel">The initial zoom level of the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
void Show(GeoCoordinate center, double zoomLevel);
/// <summary>
/// Shows the Bing Maps application centered on the current user location, with locations matching the specified search term tagged on the map.
/// </summary>
/// <param name="searchTerm">The search term that is used to find and tag locations on the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
void Show(string searchTerm);
/// <summary>
/// Shows the Bing Maps application centered on the current user location, with locations matching the search term tagged on the map, and the specified initial zoom level.
/// </summary>
/// <param name="searchTerm">The search term that is used to find and tag locations on the map.</param>
/// <param name="zoomLevel">The initial zoom level of the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
void Show(string searchTerm, double zoomLevel);
/// <summary>
@@ -65,6 +72,7 @@ public interface IBingMapsService
/// <param name="center">The location that will be used as the center point for the map.</param>
/// <param name="searchTerm">The search term that is used to find and tag locations on the map.</param>
/// <param name="zoomLevel">The initial zoom level of the map.</param>
+ /// <exception cref="InvalidOperationException">Center and SearchTerm cannot both be empty.</exception>
void Show(GeoCoordinate center, string searchTerm, double zoomLevel);
}
}
@@ -13,6 +13,8 @@
// </license>
// ****************************************************************************
+using System.Security;
+
namespace Cimbalino.Phone.Toolkit.Services
{
/// <summary>
@@ -24,6 +26,7 @@ public interface IClipboardService
/// Sets Unicode text data to store on the clipboard.
/// </summary>
/// <param name="text">A string that contains the Unicode text data to store on the clipboard.</param>
+ /// <exception cref="SecurityException">Invoked this method from outside a user-initiated context -or- Clipboard access user dialog box was not confirmed.</exception>
void SetText(string text);
/// <summary>

0 comments on commit 91a01cf

Please sign in to comment.