Advertisement
Guest User

ParsePage

a guest
Jul 25th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.42 KB | None | 0 0
  1. public void ParsePage(dynamic parseObject)
  2.         {
  3.             try
  4.             {
  5.                 int page = parseObject.Page;
  6.  
  7.                 if (page == 2 && _parser.CheckImage(page)) return;
  8.                 if (page > 4 ) return;
  9.                 OtherPageEntities.AddRange(ParseOtherPages(_patternsClass, page));
  10.  
  11.                 if (OtherPageEntities.Count == 0)
  12.                     OtherPageEntities.AddRange(ParseOtherPagesAddition(_patternsAddClass, page));
  13.             }
  14.             catch (InitFontException)
  15.             {
  16.                 TypesError |= TypesError.InitFontError;
  17.             }
  18.             catch (CidToGlyphException)
  19.             {
  20.                 TypesError |= TypesError.FindCidToGlyphIsError;
  21.             }
  22.             catch (OperationCanceledException)
  23.             {
  24.                 TypesError |= TypesError.ParserCanceledException;
  25.             }
  26.             catch (Exception ex)
  27.             {
  28.                 Console.WriteLine(ex.Message);
  29.                 if (ex.InnerException != null) Console.WriteLine(ex.InnerException.Message);
  30.                 Console.WriteLine(ex.StackTrace);
  31.                 //ignore error
  32.                 TypesError |= TypesError.ParsePageIsBad;
  33.             }
  34.             finally
  35.             {
  36.                 if (Interlocked.Decrement(ref Parser.NumberOfThreadsNotYetCompleted) == 0)
  37.                     parseObject.DoneEvent.Set();
  38.             }
  39.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement