Exemple #1
0
        public void ValidationDetectsIncompleteResults_NoOpenProfileEvent()
        {
            // there is just close event, but no opening one
            var profileEvent = new ProfileEvent(ProfileEventType.Close, 1, 1.0f, 1);

            Assert.False(Validate(new [] { profileEvent }));
        }
Exemple #2
0
        public void ValidationDetectsIncompleteResults_DifferentFrameIds()
        {
            var openEvent  = new ProfileEvent(ProfileEventType.Open, frameId: 1, 1.0f, 1);
            var closeEvent = new ProfileEvent(ProfileEventType.Close, frameId: openEvent.FrameId + 1, 1.0f, 1);

            Assert.False(Validate(new[] { openEvent, closeEvent }));
        }
Exemple #3
0
 public CallbackData(IPrincipal principal, ProfileEvent profileEvent, Type type, string member)
 {
     Principal    = principal;
     ProfileEvent = profileEvent;
     Type         = type;
     Member       = member;
 }
Exemple #4
0
        public void ValidationDetectsIncompleteResults_InvalidTimeOrder()
        {
            var openEvent  = new ProfileEvent(ProfileEventType.Open, frameId: 1, 2.0f, depth: 1);
            var closeEvent = new ProfileEvent(ProfileEventType.Close, frameId: 1, 1.0f, depth: 1);

            Assert.False(Validate(new[] { openEvent, closeEvent })); // close and then open
        }
Exemple #5
0
        public void ValidationAllowsForCompleteResults()
        {
            var openEvent  = new ProfileEvent(ProfileEventType.Open, frameId: 1, 1.0f, depth: 1);
            var closeEvent = new ProfileEvent(ProfileEventType.Close, frameId: 1, 1.0f, depth: 1);

            Assert.True(Validate(new[] { openEvent, closeEvent }));
        }
        public async Task <bool> Consume(string message)
        {
            ProfileEvent profileEvent = JsonConvert.DeserializeObject <ProfileEvent>(message);

            if (profileEvent == null)
            {
                return(false);
            }

            Domain.Entities.Profile profile = await _context.Profiles.FindAsync(profileEvent.Id);

            if (profile == null)
            {
                Domain.Entities.Profile newProfile = new Domain.Entities.Profile
                {
                    Id          = profileEvent.Id,
                    DisplayName = profileEvent.DisplayName,
                    Avatar      = profileEvent.Avatar
                };

                _context.Profiles.Add(newProfile);
                return(await _context.SaveChangesAsync() > 0);
            }
            return(false);
        }
Exemple #7
0
        public void ValidationDetectsIncompleteResults_DifferentDepths()
        {
            var openEvent  = new ProfileEvent(ProfileEventType.Open, 1, 1.0f, depth: 1);
            var closeEvent = new ProfileEvent(ProfileEventType.Close, 1, 1.0f, depth: openEvent.Depth + 1);

            Assert.False(Validate(new[] { openEvent, closeEvent }));
        }
Exemple #8
0
 /// <summary>
 /// Same as BFREvents except that if BFREvents is null it hits the database first.
 /// </summary>
 private ProfileEvent[] CachedBFREvents()
 {
     if (BFREvents == null)
     {
         BFREvents = ProfileEvent.GetBFREvents(CurrentUser.UserName, LastBFREvent);
     }
     return(BFREvents);
 }
        internal void OnProfileUpdate(ProfileEvent profile)
        {
            var stats = profile.Stats;

            Exp      = stats.FirstOrDefault(x => x.Experience > 0).Experience;
            LevelExp = stats.FirstOrDefault(x => x.NextLevelXp > 0).NextLevelXp;

            this.playerProfile = profile.Profile;
        }
        internal static ProfileEvent ToDomainModel(this ProfileEventEntity profileEventEntity)
        {
            ProfileEvent profileEvent = new ProfileEvent
            {
                Id      = profileEventEntity.Id,
                Trigger = profileEventEntity.Trigger.ToDomainModel()
            };

            return(profileEvent);
        }
        public Profile(string name, Action <string, bool, uint> callback)
        {
            profileName     = name;
            profileCallback = callback;
            ProfileEvent profileEventDelegate = profileEventCallback;

            IntPtr eptr = Marshal.GetFunctionPointerForDelegate(profileEventDelegate);

            ahkThread.LoadFile("ProfileThread.ahk");
            ahkThread.Eval(String.Format("ph := new ProfileHandler({0})", eptr));
        }
        internal static ProfileEventEntity ToEntity(this ProfileEvent profileEvent)
        {
            ProfileEventEntity profileEventEntity = new ProfileEventEntity
            {
                Id      = profileEvent.Id,
                Trigger = profileEvent.Trigger.ToEntity(),
                Action  = profileEvent.Action.ToEntity()
            };

            return(profileEventEntity);
        }
