Ejemplo n.º 1
0
        public static AnalyticsResult CustomEvent(string customEventName, IDictionary <string, object> eventData)
        {
            if (string.IsNullOrEmpty(customEventName))
            {
                throw new ArgumentException("Cannot set custom event name to an empty or null string");
            }
            if (!IsInitialized())
            {
                return(AnalyticsResult.NotInitialized);
            }
            if (eventData == null)
            {
                return(SendCustomEventName(customEventName));
            }
            CustomEventData customEvent = new CustomEventData(customEventName);
            AnalyticsResult result      = AnalyticsResult.InvalidData;

            try
            {
                customEvent.AddDictionary(eventData);
                result = SendCustomEvent(customEvent);
            }
            finally
            {
                customEvent.Dispose();
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static AnalyticsResult CustomEvent(string customEventName, Vector3 position)
        {
            bool flag = string.IsNullOrEmpty(customEventName);

            if (flag)
            {
                throw new ArgumentException("Cannot set custom event name to an empty or null string");
            }
            bool            flag2 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag2)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                CustomEventData customEventData = new CustomEventData(customEventName);
                customEventData.AddDouble("x", (double)Convert.ToDecimal(position.x));
                customEventData.AddDouble("y", (double)Convert.ToDecimal(position.y));
                customEventData.AddDouble("z", (double)Convert.ToDecimal(position.z));
                AnalyticsResult analyticsResult = Analytics.SendCustomEvent(customEventData);
                customEventData.Dispose();
                result = analyticsResult;
            }
            return(result);
        }
Ejemplo n.º 3
0
        public static AnalyticsResult CustomEvent(string customEventName, Vector3 position)
        {
            if (string.IsNullOrEmpty(customEventName))
            {
                throw new ArgumentException("Cannot set custom event name to an empty or null string");
            }
            if (!IsInitialized())
            {
                return(AnalyticsResult.NotInitialized);
            }
            CustomEventData customEvent = new CustomEventData(customEventName);

            customEvent.AddDouble("x", (double)System.Convert.ToDecimal(position.x));
            customEvent.AddDouble("y", (double)System.Convert.ToDecimal(position.y));
            customEvent.AddDouble("z", (double)System.Convert.ToDecimal(position.z));
            var result = SendCustomEvent(customEvent);

            customEvent.Dispose();
            return(result);
        }
Ejemplo n.º 4
0
        public static AnalyticsResult CustomEvent(string customEventName, IDictionary <string, object> eventData)
        {
            bool flag = string.IsNullOrEmpty(customEventName);

            if (flag)
            {
                throw new ArgumentException("Cannot set custom event name to an empty or null string");
            }
            bool            flag2 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag2)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                bool flag3 = eventData == null;
                if (flag3)
                {
                    result = Analytics.SendCustomEventName(customEventName);
                }
                else
                {
                    CustomEventData customEventData = new CustomEventData(customEventName);
                    AnalyticsResult analyticsResult = AnalyticsResult.InvalidData;
                    try
                    {
                        customEventData.AddDictionary(eventData);
                        analyticsResult = Analytics.SendCustomEvent(customEventData);
                    }
                    finally
                    {
                        customEventData.Dispose();
                    }
                    result = analyticsResult;
                }
            }
            return(result);
        }