예제 #1
0
 internal void cancelDump()
 {
     if (mydump != null)
     {
         mydump.cancelMysqlDumpProcess();
         mydump = null;
     }
 }
예제 #2
0
        /// <summary>
        /// main mysql dump executor task
        /// start/running in ASYNC mode.
        /// internal its calling other task/jobs and waits for completion.
        /// with every task completed its firing notification events(listener)
        /// --BASIC FLOW--
        /// </summary>
        async void DumpMysqlTaskExecutor()
        {
            Task <List <string> > testConnectionTask = testCon();
            List <string>         tables             = await testConnectionTask;

            if (tables != null)
            {
                onProgress("connected");
                onInitDumpTables(tables);

                mydump = new SqlDump(credentialsConfigInstance);
                mydump.CompressProgress += onCompressProgressHandler;
                mydump.CompressStart    += onCompressStartHandler;
                mydump.TableRowCount    += onTableRowCountHandler;
                mydump.TableStartDump   += onTableStartDumpHandler;

                Task <DumpResultSet> result     = dumptask(mydump);
                DumpResultSet        dumpresult = null;
                try
                {
                    dumpresult = await result;
                }
                catch (Exception ex)
                {
                    if (!(ex is NullReferenceException))
                    {
                        dumpresult = new DumpResultSet();
                        dumpresult.wasSuccessful             = false;
                        dumpresult.errorNumber               = 2;
                        dumpresult.mysqldumpexeStandardError = "Error in MySQLDumpAdapter:\n" + ex.Message;
                    }
                }

                onCompleted(dumpresult);
                mydump = null;
            }
            else
            {
                //we need enumaration classes for all kind of different erros
                //..We still need enumaration class for all kind of dif erros
                onError(-1);

                mydump = null;
            }
        }
예제 #3
0
 static async Task <DumpResultSet> dumptask(SqlDump mydump)
 {
     return(mydump.executeDump());
 }