System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate C# (CSharp) Method

GetOrCreate() private static method

Gets or creates a LinuxNetworkInterface, based on whether it already exists in the given Dictionary. If created, it is added to the Dictionary.
private static GetOrCreate ( LinuxNetworkInterface>.Dictionary interfaces, string name ) : LinuxNetworkInterface
interfaces LinuxNetworkInterface>.Dictionary The Dictionary of existing interfaces.
name string The name of the interface.
return LinuxNetworkInterface
        private static LinuxNetworkInterface GetOrCreate(Dictionary<string, LinuxNetworkInterface> interfaces, string name)
        {
            LinuxNetworkInterface lni;
            if (!interfaces.TryGetValue(name, out lni))
            {
                lni = new LinuxNetworkInterface(name);
                interfaces.Add(name, lni);
            }

            return lni;
        }