예제 #1
0
        public override string GetString(string name)
        {
            string value = String.Empty;

            if (!m_CacheStrings.TryGetValue(name, out value))
            {
                value = TisStr.LoadText(name);
                m_CacheStrings[name] = value;
            }
            return(value);
        }
예제 #2
0
        static public void InitTisStr(string RelativeLanguageFilename)
        {
            try
            {
                short nStatus = TisStr.Initialize(null);

                if (nStatus != TisStr.STR_ERROR_NO_ERROR)
                {
                    Log.Write(
                        Log.Severity.ERROR,
                        System.Reflection.MethodInfo.GetCurrentMethod(),
                        "Error : {0}",
                        nStatus.ToString());

                    throw new TisException("{0} - {1}", System.Reflection.MethodInfo.GetCurrentMethod(), "Error - TisStr.Initialize");
                }

                nStatus = TisStr.AddLanguageFile(RelativeLanguageFilename);

                if (nStatus != TisStr.STR_ERROR_NO_ERROR)
                {
                    Log.Write(
                        Log.Severity.ERROR,
                        System.Reflection.MethodInfo.GetCurrentMethod(),
                        "Error : {0}",
                        nStatus.ToString());;

                    throw new TisException("{0} - {1}", System.Reflection.MethodInfo.GetCurrentMethod(), "Error - TisStr.AddLanguageFile");
                }

                nStatus = TisStr.Load();

                if (nStatus != TisStr.STR_ERROR_NO_ERROR)
                {
                    Log.Write(
                        Log.Severity.ERROR,
                        System.Reflection.MethodInfo.GetCurrentMethod(),
                        "Error : {0}",
                        nStatus.ToString());

                    throw new TisException("{0} - {1}", System.Reflection.MethodInfo.GetCurrentMethod(), "Error - TisStr.Load");
                }
            }
            catch (Exception oExc)
            {
                Log.Write(
                    Log.Severity.ERROR,
                    System.Reflection.MethodInfo.GetCurrentMethod(),
                    "Error : {0}",
                    oExc);

                throw new TisException("{0} - {1}", System.Reflection.MethodInfo.GetCurrentMethod(), oExc.Message);
            }
        }
 protected override string GetLocalizedString(string value)
 {
     return(TisStr.LoadText(value, value));
 }
 public TisCategoryAttribute(string category, string strFileName)
     : base(category)
 {
     TisStr.AddLanguageFile(strFileName);
 }