public void Insert(ScLayer pevLayer, ScLayer childLayer) { int idx = 0; for (int i = 0; i < controls.Count(); i++) { if (controls[i] == pevLayer) { idx = i; break; } } childLayer.parent = this; controls.Insert(idx, childLayer); childLayer.CreateContextRelationInfo(); if (suspendLayoutCount == 0) { childLayer.Layout(); } if (childLayer.ShadowLayer != null) { Insert(childLayer, childLayer.ShadowLayer); } }
public void Add(ScLayer childLayer) { if (childLayer == null) { return; } if (childLayer.ShadowLayer != null) { Add(childLayer.ShadowLayer); } childLayer.parent = this; controls.Add(childLayer); childLayer.CreateContextRelationInfo(); if (suspendLayoutCount == 0) { childLayer.Layout(); } }