public CompositionDrawList Clone() { var clone = new CompositionDrawList(Count) { Size = Size }; foreach (var r in this) { clone.Add(r.Clone()); } return(clone); }
void MakeWritable(int atIndex) { if (_owns) { return; } _owns = true; var newOps = new CompositionDrawList(_operations?.Count ?? Math.Max(1, atIndex)); if (_operations != null) { for (var c = 0; c < atIndex; c++) { newOps.Add(_operations[c].Clone()); } } _operations = newOps; }