/// <summary>
 /// Free global instance of
 /// <see cref="IrbisUpperCaseTable"/>.
 /// </summary>
 public static void ResetInstance()
 {
     lock (_lock)
     {
         _instance = null;
     }
 }
        public static IrbisUpperCaseTable FromServer
        (
            [NotNull] ManagedClient64 connection,
            [NotNull] string fileName
        )
        {
            string text = connection.ReadTextFile
                          (
                IrbisPath.System,
                fileName
                          );

            if (string.IsNullOrEmpty(text))
            {
                throw new IrbisException
                      (
                          "No file " + fileName
                      );
            }

            IrbisUpperCaseTable result = ParseText
                                         (
                IrbisEncoding.Ansi,
                text
                                         );

            return(result);
        }
        public static IrbisUpperCaseTable GetInstance
        (
            [NotNull] ManagedClient64 connection
        )
        {
            if (ReferenceEquals(_instance, null))
            {
                lock (_lock)
                {
                    if (ReferenceEquals(_instance, null))
                    {
                        _instance = FromServer
                                    (
                            connection,
                            FileName
                                    );
                    }
                }
            }

            return(_instance);
        }
        public static IrbisUpperCaseTable ParseText
        (
            [NotNull] Encoding encoding,
            [NotNull] string text
        )
        {
            List <byte> table = new List <byte>(256);

            MatchCollection matches = Regex.Matches(text, @"\d+");

            foreach (Match match in matches)
            {
                byte b = byte.Parse(match.Value);
                table.Add(b);
            }

            IrbisUpperCaseTable result = new IrbisUpperCaseTable
                                         (
                encoding,
                table.ToArray()
                                         );

            return(result);
        }