예제 #1
0
        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));
            }
        }
예제 #2
0
        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}");
            }
        }