public bool RestartInterfaces() { GCInterfaceCollection list = QueryInterfaceList(true); if (list == null) { return(false); } foreach (GCInterface i in list) { if (i.Status == AdapterStatus.Running) { if (!StopInterface(i)) { return(false); } if (!StartInterface(i)) { return(false); } } } return(true); }
public GCInterfaceCollection Copy() { GCInterfaceCollection clone = new GCInterfaceCollection(); foreach (GCInterface c in List) { clone.Add(c); } return(clone); }
private GCInterfaceCollection GetInterfaceList(DObjectCollection dlist, bool withStatus) { GCInterfaceCollection ilist = new GCInterfaceCollection(); foreach (InterfaceRec r in dlist) { GCInterface i = new GCInterface(r); ilist.Add(i); if (withStatus) { i.Status = ServiceControl.GetServiceStatus(i.InterfaceName); } } return(ilist); }