internal void CheckCurrentProfileBehavior(bool forceUpdate=false)
{
if (forceUpdate || DateTime.Now.Subtract(LastProfileBehaviorCheck).TotalMilliseconds > 250)
{
LastProfileBehaviorCheck = DateTime.Now;
if ((currentProfileBehavior == null && ProfileManager.CurrentProfileBehavior != null && ProfileManager.CurrentProfileBehavior.Behavior != null)
|| (ProfileManager.CurrentProfileBehavior != null && ProfileManager.CurrentProfileBehavior.Behavior != null && currentProfileBehavior != null && currentProfileBehavior.Behavior.Guid != ProfileManager.CurrentProfileBehavior.Behavior.Guid))
{
currentProfileBehavior = ProfileManager.CurrentProfileBehavior;
Logger.Write(LogLevel.Event, "Profile Behavior Changed To {0} [{1}]", currentProfileBehavior.GetType().ToString(), currentProfileBehavior.StatusText);
Type profileTagType = currentProfileBehavior.GetType();
PreviousProfileBehaviorType = CurrentProfileBehaviorType;
CurrentProfileBehaviorType = GetProfileBehaviorType(profileTagType);
if (OnProfileBehaviorChange != null)
OnProfileBehaviorChange(CurrentProfileBehaviorType);
}
}
}