Created
July 19, 2017 14:13
-
-
Save hishaamn/87103c7b0cbab50004f85e05fd086783 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 TrackingProcessor | |
| { | |
| public static void ProcessProfiles(CurrentInteraction interaction, TrackingField field) | |
| { | |
| Assert.ArgumentNotNull(interaction, "interaction"); | |
| Assert.ArgumentNotNull(field, "field"); | |
| foreach (var profile1 in field.Profiles) | |
| { | |
| if (profile1.Name.Equals("Your Profile Name Here")) | |
| { | |
| continue; | |
| } | |
| var contentProfile = profile1; | |
| if (contentProfile.IsSavedInField) | |
| { | |
| var key = contentProfile.Key; | |
| if (!string.IsNullOrEmpty(key)) | |
| { | |
| var profile = interaction.Profiles[key]; | |
| profile.Score(contentProfile); | |
| TrackerEvents.OnCurrentPageCancelled += ((sender, args) => | |
| { | |
| profile.RollBackScore(contentProfile); | |
| if (profile.Count != 0) | |
| { | |
| return; | |
| } | |
| interaction.Profiles.Remove(profile.ProfileName); | |
| }); | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment