Esempio n. 1
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);
            }
        }
 public TisCategoryAttribute(string category, string strFileName)
     : base(category)
 {
     TisStr.AddLanguageFile(strFileName);
 }