public static void DownloadConfigurationTemplates(TemplatesDownloaded onDownloaded) { // first resolve the Guid to the correct type ID ApplicationApi.GetDefinedTypeIdForGuid(FamilyManagerApi.ConfigurationTemplateDefinedTypeGuid, delegate(System.Net.HttpStatusCode statusCode, string statusDescription, List <Rock.Client.DefinedType> definedTypeModel) { // if the request for the defined type worked if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true && definedTypeModel != null && definedTypeModel.Count > 0) { // now get the actual values FamilyManagerApi.GetConfigurationTemplates(definedTypeModel[0].Id, 0, delegate(System.Net.HttpStatusCode configStatusCode, string configStatusDescription, List <Rock.Client.DefinedValue> definedValueModels) { if (Rock.Mobile.Network.Util.StatusInSuccessRange(configStatusCode) == true && definedValueModels != null) { onDownloaded(definedValueModels); } else { // fail onDownloaded(null); } }); } else { // fail onDownloaded(null); } }); }
public static void DownloadConfigurationTemplates( TemplatesDownloaded onDownloaded ) { // first resolve the Guid to the correct type ID ApplicationApi.GetDefinedTypeIdForGuid( FamilyManagerApi.ConfigurationTemplateDefinedTypeGuid, delegate(System.Net.HttpStatusCode statusCode, string statusDescription, List<Rock.Client.DefinedType> definedTypeModel ) { // if the request for the defined type worked if( Rock.Mobile.Network.Util.StatusInSuccessRange( statusCode ) == true && definedTypeModel != null && definedTypeModel.Count > 0 ) { // now get the actual values FamilyManagerApi.GetConfigurationTemplates( definedTypeModel[ 0 ].Id, 0, delegate(System.Net.HttpStatusCode configStatusCode, string configStatusDescription, List<Rock.Client.DefinedValue> definedValueModels ) { if( Rock.Mobile.Network.Util.StatusInSuccessRange( configStatusCode ) == true && definedValueModels != null ) { onDownloaded( definedValueModels ); } else { // fail onDownloaded( null ); } }); } else { // fail onDownloaded( null ); } }); }