Exemplo n.º 1
0
        private void ExportRows(StreamWriter writer)
        {
            ExportProgressEventArgs args = new ExportProgressEventArgs(Table.Rows.Count);

            for (int i = 0; i < Table.Rows.Count; i++)
            {
                CheckCanceled();

                var objs = Table.Rows[i].ItemArray;
                args.CurrentIndex = i;
                OnProgress(args);

                for (int j = 0; j < objs.Length; j++)
                {
                    var obj = objs[j];

                    if (j != 0)
                    {
                        writer.Write(Delimiter);
                    }

                    if (lstColIsString[j])
                    {
                        if (obj != null && obj != System.DBNull.Value)
                        {
                            writer.Write(STRING_SIGN);
                            writer.Write(obj.ToString());
                            writer.Write(STRING_SIGN);
                        }
                    }
                    else
                    {
                        writer.Write(obj.ToString());
                    }
                }

                writer.Write(CRLF);
            }
        }
Exemplo n.º 2
0
 protected virtual void OnProgress(ExportProgressEventArgs arg)
 {
     Progress?.Invoke(this, arg);
 }