Example #1
0
 /// <summary>
 /// Publish a count related event (e.g., plugin_total_count) to the Disa Android client.
 ///
 /// IMPORTANT: Note that this is internal so that only the Disa.Framework assembly can call this function.
 /// </summary>
 /// <param name="eventAction">The type safe representation of the Event Action.</param>
 /// <param name="eventCategory">The type safe representation of the Event Category.</param>
 /// <param name="customDimensionIndex">The type safe representation of the Custom Dimension Index.</param>
 /// <param name="count">The count to be associated with this Google Analytics event.</param>
 internal static void RaiseCountEvent(
     EventAction eventAction,
     EventCategory eventCategory,
     CustomDimensionIndex customDimensionIndex,
     int count)
 {
     CountEvent?.Invoke(eventAction, eventCategory, customDimensionIndex, count);
 }
Example #2
0
        /// <summary>
        /// Converts a type safe <see cref="CustomDimensionIndex"/> into a defined int for Google Analytics.
        ///
        /// Note:
        /// Although we could define the enum values to match the DimensionIndex, we are using this helper function
        /// to stay consistent with how we determine values for other Google Analytics elements.
        /// </summary>
        /// <param name="customDimensionIndex">The enum we want to convert.</param>
        /// <returns>The defined int for Google Analytics.</returns>
        public static int GetCustomDimensionIndex(CustomDimensionIndex customDimensionIndex)
        {
            switch (customDimensionIndex)
            {
            case CustomDimensionIndex.PluginName: { return(1); }

            case CustomDimensionIndex.ServiceName: { return(4); }

            case CustomDimensionIndex.ServiceActiveCount: { return(3); }
            }

            return(-1);
        }