Exemple #13
0
        public async Task UpdateProfileWhileProfileDoesNotExists()
        {
            var profileEvent = new ProfileEvent
            {
                Id          = new Guid(),
                DisplayName = "Roger",
                Avatar      = "Test.png"
            };
            var success = await _updateProfileHandler.Consume(JsonConvert.SerializeObject(profileEvent));

            Assert.False(success);
        }
Exemple #14
0
        public void OnBotEvent(ProfileEvent profile)
        {
            var stats = profile.Stats;

            this.datacontext.PlayerInfo.OnProfileUpdate(profile);

            this.datacontext.UI.PlayerStatus = "Playing";
            this.datacontext.UI.PlayerName   = profile.Profile.PlayerData.Username;

            this.datacontext.RaisePropertyChanged("UI");

            lblAccount.Content = $"{this.datacontext.UI.PlayerStatus} as : {this.datacontext.UI.PlayerName}";
        }
        public async Task CreateProfileWhileProfileExists()
        {
            var profileEvent = new ProfileEvent
            {
                Id          = TestProfile1.Id,
                DisplayName = TestProfile1.DisplayName,
                Avatar      = TestProfile1.Avatar
            };

            var success = await _createProfileHandler.Consume(JsonConvert.SerializeObject(profileEvent));

            Assert.False(success);
        }
Exemple #16
0
        internal void OnProfileUpdate(ProfileEvent profile)
        {
            var stats       = profile.Stats;
            var playerStats = stats.FirstOrDefault(x => x.Experience > 0);

            if (playerStats != null)
            {
                Exp      = playerStats.Experience;
                LevelExp = playerStats.NextLevelXp;
            }

            this.playerProfile = profile.Profile;
        }
Exemple #17
0
        public void HandleEvent(ProfileEvent evt, ISession session)
        {
            Logger.Write(session.Translation.GetTranslation(TranslationString.EventProfileLogin,
                                                            evt.Profile.PlayerData.Username ?? ""), session: session);
            var playerData = session.Profile?.PlayerData;

            if (playerData == null)
            {
                return;
            }
            Logger.PushToUi("profile_data", session, playerData.Username,
                            playerData.MaxItemStorage, playerData.MaxPokemonStorage,
                            playerData.Currencies[0].Amount, playerData.Team, playerData.Currencies[1].Amount);
        }
        private static void TestDecorateFacet <TFacet, TResult>(ProfileEvent eventToTest) where TFacet : class, IFacet
        {
            var config  = new Mock <IProfileConfiguration>();
            var auditor = new Mock <IProfiler>();

            config.Setup(c => c.Profiler).Returns(auditor.Object.GetType());
            config.Setup(c => c.EventsToProfile).Returns(new HashSet <ProfileEvent> {
                eventToTest
            });

            var manager = new ProfileManager(config.Object);

            TestDecorated <TFacet, TResult>(manager);
        }
