/// <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) { layer.ParentList = null; layer.Dispose(); this.m_children.Remove(layer); } }
/// <summary> /// 删除所有的子图层 /// </summary> public virtual void RemoveAll() { try { while (m_children.Count > 0) { RenderableObject ro = (RenderableObject)m_children[0]; m_children.RemoveAt(0); ro.Dispose(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
/// <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)) { ro.ParentList = null; ro.Dispose(); this.m_children.RemoveAt(i); break; } } } }