/// <summary> /// Removes a layer from the child layer list /// </summary> /// <param name="layer">Layer to be removed.</param> public virtual void Remove(RenderableObject layer) { lock (this.m_children.SyncRoot) { this.m_children.Remove(layer); layer.Dispose(); layer.ParentList = null; } }
//删除所有的子图层。 public virtual void RemoveAll() { try { while (m_children.Count > 0) { RenderableObject ro = (RenderableObject)m_children[0]; m_children.RemoveAt(0); ro.Dispose(); } } catch {} }
/// <summary> /// Removes a layer from the child layer list /// </summary> /// <param name="objectName">Name of object to remove</param> public virtual void Remove(string objectName) { lock (this.m_children.SyncRoot) { for (int i = 0; i < this.m_children.Count; i++) { RenderableObject ro = (RenderableObject)this.m_children[i]; if (ro.Name.Equals(objectName)) { this.m_children.RemoveAt(i); ro.Dispose(); ro.ParentList = null; break; } } } }