예제 #1
0
        /// <summary>
        /// Called to perform the action configured in the database.
        /// </summary>
        /// <param name="action"></param>
        /// <param name="data"></param>
        public override void DoAction(Action action, string data)
        {
            if (action.Name == "FocusedAppChanged")
            {
                // display current focus app
                if (sessionManager.ActiveSession != null)
                {
                    IHostedApplication3 FocusedApp = (sessionManager.ActiveSession.FocusedApplication as IHostedApplication3);

                    if (FocusedApp != null && FocusedApp.IsListed)
                    {
                        lblCurrApp.Text = FocusedApp.ApplicationName;
                    }
                    // Case of a global open dynamic application which was just closed
                    if (FocusedApp == null)
                    {
                        ClearLabels();
                    }
                }
            }
            else if (action.Name == "LoadAllSessions")
            {
                // load all session into combobox
                LoadAllSessions();
            }
            else if (action.Name == "RemoveSession")
            {
                // remove session data from UI
                RemoveSession(data);
            }
            else if (action.Name == "Show_Hide")
            {
                Show_Hide(data);
            }
        }
예제 #2
0
        /// <summary>
        /// Gets called whenever the context has changed
        /// </summary>
        /// <param name="context"></param>
        public override void NotifyContextChange(Context context)
        {
            if (context.Count != 0)
            {
                lblPhoneNum.Text  = context["Landline"];
                lblFirstName.Text = context["CustomerFirstName"];
                lblLastName.Text  = context["CustomerLastName"];
                lblCust.Text      = String.Format("{0} {1}", context["CustomerFirstName"], context["CustomerLastName"]);
            }

            if (sessionManager != null)
            {
                lblCurrApp.Text = "";

                IHostedApplication3 FocusedApp = (sessionManager.ActiveSession.FocusedApplication as IHostedApplication3);

                if (FocusedApp != null && FocusedApp.IsListed)
                {
                    lblCurrApp.Text = FocusedApp.ApplicationName;
                }

                // Used when session is changed to set the current session
                if (cboSessions.SelectedItem != sessionManager.ActiveSession)
                {
                    cboSessions.SelectedItem = sessionManager.ActiveSession;
                }
            }
        }