Beispiel #1
0
        /// <summary>
        /// Raises the RefreshRequired event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected void OnSelectNextPreviousInstance(SelectNextPreviousInstanceEventArgs eventArgs)
        {
            EventHandler <SelectNextPreviousInstanceEventArgs> handler = SelectNextPreviousInstance;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
 /// <summary>
 /// Event raised when the previous instance needs to be selected.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">SelectNextPreviousInstanceArgs arguments.</param>
 private void HandleSelectPreviousInstance(object sender, SelectNextPreviousInstanceEventArgs e)
 {
     // Propagates the event
     OnSelectNextPreviousInstance(e);
 }
        /// <summary>
        /// Raises the RefreshRequired event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected void OnSelectNextPreviousInstance(SelectNextPreviousInstanceEventArgs eventArgs)
        {
            EventHandler<SelectNextPreviousInstanceEventArgs> handler = SelectNextPreviousInstance;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
        /// <summary>
        /// Select the next or previous intance in the population.
        /// </summary>
        /// <param name="goToNext"></param>
        private void Execute_GoNextPrevious(bool goToNext)
        {
            // Move next or previous instance.
            SelectNextPreviousInstanceEventArgs arguments = new SelectNextPreviousInstanceEventArgs(Context.ExchangeInformation.SelectedOids[0], false, goToNext);
            if (goToNext)
            {
                OnSelectNextInstance(arguments);
            }
            else
            {
                OnSelectPreviousInstance(arguments);
            }

            // If no previous instace, close scenario and exit.
            if (arguments.NewSelectedInstance == null)
            {
                // Disable-Enable Next-Previous buttons.
                PreviousTrigger.Enabled = goToNext;
                NextTrigger.Enabled = !goToNext;
            }
            else
            {
                // Enable Next-Previous buttons.
                if (!PreviousTrigger.Enabled)
                {
                    PreviousTrigger.Enabled = true;
                }

                if (!NextTrigger.Enabled)
                {
                    NextTrigger.Enabled = true;
                }

                // Assign the new received instance to the Exchange info.
                Context.ExchangeInformation.SelectedOids = arguments.NewSelectedInstance;

                // Reinitialize the controller. Starts again.
                Initialize();
            }

            // Enable the Apply and Ok Buttons.
            if (ApplyTrigger != null)
            {
                ApplyTrigger.Enabled = true;
            }
            OkTrigger.Enabled = true;
        }
 /// <summary>
 /// Handles the Action Item SelectNextPrevious Event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionItemSelectNextPreviousInstance(object sender, SelectNextPreviousInstanceEventArgs e)
 {
     // Propagate the Event
     OnSelectNextPreviousInstance(e);
 }
Beispiel #6
0
 /// <summary>
 /// Handles the Action Item SelectNextPrevious Event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionItemSelectNextPreviousInstance(object sender, SelectNextPreviousInstanceEventArgs e)
 {
     // Propagate the Event
     OnSelectNextPreviousInstance(e);
 }
 /// <summary>
 /// Event raised when the next instance needs to be selected.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">SelectNextPreviousInstanceArgs arguments.</param>
 private void HandleSelectNextInstance(object sender, SelectNextPreviousInstanceEventArgs e)
 {
     // Propagates the event
     OnSelectNextPreviousInstance(e);
 }
 /// <summary>
 /// Handles the Action SelectNextPrevious event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleActionSelectNextPreviousInstance(object sender, SelectNextPreviousInstanceEventArgs e)
 {
     List<Oid> oidList = null;
     if (e.SelectNext)
     {
         oidList = SelectNextInstance(e.CurrentOid, e.RefreshInstance);
     }
     else
     {
         oidList = SelectPreviousInstance(e.CurrentOid, e.RefreshInstance);
     }
     e.NewSelectedInstance = oidList;
 }