diff Agendas/trunk/src/Agendas.Google/GooglePublicador.cs @ 158:734d3f0853bf

Manejando configuración de los publicadores con una sección propia en los .config Agregando la opción de habilitar / deshabilitar un publicador
author nelopauselli
date Fri, 05 Aug 2011 16:55:18 -0300
parents 80156ae1493f
children 2a336a6a76b5
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Google/GooglePublicador.cs	Thu Aug 04 18:45:18 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Google/GooglePublicador.cs	Fri Aug 05 16:55:18 2011 -0300
@@ -1,5 +1,5 @@
 using System.Collections.Generic;
-using System.Configuration;
+using AltNetHispano.Agendas.Configurations;
 using AltNetHispano.Agendas.Domain;
 using AltNetHispano.Agendas.Google.DetailsEvents;
 
@@ -12,21 +12,23 @@
         
         private static string GetUserName
         {
-            get { return ConfigurationManager.AppSettings["userNameGoogleCalendar"]; }
+            get { return AgendasConfigurationManager.Publicadores.Google.Calendar.UserName; }
         }
 
 	    private static string GetPassword
 	    {
-            get { return ConfigurationManager.AppSettings["passwordGoogleCalendar"]; }
+			get { return AgendasConfigurationManager.Publicadores.Google.Calendar.Password; }
 	    }
 
 	    private static string GetCalendarId
 	    {
-            get { return ConfigurationManager.AppSettings["calendarIdGoogleCalendar"]; }
+			get { return AgendasConfigurationManager.Publicadores.Google.Calendar.CalendarId; }
 	    }
 
 	    public void Publicar(IEnumerable<Track> tracks)
 		{
+			if (!AgendasConfigurationManager.Publicadores.Google.Enabled) return;
+
 		    foreach (var track in tracks)
 		    {
                 switch (track.Accion)