Beispiel #1
0
 public void Unload(string serviceName, MultilanguageCallback callback)
 {
     if (services.ContainsKey(serviceName) == true)
     {
         services.Remove(serviceName);
         callback(MultilanguageResultCode.SUCCESS, null);
     }
     else
     {
         callback(MultilanguageResultCode.NOT_LOADED, null);
     }
 }
Beispiel #2
0
        public void SelectLangaugeByCode(string serviceName, string languageCode, MultilanguageCallback callback)
        {
            MultilanguageServiceData service;

            if (services.TryGetValue(serviceName, out service) == true)
            {
                MultilanguageResultCode resultCode = service.SelectLanguage(languageCode);
                callback(resultCode, null);
            }
            else
            {
                callback(MultilanguageResultCode.SERVICE_NOT_FOUND, null);
            }
        }
Beispiel #3
0
        public void Load(string serviceName, string languagePath, MultilanguageCallback callback)
        {
            if (services.ContainsKey(serviceName) == true)
            {
                callback(MultilanguageResultCode.ALREADY_LOADED, null);
                return;
            }

            loader.Load(
                languagePath,
                (resultCode, xmlData, messageInfo) =>
            {
                callback(InitializeService(serviceName, resultCode, xmlData), messageInfo);
            });
        }
Beispiel #4
0
        public void SelectLanguageByNativeName(string serviceName, string nativeName, MultilanguageCallback callback)
        {
            string languageCode = GetLanguageCodeByNativeName(nativeName);

            if (string.IsNullOrEmpty(languageCode) == true)
            {
                languageCode = nativeName;
            }

            SelectLangaugeByCode(serviceName, languageCode, callback);
        }
 public static void Load(string serviceName, string filepath, MultilanguageCallback callback)
 {
     MultilanguageImplementation.Instance.Load(serviceName, filepath, callback);
 }
 public static void SelectLanguageByNativeName(string serviceName, string natvieName, MultilanguageCallback callback)
 {
     MultilanguageImplementation.Instance.SelectLanguageByNativeName(serviceName, natvieName, callback);
 }
 public static void SelectLanguageByCode(string serviceName, string languageCode, MultilanguageCallback callback)
 {
     MultilanguageImplementation.Instance.SelectLangaugeByCode(serviceName, languageCode, callback);
 }
 public static void Unload(string serviceName, MultilanguageCallback callback)
 {
     MultilanguageImplementation.Instance.Unload(serviceName, callback);
 }