System.Data.Common.DBConnectionString.NewRestrictionAllowOnly C# (CSharp) Méthode

NewRestrictionAllowOnly() private static méthode

private static NewRestrictionAllowOnly ( string allowonly, string preventusage ) : string[]
allowonly string
preventusage string
Résultat string[]
        private static string[] NewRestrictionAllowOnly(string[] allowonly, string[] preventusage)
        {
            List<string> newlist = null;
            for (int i = 0; i < allowonly.Length; ++i)
            {
                if (0 > Array.BinarySearch(preventusage, allowonly[i], StringComparer.Ordinal))
                {
                    if (null == newlist)
                    {
                        newlist = new List<string>();
                    }
                    newlist.Add(allowonly[i]);
                }
            }
            string[] restrictionValues = null;
            if (null != newlist)
            {
                restrictionValues = newlist.ToArray();
            }
            Verify(restrictionValues);
            return restrictionValues;
        }