/// <summary> /// Adds the specified web server. /// </summary> /// <param name="WebServer">The web server.</param> public void Add(IISWebServer WebServer) { try { this.List.Add(WebServer); IISManagement.CreateIISWebServer(WebServer); } catch { throw (new Exception("发生意外错误,可能是某节点将该节点的上级节点作为它自己的子级插入")); } }
/// <summary> /// Removes the specified web server. /// </summary> /// <param name="WebServer">The web server.</param> public void Remove(IISWebServer WebServer) { for (int i = 0; i < this.List.Count; i++) { if ((IISWebServer)this.List[i] == WebServer) { this.List.RemoveAt(i); return; } } IISManagement.RemoveIISWebServer(WebServer.index); }
/// <summary> /// Removes the specified web virtual dir. /// </summary> /// <param name="WebVirtualDir">The web virtual dir.</param> public void Remove(IISWebVirtualDir WebVirtualDir) { for (int i = 0; i < this.List.Count; i++) { if ((IISWebVirtualDir)this.List[i] == WebVirtualDir) { this.List.RemoveAt(i); IISManagement.RemoveIISWebVirtualDir(WebVirtualDir); return; } } }
/// <summary> /// Adds the specified web virtual dir. /// </summary> /// <param name="WebVirtualDir">The web virtual dir.</param> public void Add(IISWebVirtualDir WebVirtualDir) { WebVirtualDir.Parent = this.Parent; try { this.List.Add(WebVirtualDir); } catch { throw (new Exception("发生意外错误,可能是某节点将该节点的上级节点作为它自己的子级插入")); } IISManagement.CreateIISWebVirtualDir(WebVirtualDir, true); }
/// <summary> /// 把基本信息的更改更新到IIS /// </summary> public void CommitChanges() { IISManagement.EditIISWebServer(this); }