/// <summary> /// Zakończ budowę bieżącego komponentu znajdującego się na stosie oraz zmień kontekst. /// Zmienia kontekst bieżącego komponentu, poprzez zdjęcie aktualnego komponentu ze stosu. /// </summary> /// <remarks> /// Trzeba podać poprawny/zgodny terminator komponentu. /// </remarks> /// <param name="terminator"></param> /// <returns>Zwraca stary kontekst/komponent.</returns> /// <exception cref="System.InvalidOperationException">Jeżeli nieprawidłowy terminator.</exception> private KomponentBase EndTop(KomponentBase terminator) { KontrolerKontekstu.Zapewnij(_aktualneKomponenty.Count > 0, "Nieoczekiwany terminator dokumentu."); KomponentBase top = _aktualneKomponenty.Pop(); //[top != null] top.End(terminator); return(top); }
private void ZapewnijNotNull(KomponentBase komponent) { KontrolerKontekstu.Zapewnij(komponent != null, "Nie można dodać pustego komponentu do rekordu."); }