Exemple #19
0
        public async Task UpdateProfileWhileProfileExists()
        {
            var profile = TestProfile1;

            profile.DisplayName = "John Doe";

            var profileEvent = new ProfileEvent
            {
                Id = TestProfile1.Id, Avatar = TestProfile1.Avatar, DisplayName = "John Doe"
            };

            var success = await _updateProfileHandler.Consume(JsonConvert.SerializeObject(profileEvent));

            Assert.True(success);
            Assert.AreEqual("John Doe", TestProfile1.DisplayName);
        }
    public List <string> Validate()
    {
        List <string> errors = new List <string>();
        // make sure everything pops nicely on and off the stack
        Stack <int> stack = new Stack <int>();

        for (int i = 0; i < Events.Count; i++)
        {
            ProfileEvent e = Events[i];
            if (e.ph == "B")
            {
                stack.Push(i);
            }
            if (e.ph == "E")
            {
                if (stack.Count == 0)
                {
                    errors.Add(string.Format("Ending event {0}, but no events are active", e.Identify));
                }
                else
                {
                    int          startIndex = stack.Peek();
                    ProfileEvent startEvent = Events[startIndex];
                    if (startEvent.name != e.name)
                    {
                        errors.Add(string.Format("Ending event {0}, but event {1} was on the stack", e.Identify, startEvent.Identify));
                    }
                    else
                    {
                        stack.Pop();
                    }
                }
            }
        }

        if (stack.Count != 0)
        {
            string incompleteEvents = string.Join(", ", new List <int>(stack).ConvertAll(i => Events[i].Identify).ToArray());
            errors.Add(string.Format("The follow events where not ended {0}: ", incompleteEvents));
        }

        return(errors);
    }
Exemple #21
0
        public async Task <bool> Consume(string message)
        {
            ProfileEvent profileEvent = JsonConvert.DeserializeObject <ProfileEvent>(message);

            if (profileEvent == null)
            {
                return(false);
            }

            Domain.Entities.Profile profile = await _context.Profile.FindAsync(profileEvent.Id);

            if (profile != null)
            {
                profile.Avatar      = profileEvent.Avatar;
                profile.DisplayName = profileEvent.DisplayName;
                _context.Profile.Update(profile);
                return(await _context.SaveChangesAsync() > 0);
            }
            return(false);
        }
Exemple #22
0
        protected static IDictionary <string, object> PilotInfo(Profile pf)
        {
            if (pf == null)
            {
                throw new ArgumentNullException(nameof(pf));
            }

            return(new Dictionary <string, object>
            {
                ["Given Name"] = String.IsNullOrEmpty(pf.UserFirstName) ? string.Empty : pf.UserFirstName,
                ["Family Name"] = String.IsNullOrEmpty(pf.UserLastName) ? string.Empty : pf.UserLastName,
                ["Email"] = String.IsNullOrEmpty(pf.Email) ? string.Empty : pf.Email,
                ["Address"] = String.IsNullOrEmpty(pf.Address) ? string.Empty : pf.Address,
                ["CFICertificate"] = String.IsNullOrEmpty(pf.CFIDisplay) ? string.Empty : pf.CFIDisplay,
                ["Certificate"] = String.IsNullOrEmpty(pf.LicenseDisplay) ? string.Empty : pf.LicenseDisplay,
                ["Last Medical"] = pf.LastMedical.HasValue() ? pf.LastMedical.YMDString() : string.Empty,
                ["Medical Duration (months)"] = pf.LastMedical.HasValue() ? pf.MonthsToMedical.ToString(CultureInfo.InvariantCulture) : string.Empty,
                ["English Proficiency"] = pf.EnglishProficiencyExpiration.HasValue() ? pf.EnglishProficiencyExpiration.YMDString() : string.Empty,
                ["Flight Reviews"] = ProfileEvent.AsPublicList(ProfileEvent.GetBFREvents(pf.UserName, pf.LastBFREvent)),
                ["IPCs"] = ProfileEvent.AsPublicList(ProfileEvent.GetIPCEvents(pf.UserName)),
                ["Ratings"] = new Achievements.UserRatings(pf.UserName).AsKeyValuePairs()
            });
        }
 public void End(ISession session, ProfileEvent profileEvent, string member, INakedObjectAdapter nakedObjectAdapter, ILifecycleManager lifecycleManager)
 {
     GetProfiler(lifecycleManager).End(session.Principal, profileEvent, nakedObjectAdapter.GetDomainObject().GetType(), member);
 }
 public ProfileCallbackFacet(ProfileEvent associatedEvent, ICallbackFacet underlyingFacet, IProfileManager profileManager) : base(underlyingFacet.FacetType, underlyingFacet.Specification)
 {
     this.associatedEvent = associatedEvent;
     this.underlyingFacet = underlyingFacet;
     this.profileManager  = profileManager;
 }
