Exemple #1
0
        public DataCollection ReadFile(string fileName, string format = null)
        {
            IFileConnector exporter = null;

            if (format != null)
            {
                exporter = PluginProvider.GetObjectInstance <IFileConnector>(format);
            }
            else
            {
                exporter = FileConnector.SmartGetExport(fileName);
            }

            if (exporter == null)
            {
                return(null);
            }
            exporter.FileName = fileName;


            fileName = exporter.FileName;

            ControlExtended.SafeInvoke(
                () => AddDataCollection(exporter.ReadFile(), Path.GetFileNameWithoutExtension(fileName)), LogType.Important);
            return(GetCollection(fileName));
        }
Exemple #2
0
        public static List <IFreeDocument> ReadGroupDataFile(string path)
        {
            IFileConnector json = SmartGetExport(path);

            json.FileName = path;
            return(json.ReadFile().ToList());
        }
Exemple #3
0
        public static IFreeDocument ReadDataFile(string path)
        {
            IFileConnector json = SmartGetExport(path);

            json.FileName = path;
            IFreeDocument r = json.ReadFile().LastOrDefault();

            return(r);
        }
Exemple #4
0
        public virtual void ReadConfig(string path = null)
        {
            if (path == null)
            {
                path = SavePath;
            }
            IFileConnector json = FileConnector.SmartGetExport(path);

            json.FileName = path;
            IDictionarySerializable da = json.ReadFile().FirstOrDefault();

            DictDeserialize(da.DictSerialize());
        }