public override MyGraphic Clone() { CompositeGraphic cg = new CompositeGraphic(backgroundmode); cg.isVisible = this.isVisible; foreach (_graphicpos gp in _list) { MyGraphic g = gp.g.Clone(); cg.Add(g, gp.left, gp.top); } cg.Width = this.Width; cg.Height = this.Height; cg.isCombined = this.isCombined; cg.isTemporary = this.isTemporary; return(cg); }
/// <summary> /// 这个辅助函数用来删掉一个子graphic /// </summary> public void Remove(MyGraphic g) { _graphicpos mgp = null; foreach (_graphicpos gp in _list) { if (gp.g == g) { mgp = gp; break; } } if (mgp != null) { _list.Remove(mgp); } }
public override void Add(MyGraphic g, double left = 0.0f, double top = 0.0f) { g.Father = this; _list.Add(new _graphicpos(g, left, top)); _currentindex = -1; }
public _graphicpos(MyGraphic _g, double _left, double _top) { g = _g; left = _left; top = _top; }