コード例 #1
0
    public CompositionDrawList Clone()
    {
        var clone = new CompositionDrawList(Count)
        {
            Size = Size
        };

        foreach (var r in this)
        {
            clone.Add(r.Clone());
        }
        return(clone);
    }
コード例 #2
0
    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;
    }