internal NetworkList(PPResource resource) : base(PassRef.PassRef, resource) { Count = PPBNetworkList.GetCount(this); for (uint x = 0; x < Count; x++) { interfaces.Add(new NetworkInterface(this, x)); } }
internal NetworkInterface(PPResource networkList, uint index) { Name = ((Var)PPBNetworkList.GetName(networkList, index)).AsString(); DisplayName = ((Var)PPBNetworkList.GetDisplayName(networkList, index)).AsString(); State = (NetworkInterfaceState)PPBNetworkList.GetState(networkList, index); NetworkType = (NetworkInterfaceType)PPBNetworkList.GetType(networkList, index); MTU = PPBNetworkList.GetMTU(networkList, index); using (var varIPAddresses = new VarArray()) { var IPAddresses = new ArrayOutputAdapterWithStorage <PPResource []> (); var result = (PPError)PPBNetworkList.GetIpAddresses(networkList, index, (PPArrayOutput)IPAddresses.Adapter); if (result == PPError.Ok) { var length = IPAddresses.Output.Length; for (uint j = 0; j < IPAddresses.Output.Length; ++j) { ipAddress.Add(new NetAddress(IPAddresses.Output [j])); } } } }