Exemple #1
0
        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);
        }
Exemple #2
0
        public GCInterfaceCollection Copy()
        {
            GCInterfaceCollection clone = new GCInterfaceCollection();

            foreach (GCInterface c in List)
            {
                clone.Add(c);
            }

            return(clone);
        }
Exemple #3
0
        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);
        }