Exemple #25
0
        private void broadcastUserVariables(User user, ArrayList changedVars = null)
        {
            bool flag = getSessionId(user) == mt.ClubPenguinClient.PlayerSessionId;

            if (!flag && (changedVars == null || changedVars.Contains(SocketUserVars.PROTOTYPE.GetKey())) && user.ContainsVariable(SocketUserVars.PROTOTYPE.GetKey()))
            {
                PrototypeState prototypeState = default(PrototypeState);
                prototypeState.id   = getSessionId(user);
                prototypeState.data = JsonMapper.ToObject(user.GetVariable(SocketUserVars.PROTOTYPE.GetKey()).GetStringValue());
                mt.triggerEvent(GameServerEvent.PROTOTYPE_STATE, prototypeState);
            }
            if (changedVars == null || changedVars.Contains(SocketUserVars.EQUIPPED_OBJECT.GetKey()))
            {
                UserVariable variable  = user.GetVariable(SocketUserVars.EQUIPPED_OBJECT.GetKey());
                UserVariable variable2 = user.GetVariable(SocketUserVars.EQUIPPED_OBJECT_PROPERTIES.GetKey());
                if (variable == null)
                {
                    if (changedVars != null && changedVars.Contains(SocketUserVars.EQUIPPED_OBJECT_PROPERTIES.GetKey()) && variable2 == null)
                    {
                        mt.triggerEvent(GameServerEvent.SERVER_ITEM_REMOVED, new CPMMOItemId(getSessionId(user), CPMMOItemId.CPMMOItemParent.PLAYER));
                    }
                    else
                    {
                        mt.triggerEvent(GameServerEvent.HELD_OBJECT_DEQUIPPED, getSessionId(user));
                    }
                }
                else
                {
                    EquippedObject equippedObject = EquippedObject.FromSFSData(variable.GetSFSObjectValue());
                    if (variable2 != null)
                    {
                        PlayerHeldItem playerHeldItem = new PlayerHeldItem();
                        playerHeldItem.Id         = new CPMMOItemId(getSessionId(user), CPMMOItemId.CPMMOItemParent.PLAYER);
                        playerHeldItem.CreatorId  = playerHeldItem.Id.Id;
                        playerHeldItem.Type       = equippedObject.EquippedObjectId;
                        playerHeldItem.Properties = variable2.GetStringValue();
                        mt.triggerEvent(GameServerEvent.SERVER_ITEM_ADDED, playerHeldItem);
                    }
                    else if (!flag || (flag && equippedObject.isPartyGame()))
                    {
                        HeldObjectEvent heldObjectEvent = default(HeldObjectEvent);
                        heldObjectEvent.SessionId = getSessionId(user);
                        heldObjectEvent.Type      = equippedObject.EquippedObjectId;
                        if (equippedObject.IsConsumable())
                        {
                            mt.triggerEvent(GameServerEvent.CONSUMABLE_EQUIPPED, heldObjectEvent);
                        }
                        else if (equippedObject.IsDispensable())
                        {
                            mt.triggerEvent(GameServerEvent.DISPENSABLE_EQUIPPED, heldObjectEvent);
                        }
                        else if (equippedObject.IsDurable())
                        {
                            mt.triggerEvent(GameServerEvent.DURABLE_EQUIPPED, heldObjectEvent);
                        }
                        else if (equippedObject.isPartyGame())
                        {
                            mt.triggerEvent(GameServerEvent.PARTYGAME_EQUIPPED, heldObjectEvent);
                        }
                    }
                }
            }
            else if (changedVars.Contains(SocketUserVars.EQUIPPED_OBJECT_PROPERTIES.GetKey()))
            {
                UserVariable variable3 = user.GetVariable(SocketUserVars.EQUIPPED_OBJECT.GetKey());
                if (variable3 != null && variable3.Type == VariableType.OBJECT)
                {
                    PlayerHeldItem playerHeldItem = new PlayerHeldItem();
                    playerHeldItem.Id         = new CPMMOItemId(getSessionId(user), CPMMOItemId.CPMMOItemParent.PLAYER);
                    playerHeldItem.CreatorId  = playerHeldItem.Id.Id;
                    playerHeldItem.Type       = EquippedObject.FromSFSData(variable3.GetSFSObjectValue()).EquippedObjectId;
                    playerHeldItem.Properties = user.GetVariable(SocketUserVars.EQUIPPED_OBJECT_PROPERTIES.GetKey()).GetStringValue();
                    mt.triggerEvent(GameServerEvent.SERVER_ITEM_CHANGED, playerHeldItem);
                }
            }
            if (!flag && (changedVars == null || changedVars.Contains(SocketUserVars.LOCOMOTION_STATE.GetKey())))
            {
                UserVariable variable4 = user.GetVariable(SocketUserVars.LOCOMOTION_STATE.GetKey());
                PlayerLocomotionStateEvent playerLocomotionStateEvent = default(PlayerLocomotionStateEvent);
                playerLocomotionStateEvent.SessionId = getSessionId(user);
                if (variable4 == null || variable4.IsNull())
                {
                    playerLocomotionStateEvent.State = LocomotionState.Default;
                }
                else
                {
                    playerLocomotionStateEvent.State = (LocomotionState)variable4.GetIntValue();
                }
                mt.triggerEvent(GameServerEvent.USER_LOCO_STATE_CHANGED, playerLocomotionStateEvent);
            }
            if (!flag && (changedVars == null || changedVars.Contains(SocketUserVars.OUTFIT.GetKey())) && user.ContainsVariable(SocketUserVars.OUTFIT.GetKey()))
            {
                PlayerOutfitDetails playerOutfitDetails = mt.JsonService.Deserialize <PlayerOutfitDetails>(user.GetVariable(SocketUserVars.OUTFIT.GetKey()).GetStringValue());
                playerOutfitDetails.sessionId = getSessionId(user);
                mt.triggerEvent(GameServerEvent.USER_OUTFIT_CHANGED, playerOutfitDetails);
            }
            if (!flag && (changedVars == null || changedVars.Contains(SocketUserVars.PROFILE.GetKey())) && user.ContainsVariable(SocketUserVars.PROFILE.GetKey()))
            {
                ProfileEvent profileEvent = default(ProfileEvent);
                profileEvent.SessionId      = getSessionId(user);
                profileEvent.Profile        = new Profile();
                profileEvent.Profile.colour = user.GetVariable(SocketUserVars.PROFILE.GetKey()).GetIntValue();
                mt.triggerEvent(GameServerEvent.USER_PROFILE_CHANGED, profileEvent);
            }
            if (!flag && (changedVars == null || changedVars.Contains(SocketUserVars.AIR_BUBBLE.GetKey())))
            {
                UserVariable         variable5            = user.GetVariable(SocketUserVars.AIR_BUBBLE.GetKey());
                PlayerAirBubbleEvent playerAirBubbleEvent = default(PlayerAirBubbleEvent);
                playerAirBubbleEvent.SessionId = getSessionId(user);
                if (variable5 == null || variable5.IsNull())
                {
                    playerAirBubbleEvent.AirBubble = new AirBubble();
                }
                else
                {
                    playerAirBubbleEvent.AirBubble = AirBubble.FromSFSData(variable5.GetSFSObjectValue());
                }
                mt.triggerEvent(GameServerEvent.AIR_BUBBLE_UPDATE, playerAirBubbleEvent);
            }
            if (!flag && (changedVars == null || changedVars.Contains(SocketUserVars.ON_QUEST.GetKey())))
            {
                UserVariable variable4    = user.GetVariable(SocketUserVars.ON_QUEST.GetKey());
                OnQuestState onQuestState = default(OnQuestState);
                onQuestState.SessionId = getSessionId(user);
                if (!(variable4?.IsNull() ?? true))
                {
                    onQuestState.MascotName = variable4.GetStringValue();
                }
                mt.triggerEvent(GameServerEvent.ON_QUEST, onQuestState);
            }
            if (!flag && (changedVars == null || changedVars.Contains(SocketUserVars.SELECTED_TUBE.GetKey())) && user.ContainsVariable(SocketUserVars.SELECTED_TUBE.GetKey()))
            {
                SelectedTubeEvent selectedTubeEvent = default(SelectedTubeEvent);
                selectedTubeEvent.SessionId = getSessionId(user);
                selectedTubeEvent.TubeId    = user.GetVariable(SocketUserVars.SELECTED_TUBE.GetKey()).GetIntValue();
                mt.triggerEvent(GameServerEvent.SELECTED_TUBE_CHANGED, selectedTubeEvent);
            }
            if (!flag && (changedVars == null || changedVars.Contains(SocketUserVars.TEMPORARY_HEAD_STATUS.GetKey())) && user.ContainsVariable(SocketUserVars.TEMPORARY_HEAD_STATUS.GetKey()))
            {
                TemporaryHeadStatusEvent temporaryHeadStatusEvent = default(TemporaryHeadStatusEvent);
                temporaryHeadStatusEvent.SessionId = getSessionId(user);
                temporaryHeadStatusEvent.Type      = user.GetVariable(SocketUserVars.TEMPORARY_HEAD_STATUS.GetKey()).GetIntValue();
                mt.triggerEvent(GameServerEvent.TEMPORARY_HEAD_STATUS_CHANGED, temporaryHeadStatusEvent);
            }
            if (flag || (changedVars != null && !changedVars.Contains(SocketUserVars.AWAY_FROM_KEYBOARD.GetKey())))
            {
                return;
            }
            UserVariable variable6 = user.GetVariable(SocketUserVars.AWAY_FROM_KEYBOARD.GetKey());

            if (variable6 == null || variable6.IsNull())
            {
                EquippedObject equippedObject2 = null;
                UserVariable   variable7       = user.GetVariable(SocketUserVars.EQUIPPED_OBJECT.GetKey());
                if (variable7 != null)
                {
                    equippedObject2 = EquippedObject.FromSFSData(variable7.GetSFSObjectValue());
                }
                mt.triggerEvent(GameServerEvent.AWAY_FROM_KEYBOARD_STATE_CHANGED, new AFKEvent(getSessionId(user), 0, equippedObject2));
            }
            else
            {
                mt.triggerEvent(GameServerEvent.AWAY_FROM_KEYBOARD_STATE_CHANGED, new AFKEvent(getSessionId(user), variable6.GetIntValue(), null));
            }
        }
    private void onPlayerProfileChanged(GameServerEvent evt, object data)
    {
        ProfileEvent profileEvent = (ProfileEvent)data;

        Service.Get <EventDispatcher>().DispatchEvent(new PlayerStateServiceEvents.PlayerProfileChanged(profileEvent.SessionId, profileEvent.Profile));
    }
