Ejemplo n.º 1
0
        private static void GetSavedDocument(object obj)
        {
            object[] arr       = (obj as object[]);
            FileInfo inputFile = (FileInfo)arr[0];

            HtmlStore[] retValue = null;

            string fileName = WordAdapter.SaveDocument(inputFile.FullName);

            retValue = DocxParser.Parse(fileName);

            try
            {
                if (!String.IsNullOrEmpty(fileName))
                {
                    File.Delete(fileName);
                }
            }
            catch { }


            ParsingFinishDelegate callback = (ParsingFinishDelegate)arr[1];

            callback.Invoke(inputFile, retValue);
        }
Ejemplo n.º 2
0
        private static void GetTestAsync(object obj)
        {
            object[] arr       = (obj as object[]);
            FileInfo inputFile = (FileInfo)arr[0];

            HtmlStore[]           retValue = null;
            ParsingFinishDelegate callback = (ParsingFinishDelegate)arr[1];

            try
            {
                retValue = DocxParser.Parse(inputFile.FullName);
            }
            catch (IOException ex)
            {
                SystemMessage.ShowErrorMessage(ex);
                callback.Invoke(inputFile, null);
                return;
            }

            callback.Invoke(inputFile, retValue);
        }