Ejemplo n.º 1
0
 /// <summary>
 /// Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1" />.
 /// </summary>
 /// <param name="item">
 /// The object to add to the <see cref="T:System.Collections.Generic.ICollection`1" />.
 /// </param>
 public void Add(WizardPageBase item)
 {
     if (item != null)
     {
         item.NavigationStateUpdated += WizardPageNavigationStatusUpdateHandler;
         this._wizardPages.Add(new Tuple <WizardPageBase, bool>(item, true));
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes the first occurrence of a specific object from the <see
        /// cref="T:System.Collections.Generic.ICollection`1" />.
        /// </summary>
        /// <param name="item">
        /// The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1" />.
        /// </param>
        /// <returns>
        /// true if <paramref name="item" /> was successfully removed from the <see
        /// cref="T:System.Collections.Generic.ICollection`1" />; otherwise, false. This method also
        /// returns false if <paramref name="item" /> is not found in the original <see
        /// cref="T:System.Collections.Generic.ICollection`1" />.
        /// </returns>
        public bool Remove(WizardPageBase item)
        {
            item.NavigationStateUpdated -= WizardPageNavigationStatusUpdateHandler;
            var removable = this.wizardPages.FirstOrDefault(t => t.Item1 == item);

            if (removable != null)
            {
                return(this.wizardPages.Remove(removable));
            }
            return(false);
        }
Ejemplo n.º 3
0
        private void UpdateButtonState(WizardPageBase wizardPage)
        {
            if (wizardPage != null)
            {
                btnPrevious.Enabled = wizardPage.CanGoPreviousPage && currentPageIndex > 0;
                btnNext.Enabled     = wizardPage.CanGoNextPage && currentPageIndex < this.Count - 1;
                btnFinish.Enabled   = wizardPage.CanGoFinishPage || currentPageIndex == this.Count - 1;
                btnCancel.Enabled   = wizardPage.CanGoCancel;

                UpdateAcceptButton();
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Determines whether the <see cref="T:System.Collections.Generic.ICollection`1" />
 /// contains a specific value.
 /// </summary>
 /// <param name="item">
 /// The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1" />.
 /// </param>
 /// <returns>
 /// true if <paramref name="item" /> is found in the <see
 /// cref="T:System.Collections.Generic.ICollection`1" />; otherwise, false.
 /// </returns>
 public bool Contains(WizardPageBase item)
 {
     return(this.wizardPages.Exists(p => p.Item1 == item));
 }