Exemplo n.º 1
0
    private DataLoadRequest CreateRequestLoadTable(string name, IDataTable table, bool downloadOnly = false, Action <byte[]> processBinary = null)
    {
        if (downloadOnly || forceLoadCSV)
        {
            processBinary = null;
        }
        DataLoadRequest dataLoadRequest = CreateRequest(name, manifest.GetTableHash(name), DATA_TABLE_DIRECTORY, downloadOnly);

        dataLoadRequest.processCompressedTextData = delegate(byte[] bytes)
        {
            if (table != null)
            {
                if (bytes.Length < 256)
                {
                    throw new ApplicationException("seek error");
                }
                string text = DecompressToString(bytes);
                if (!string.IsNullOrEmpty(text))
                {
                    table.CreateTable(text);
                }
                else if (text == null)
                {
                    throw new ApplicationException();
                }
            }
        };
        if (processBinary != null)
        {
            dataLoadRequest.SetupLoadBinary(manifest, processBinary);
        }
        return(dataLoadRequest);
    }
Exemplo n.º 2
0
 public void CreateTable(string csv)
 {
     table.CreateTable(csv);
     isInitialized = true;
 }