public void AddTransaction(View viewToBePlaced, Transaction transaction) { if(viewToBePlaced == null) throw new ArgumentNullException("viewToBePlaced"); if(transaction == null) throw new ArgumentNullException("transaction"); _transactions.Add(viewToBePlaced, transaction); }
/// <summary> /// Add a new view to the layout /// </summary> /// <returns><see cref="Marioneta.MRelativeLayout"/></returns> /// <param name="viewToBePlaced">The view to be placed</param> public RelativeBuilder AddView(View viewToBePlaced) { if (viewToBePlaced == null) throw new ArgumentNullException("viewToBePlaced"); var isDuplicated = _transactionManager.ContainsTransaction(viewToBePlaced); if (isDuplicated) { throw new DuplicatedViewException("MRelativeLayout.AddView() -- This view already exists"); } var newTransaction = new Transaction(); _transactionManager.AddTransaction(viewToBePlaced, newTransaction); ChangeContext(viewToBePlaced); return this; }