Пример #1
0
 public void SetParent(TicketBuilder ticketBuilder)
 {
     if (ticketBuilder == null)
     {
         throw new ArgumentNullException(nameof(ticketBuilder));
     }
     if (ticketBuilder != GetParentTicketBuilder())
     {
         throw new ArgumentException();
     }
     if (ReferenceEquals(ParentTicketBuilder, ticketBuilder))
     {
         return;
     }
     QuestionBuilder[] questionBuilders = ticketBuilder.SortedQuestionBuilders.ToArray();
     ParentQuestionGroupBuilder?.questionGroupBuilders.Remove(this);
     ParentTicketBuilder?.RemoveQuestionGroup(this);
     ticketBuilder.AddQuestionGroup(this);
     ticketBuilder.SetNumeration(questionBuilders);
 }