This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Task<T> Delete<T>(string method, string id) | |
{ | |
throw new NotImplementedException(); | |
} | |
public async Task<T> GetOne<T>(string method, Dictionary<string, object> parameters = null) | |
{ | |
var stopWatch = System.Diagnostics.Stopwatch.StartNew(); | |
var nativeHandler = new NativeMessageHandler(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IHttpServices | |
{ | |
Task<IEnumerable<T>> Get<T>(string method, Dictionary<string, object> parameters = null); | |
Task<T> GetCustom<T>(string url, Dictionary<string, object> parameters = null); | |
Task<T> Get<T>(string method, string id, Dictionary<string, object> parameters = null); | |
Task<ListaPages<T>> GetPagina<T>(string method, Dictionary<string, string> parameters = null, int retry = 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DeviceHelper | |
{ | |
public static T OnRuntimePlatform<T>(T t1, T t2, T t3, T t4) | |
{ | |
switch (Device.RuntimePlatform) | |
{ | |
case Device.Android: | |
return t1; | |
case Device.iOS: | |
return t2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void DidPickDocumentPicker (UIDocumentMenuViewController documentMenu, UIDocumentPickerViewController documentPicker) | |
{ | |
documentPicker.DidPickDocument += DocumentPicker_DidPickDocument; | |
UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController (documentPicker, true, null); | |
} | |
void DocumentPicker_DidPickDocument (object sender, UIDocumentPickedEventArgs e) | |
{ | |
var securityEnabled = e.Url.StartAccessingSecurityScopedResource (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ViewMqtt : ContentPage{ | |
void Btn_Clicked (object sender, EventArgs e) | |
{ | |
var client = DependencyService.Get<IFMqttClient> (); | |
client.Connect ("borkerLink"); | |
client.Publish ("topicoQueRecebeMensagem", Encoding.UTF8.GetBytes ("mensagemEnviada")); | |
var topics = new string[] { | |
"Topico1 a ser assinado (subscribe)" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[assembly: Xamarin.Forms.Dependency (typeof(FMqttClient))] | |
namespace Mqtt_Forms.iOS | |
{ | |
public class FMqttClient : IFMqttClient | |
{ | |
public MqttClient client { | |
get; | |
set; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IFMqttClient | |
{ | |
void Connect (string server); | |
void Publish (string service, byte[] command); | |
void Subscribe (string[] topics); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.iOS; | |
using Badge.iOS; | |
using UIKit; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Drawing; | |
using Foundation; | |
using CoreGraphics; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Foundation; | |
using UIKit; | |
namespace AppTestForFastMapper.iOS | |
{ | |
[Register("AppDelegate")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace AppTestForFastMapper | |
{ | |
/// <summary> | |
/// Classe de domínio. | |
/// </summary> | |
public class Pessoa | |
{ | |
public int Id { get; set; } |
NewerOlder