From 00c548e1ded1870ea852735b1558fc9b9eb11cb3 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 5 Feb 2017 20:46:42 +0100 Subject: [PATCH] factorizing constants --- YavscLib/YavscLib.csproj | 3 + ZicMoove/ZicMoove.Droid/MainActivity.cs | 4 +- .../Services/GcmRegistrationIntentService.cs | 2 +- .../Services/MyGcmIntentService.cs | 3 +- ZicMoove/ZicMoove/Constants.cs | 1 - ZicMoove/ZicMoove/Data/DataManager.cs | 2 + ZicMoove/ZicMoove/Model/Manager.cs | 63 ------------------ ZicMoove/ZicMoove/Model/Workflow/Activity.cs | 65 +++++++++++++++++++ .../ZicMoove/Model/Workflow/CommandForm.cs | 32 +++++++++ ZicMoove/ZicMoove/Settings/MainSettings.cs | 1 - ZicMoove/ZicMoove/ZicMoove.csproj | 3 +- 11 files changed, 108 insertions(+), 71 deletions(-) delete mode 100644 ZicMoove/ZicMoove/Model/Manager.cs create mode 100644 ZicMoove/ZicMoove/Model/Workflow/Activity.cs create mode 100644 ZicMoove/ZicMoove/Model/Workflow/CommandForm.cs diff --git a/YavscLib/YavscLib.csproj b/YavscLib/YavscLib.csproj index 05d56efd..81d429c0 100644 --- a/YavscLib/YavscLib.csproj +++ b/YavscLib/YavscLib.csproj @@ -47,12 +47,15 @@ + + + diff --git a/ZicMoove/ZicMoove.Droid/MainActivity.cs b/ZicMoove/ZicMoove.Droid/MainActivity.cs index 702248eb..27f7f1f9 100644 --- a/ZicMoove/ZicMoove.Droid/MainActivity.cs +++ b/ZicMoove/ZicMoove.Droid/MainActivity.cs @@ -327,8 +327,8 @@ namespace ZicMoove.Droid { var auth = new YaOAuth2Authenticator( clientId: Constants.APIKey, - clientSecret: "blouh", - scope: "profile", + clientSecret: Constants.APISecret, + scope: Constants.Scope, authorizeUrl: new Uri(Constants.AuthorizeUrl), redirectUrl: new Uri(Constants.RedirectUrl), accessTokenUrl: new Uri(Constants.AccessTokenUrl)); diff --git a/ZicMoove/ZicMoove.Droid/Services/GcmRegistrationIntentService.cs b/ZicMoove/ZicMoove.Droid/Services/GcmRegistrationIntentService.cs index 42a81b4d..97626a0b 100644 --- a/ZicMoove/ZicMoove.Droid/Services/GcmRegistrationIntentService.cs +++ b/ZicMoove/ZicMoove.Droid/Services/GcmRegistrationIntentService.cs @@ -64,7 +64,7 @@ namespace ZicMoove.Droid } #endif - var senderid = MainSettings.GoogleSenderId; + var senderid = Constants.GoogleSenderId; var token = instanceID.GetToken ( senderid, GoogleCloudMessaging.InstanceIdScope, null); diff --git a/ZicMoove/ZicMoove.Droid/Services/MyGcmIntentService.cs b/ZicMoove/ZicMoove.Droid/Services/MyGcmIntentService.cs index 9fbd7c84..45e2e16e 100644 --- a/ZicMoove/ZicMoove.Droid/Services/MyGcmIntentService.cs +++ b/ZicMoove/ZicMoove.Droid/Services/MyGcmIntentService.cs @@ -112,8 +112,7 @@ namespace ZicMoove.Droid void SubscribeGCM () { Context context = this.ApplicationContext; - string senders = MainSettings.GoogleSenderId; - // Resources.GetString(GoogleSenderId); + string senders = Constants.GoogleSenderId; Intent intent = new Intent ("com.google.android.c2dm.intent.REGISTER"); intent.SetPackage ("com.google.android.gsf"); intent.PutExtra ("app", PendingIntent.GetBroadcast (context, 0, new Intent (), 0)); diff --git a/ZicMoove/ZicMoove/Constants.cs b/ZicMoove/ZicMoove/Constants.cs index 2ba194cb..5e9d5ab5 100644 --- a/ZicMoove/ZicMoove/Constants.cs +++ b/ZicMoove/ZicMoove/Constants.cs @@ -11,7 +11,6 @@ namespace ZicMoove { public static readonly string AuthorizeUrl = YavscHomeUrl + "/authorize"; - public static readonly string RedirectUrl = YavscHomeUrl + "/oauth/success"; public static readonly string AccessTokenUrl = YavscHomeUrl + "/token"; public static readonly string YavscApiUrl = YavscHomeUrl + "/api"; diff --git a/ZicMoove/ZicMoove/Data/DataManager.cs b/ZicMoove/ZicMoove/Data/DataManager.cs index 9e29d827..0f8c338e 100644 --- a/ZicMoove/ZicMoove/Data/DataManager.cs +++ b/ZicMoove/ZicMoove/Data/DataManager.cs @@ -15,6 +15,7 @@ { // TODO estimatetemplate rating service product tag public RemoteEntityRO BookQueries { get; set; } + public RemoteEntityRO Activities { get; set; } public ChatUserCollection ChatUsers { get; set; } public EstimateEntity Estimates { get; set; } public RemoteEntity Blogspot { get; set; } @@ -67,6 +68,7 @@ RemoteFiles.Load(); BlackList.Load(); ChatUsers.Load(); + Activities.Load(); } } } diff --git a/ZicMoove/ZicMoove/Model/Manager.cs b/ZicMoove/ZicMoove/Model/Manager.cs deleted file mode 100644 index c4fefb7c..00000000 --- a/ZicMoove/ZicMoove/Model/Manager.cs +++ /dev/null @@ -1,63 +0,0 @@ -using ZicMoove.Model.Social; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Windows.Input; - -namespace ZicMoove -{ - [Obsolete("Use Helpers.DataManager")] - public static class Manager - { - static Manager () - { - } - - public static ICommand RefreshBookQueries; - // TODO WIP TEST rop this - private static Location[] _places = new Location[] { - new Location { Latitude = 48.8626458, Longitude = 2.2065559, Address = "2 bd Aristide Briand - Suresnes" }, - new Location{ Latitude =48.8632757, Longitude =2.2023099, Address ="Théatre Jean Villard - Suresnes" }, - new Location{ Latitude =48.8647120, Longitude =2.2054588,Address = "Place de la Paix - Suresnes" }, - new Location{ Latitude =48.8640133, Longitude =2.2056573, Address ="Restaurant" }, - new Location{ Latitude =48.8634839, Longitude =2.2064137,Address = "Square" }, - new Location{ Latitude =48.8653649, Longitude =2.2014945,Address = "Stade de foot" }, - }; - // TODO WIP TEST rop this - private static ObservableCollection _your_events = new ObservableCollection { - new LocalizedEvent { - - Title = "Yavsc Party", - Description = "Lancement en fanfare de la version 1.0 de ZicMoove, l'appli des fétards", - ProviderId = "paul", - ProviderName = "Yavsc Fondation", - EventWebPage = "http://lua.pschneider.fr/", - Location = _places[0] - }, - new LocalizedEvent { - Title = "Evenement de test", - Description = "Blah bli lo qui est errare, ma no. Blou test allo 3!", - ProviderId = "provid3", - ProviderName = "Prov Entreprise 3", - EventWebPage = "http://lua.pschneider.fr/events/test3", - Location = _places[1] - }, - new LocalizedEvent { - Title = "DjFx feat XamCoder, en Concert gratuit", - Description = "Hip Hop à Suresnes", - ProviderId = "brahim", - ProviderName = "Totem Production", - EventWebPage = "http://lua.pschneider.fr/events/totem", - Location = _places[2] - } - }; - // TODO WIP TEST rop this - public static ObservableCollection Events { - get { - return _your_events; - } - } - - } -} - diff --git a/ZicMoove/ZicMoove/Model/Workflow/Activity.cs b/ZicMoove/ZicMoove/Model/Workflow/Activity.cs new file mode 100644 index 00000000..61ce0918 --- /dev/null +++ b/ZicMoove/ZicMoove/Model/Workflow/Activity.cs @@ -0,0 +1,65 @@ +using System; +using YavscLib; + +namespace ZicMoove.Model.Workflow +{ + public class Activity : IActivity + { + public string Code + { + get; set; + } + + public DateTime DateCreated + { + get; set; + } + + public DateTime DateModified + { + get; set; + } + + public string ModeratorGroupName + { + get; set; + } + + public string Name + { + get; set; + } + + public string ParentCode + { + get; set; + } + + public string Photo + { + get; set; + } + + public int Rate + { + get; set; + } + + public string SettingsClassName + { + get; set; + } + + public string UserCreated + { + get; set; + } + + public string UserModified + { + get; set; + } + + public CommandForm[] Forms { get; set; } + } +} diff --git a/ZicMoove/ZicMoove/Model/Workflow/CommandForm.cs b/ZicMoove/ZicMoove/Model/Workflow/CommandForm.cs new file mode 100644 index 00000000..cdc87566 --- /dev/null +++ b/ZicMoove/ZicMoove/Model/Workflow/CommandForm.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using YavscLib; + +namespace ZicMoove.Model.Workflow +{ + public class CommandForm : ICommandForm + { + public string Action + { + get; set; + } + + public string ActivityCode + { + get; set; + } + + public long Id + { + get; set; + } + + public string Title + { + get; set; + } + } +} diff --git a/ZicMoove/ZicMoove/Settings/MainSettings.cs b/ZicMoove/ZicMoove/Settings/MainSettings.cs index 6fc5e995..12598d7c 100644 --- a/ZicMoove/ZicMoove/Settings/MainSettings.cs +++ b/ZicMoove/ZicMoove/Settings/MainSettings.cs @@ -43,7 +43,6 @@ namespace ZicMoove.Settings string.Empty; private static readonly bool PushNotificationsDefault = false; - public static readonly string GoogleSenderId = "325408689282"; private const string MusicalKey = "musical_prefs"; private const string EnvironKey = "environ_prefs"; diff --git a/ZicMoove/ZicMoove/ZicMoove.csproj b/ZicMoove/ZicMoove/ZicMoove.csproj index c97f3230..3e6d78b1 100644 --- a/ZicMoove/ZicMoove/ZicMoove.csproj +++ b/ZicMoove/ZicMoove/ZicMoove.csproj @@ -77,6 +77,8 @@ + + SearchPage.xaml @@ -180,7 +182,6 @@ -