Exemple #27
0
 private static void HandleEvent(ProfileEvent profileEvent, ISession session)
 {
     Logger.Write(session.Translation.GetTranslation(TranslationString.EventProfileLogin,
                                                     profileEvent.Profile.PlayerData.Username ?? ""));
 }
 public ProfileCallbackFacet(ProfileEvent associatedEvent, ICallbackFacet underlyingFacet, IProfileManager profileManager) : base(underlyingFacet.FacetType, underlyingFacet.Specification) {
     this.associatedEvent = associatedEvent;
     this.underlyingFacet = underlyingFacet;
     this.profileManager = profileManager;
 }
 private void HandleEvent(ProfileEvent evt)
 {
     _lastProfile = evt;
 }
    private void InitPilotInfo()
    {
        dateMedical.Date = m_pf.LastMedical;
        cmbMonthsMedical.SelectedValue       = m_pf.MonthsToMedical.ToString(CultureInfo.CurrentCulture);
        rblMedicalDurationType.SelectedIndex = m_pf.UsesICAOMedical ? 1 : 0;
        txtCertificate.Text             = m_pf.Certificate;
        txtLicense.Text                 = m_pf.License;
        mfbTypeInDateCFIExpiration.Date = m_pf.CertificateExpiration;
        mfbDateEnglishCheck.Date        = m_pf.EnglishProficiencyExpiration;
        UpdateNextMedical(m_pf);
        BasicMedManager.RefreshBasicMedEvents();

        gvIPC.DataSource = ProfileEvent.GetIPCEvents(User.Identity.Name);
        gvIPC.DataBind();

        MyFlightbook.Achievements.UserRatings ur = new MyFlightbook.Achievements.UserRatings(m_pf.UserName);
        gvRatings.DataSource = ur.Licenses;
        gvRatings.DataBind();

        ProfileEvent[] rgpfeBFR = ProfileEvent.GetBFREvents(User.Identity.Name, m_pf.LastBFREvent);

        gvBFR.DataSource = rgpfeBFR;
        gvBFR.DataBind();

        if (rgpfeBFR.Length > 0) // we have at least one BFR event, so the last one should be the most recent.
        {
            lblNextBFR.Text    = m_pf.NextBFR(rgpfeBFR[rgpfeBFR.Length - 1].Date).ToShortDateString();
            pnlNextBFR.Visible = true;
        }

        string szPane = Request["pane"];

        if (!String.IsNullOrEmpty(szPane))
        {
            for (int i = 0; i < accordianPilotInfo.Panes.Count; i++)
            {
                switch (szPane)
                {
                case "medical":
                    if (accordianPilotInfo.Panes[i] == acpMedical)
                    {
                        accordianPilotInfo.SelectedIndex = i;
                    }
                    break;

                case "certificates":
                    if (accordianPilotInfo.Panes[i] == acpCertificates)
                    {
                        accordianPilotInfo.SelectedIndex = i;
                    }
                    break;

                case "flightreview":
                    if (accordianPilotInfo.Panes[i] == acpFlightReviews)
                    {
                        accordianPilotInfo.SelectedIndex = i;
                    }
                    break;

                case "ipc":
                    if (accordianPilotInfo.Panes[i] == acpIPCs)
                    {
                        accordianPilotInfo.SelectedIndex = i;
                    }
                    break;

                default:
                    break;
                }
            }
        }
    }
Exemple #31
0
 public void HandleEvent(ProfileEvent evt, ISession session)
 {
     _stats.SetUsername(evt.Profile);
     _stats.Dirty(session.Inventory);
     _stats.CheckLevelUp(session);
 }
 public void End(ISession session, ProfileEvent profileEvent, string member, INakedObjectAdapter nakedObjectAdapter, ILifecycleManager lifecycleManager) {
     GetProfiler(lifecycleManager).End(session.Principal, profileEvent, nakedObjectAdapter.GetDomainObject().GetType(), member);
 }