Pchp.Library.Locale.GetFirstExistingCulture C# (CSharp) Method

GetFirstExistingCulture() private static method

Searches in given objects for a locale string describing an existing culture.
private static GetFirstExistingCulture ( Context ctx, object locale, object moreLocales, CultureInfo &culture ) : bool
ctx Pchp.Core.Context Current runtime context.
locale object Contains either an instance of containing locales or a locale.
moreLocales object If is not of type contains locales, ignored otherwise.
culture System.Globalization.CultureInfo The resulting culture. A null reference means no culture has been found.
return bool
        private static bool GetFirstExistingCulture(Context ctx, object locale, object[] moreLocales, out CultureInfo culture)
        {
            //PhpArray array;
            //IEnumerator locales;
            //culture = null;

            //if ((array = locale as PhpArray) != null)
            //{
            //    // locales are stored in the "locale" array:
            //    locales = array.GetEnumerator();
            //    locales.MoveNext();
            //    locale = locales.Current;
            //}
            //else if (moreLocales != null)
            //{
            //    // locales are stored in the "locale" and "moreLocales":
            //    locales = moreLocales.GetEnumerator();
            //}
            //else
            //{
            //    throw new ArgumentNullException("moreLocales");
            //}

            //// enumerates locales and finds out the first which is valid:
            //for (;;)
            //{
            //    string name = (locale != null) ? Core.Convert.ObjectToString(locale) : null;

            //    culture = GetCultureByName(name);

            //    // name is "empty" then the current culture is not changed:
            //    if (name == null || name == "0") return false;

            //    // if culture exists and is specific then finish searching:
            //    if (culture != null) return true;

            //    // the next locale:
            //    if (!locales.MoveNext()) return false;

            //    locale = locales.Current;
            //}
            throw new NotImplementedException();
        }