Esempio n. 1
0
        static CoreLanguageList()
        {
            CoreLanguageList.LanguageList = new List <CoreLanguageClass>();

            CoreLanguageList.Japanese = new CoreLanguageClass(CoreLanguage.Japanese,
                                                              0, "ja", "Japanese", "日本語");
            CoreLanguageList.English = new CoreLanguageClass(CoreLanguage.English,
                                                             1, "en", "English", "English");

            CoreLanguageList.DefaultLanguage = CoreLanguageList.Japanese;

            CoreLanguageList.LanguageList.Add(CoreLanguageList.Japanese);
            CoreLanguageList.LanguageList.Add(CoreLanguageList.English);
        }
        public MailUser(CsvEntry e)
        {
            this.MailAddress = e[0];
            this.Company     = e[1];
            this.FullName    = e[2];
            this.Language    = CoreLanguageList.GetLanguageClassByName(e[3]);

            if (e.Count >= 5)
            {
                string pStr = e[4];

                this.ParamList = MailUtil.StrToParamList(pStr);
            }

            normalize();
        }
        public static string ProcStr(string str, CoreLanguageClass lang, List <KeyValuePair <string, string> > paramList)
        {
            foreach (KeyValuePair <string, string> p in paramList)
            {
                string tag   = "<$" + p.Key.Trim() + "$>";
                string value = p.Value.Trim();

                str = Str.ReplaceStr(str, tag, value);
            }

            StringBuilder sb = new StringBuilder();

            bool b = false;
            int  i;

            for (i = 0; i < str.Length; i++)
            {
                char c  = str[i];
                bool ok = true;

                if (b == false)
                {
                    if (c == '<' && str[i + 1] == '$')
                    {
                        i++;
                        b  = true;
                        ok = false;
                    }
                }
                else
                {
                    if (c == '$' && str[i + 1] == '>')
                    {
                        i++;
                        b  = false;
                        ok = false;
                    }
                }

                if (b == false && ok == true)
                {
                    sb.Append(c);
                }
            }

            return(sb.ToString());
        }
        public MailUser(string mail, string name, string company, string language, List <KeyValuePair <string, string> > paramList)
        {
            this.MailAddress = mail;
            this.Company     = company;
            this.FullName    = name;
            this.Language    = CoreLanguageList.GetLanguageClassByName(language);
            if (paramList == null)
            {
                this.ParamList = new List <KeyValuePair <string, string> >();
            }
            else
            {
                this.ParamList = paramList;
            }

            normalize();
        }
Esempio n. 5
0
        public static CoreLanguageClass GetCurrentThreadLanguageClass()
        {
            CoreLanguageClass lang = null;

            try
            {
                lang = (CoreLanguageClass)ThreadData.CurrentThreadData["current_thread_language"];
            }
            catch
            {
            }

            if (lang == null)
            {
                lang = CoreLanguageList.DefaultLanguage;

                SetCurrentThreadLanguageClass(lang);
            }

            return(lang);
        }
Esempio n. 6
0
 public static void SetCurrentThreadLanguageClass(CoreLanguageClass lang)
 {
     ThreadData.CurrentThreadData["current_thread_language"] = lang;
 }