Ejemplo n.º 1
0
            public IGridDataRecords OpenData(byte[] dataSettings, IGridDataOpenContext openContext)
            {
                DirectConnectGridDataSettings thesettings = DirectConnectGridDataSettings.FromBytes(dataSettings);

                if (thesettings == null || thesettings.TableOrViewName == null)
                {
                    return(null);
                }

                return(new DirectConnectGridDataRecords(thesettings));
            }
Ejemplo n.º 2
0
        public IGridDataRecords OpenData(byte[] dataSettings, IGridDataOpenContext openContext)
        {
            CSVGridDataSettings thesettings = CSVGridDataSettings.FromBytes(dataSettings);

            if (thesettings == null || thesettings.FileName == null) // and maybe check that file exists and can be opened, etc?
            {
                return(null);
            }

            thesettings.TryFindFile(openContext);
            return(new CSVGridDataRecords(thesettings));
        }
Ejemplo n.º 3
0
 public void TryFindFile(IGridDataOpenContext openContext)
 {
     if (System.IO.File.Exists(_fileName) == false)
     {
         if (String.IsNullOrEmpty(openContext.ProjectFileName) == false)
         {
             var newFile = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(openContext.ProjectFileName), System.IO.Path.GetFileName(_fileName));
             if (System.IO.File.Exists(newFile))
             {
                 _fileName = newFile;
             }
         }
     }
 }