/// <summary> /// Initializes a new instance of the <see cref="SnowplowTracker.Tracker"/> class. /// </summary> /// <param name="emitter">Emitter used for all sending and storing operations.</param> /// <param name="trackerNamespace">Tracker namespace.</param> /// <param name="appId">App identifier.</param> /// <param name="platform">The DevicePlatform the tracker is running on.</param> /// <param name="base64Encoded">If set to <c>true</c> all unstructured events and contextes will be base64 encoded.</param> public Tracker(IEmitter emitter, string trackerNamespace, string appId, Subject subject = null, Session session = null, DevicePlatforms platform = null, bool base64Encoded = true) { // Preconditions Utils.CheckArgument(emitter != null, "Emitter cannot be null."); // Tracker Setup this.emitter = emitter; this.trackerNamespace = trackerNamespace; this.appId = appId; this.platform = (platform != null) ? platform : DevicePlatforms.Mobile; this.base64Encoded = base64Encoded; this.subject = subject; this.session = session; // Set Synchronous or Asynchronous operation if (typeof(AsyncEmitter) == emitter.GetType()) { synchronous = false; } else { synchronous = true; } }
internal static string ToXamarinPlatform( this DevicePlatforms platform) { switch (platform) { case DevicePlatforms.All: return(Device.RuntimePlatform); case DevicePlatforms.Android: return(Device.Android); case DevicePlatforms.iOS: return(Device.iOS); case DevicePlatforms.macOS: return(Device.macOS); case DevicePlatforms.UWP: return(Device.UWP); case DevicePlatforms.WPF: return(Device.WPF); case DevicePlatforms.GTK: return(Device.GTK); default: throw new NotSupportedException(); } }
/// <summary> /// States that the specific registration is only relevant for the given platform(s) /// </summary> /// <param name="registrationInfo"></param> /// <param name="platform"><see cref="CodeMonkeys.Navigation.Xamarin.Forms.DevicePlatforms"/> to register</param> /// <returns>Registration info</returns> public static NavigationRegistration OnPlatform( this NavigationRegistration registrationInfo, DevicePlatforms platform) { registrationInfo.Platform = platform; return(registrationInfo); }
/// <summary> /// Sets the platform. /// </summary> /// <param name="platform">Platform.</param> public void SetPlatform(DevicePlatforms platform) { this.platform = platform; }