示例#1
0
文件: ScLayer.cs 项目: zanderzhg/Sc
        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);
            }
        }
示例#2
0
文件: ScLayer.cs 项目: zanderzhg/Sc
        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();
            }
        }