Example #1
0
 private ProfileUpdate GetProfileUpdate1()
 {
     ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Set);
     pu.IP = "123.123.123.123";
     pu.OperationValues["Address"] = "1313 Mockingbird Lane";
     pu.OperationValues["Birthday"] = "1948-01-01";
     return pu;
 }
Example #2
0
            /// <summary>
            /// Contains the specified profile update to the local store.
            /// </summary>
            /// <param name="profileUpdate">The profile update.</param>
            /// <exception cref="System.ArgumentNullException">profileUpdate</exception>
            public bool Contains(ProfileUpdate profileUpdate)
            {
                if (profileUpdate == null)
                {
                    throw new ArgumentNullException("profileUpdate");
                }

                return(ProfileUpdates.Contains(profileUpdate));
            }
Example #3
0
            /// <summary>
            /// Adds the specified profile update to the local store.
            /// </summary>
            /// <param name="profileUpdate">The profile update.</param>
            /// <exception cref="System.ArgumentNullException">profileUpdate</exception>
            public void Add(ProfileUpdate profileUpdate)
            {
                if (profileUpdate == null)
                {
                    throw new ArgumentNullException("profileUpdate");
                }

                ProfileUpdates.Add(profileUpdate);
            }
Example #4
0
            /// <summary>
            /// Determines whether the store contains the specified entity.
            /// </summary>
            /// <param name="entity">The entity.</param>
            /// <returns></returns>
            /// <exception cref="System.ArgumentNullException">entity</exception>
            public bool Contains(MixpanelEntity entity)
            {
                if (entity == null)
                {
                    throw new ArgumentNullException("entity");
                }

                ProfileUpdate profileUpdate = entity as ProfileUpdate;

                if (profileUpdate != null)
                {
                    return(Contains(profileUpdate));
                }

                TrackingEvent trackingEvent = entity as TrackingEvent;

                if (trackingEvent != null)
                {
                    return(Contains(trackingEvent));
                }

                return(false);
            }
Example #5
0
            /// <summary>
            /// Adds the specified entity to the local store.
            /// </summary>
            /// <param name="entity">The entity.</param>
            /// <exception cref="System.ArgumentNullException">entity</exception>
            public void Add(MixpanelEntity entity)
            {
                if (entity == null)
                {
                    throw new ArgumentNullException("entity");
                }

                ProfileUpdate profileUpdate = entity as ProfileUpdate;

                if (profileUpdate != null)
                {
                    Add(profileUpdate);
                    return;
                }

                TrackingEvent trackingEvent = entity as TrackingEvent;

                if (trackingEvent != null)
                {
                    Add(trackingEvent);
                    return;
                }
            }
Example #6
0
 private ProfileUpdate GetRevenueTracking()
 {
     ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Append);
     Dictionary<string, object> transactions = new Dictionary<string, object>();
     transactions["$time"] = "2013-01-03T09:00:00";
     transactions["$amount"] = 25.34f;
     pu.OperationValues["$transactions"] = transactions;
     return pu;
 }
Example #7
0
 private ProfileUpdate GetProfileUpdate7()
 {
     ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Delete);
     return pu;
 }
Example #8
0
 private ProfileUpdate GetProfileUpdate6()
 {
     ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Unset);
     pu.UnsetValueList = new List<string>() { "Days overdue" };
     return pu;
 }
Example #9
0
 private ProfileUpdate GetProfileUpdate5()
 {
     ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Union);
     pu.OperationValues["Items purchased"] = new List<string>() { "socks", "shirts" };
     return pu;
 }
Example #10
0
 private ProfileUpdate GetProfileUpdate4()
 {
     ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Append);
     pu.OperationValues["Power Ups"] = "Bubble Lead";
     return pu;
 }
Example #11
0
 private ProfileUpdate GetProfileUpdate3()
 {
     ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.Add);
     pu.OperationValues["Coins gathered"] = 12;
     return pu;
 }
Example #12
0
 private ProfileUpdate GetProfileUpdate2()
 {
     ProfileUpdate pu = new ProfileUpdate(Token, "13793", ProfileUpdateOperation.SetOnce);
     pu.OperationValues["First login date"] = MixpanelClient.ConvertToMixpanelDate(DateTime.Now);
     return pu;
 }