System.Net.NetworkInformation.OsxNetworkInterface.GetOrCreate C# (CSharp) Méthode

GetOrCreate() private static méthode

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

            return oni;
        }