public PlivoElement Add(PlivoElement element) { int posn = Nestables.FindIndex(n => n == element.GetType().Name); if (posn >= 0) { Element.Add(element.Element); return(element); } else { throw new PlivoException(String.Format("Element {0} cannot be nested within {1}", element.GetType().Name, this.GetType().Name)); } }
public PlivoElement Add(PlivoElement element) { int posn = Nestables.FindIndex(n => n == element.GetType().Name); if (posn >= 0) { Element.Add(element.Element); return(element); } else { throw new PlivoXMLException( $"Element {element.GetType().Name} cannot be nested within {GetType().Name}"); } }