public async Task DoRecentImport(RecentDataSource recent) { var session = (IImportSession)Activator.CreateInstance(recent.ImportSessionType); session.FromRecent(recent, _owner); await DoCommonImport(session); }
public static void Add(RecentDataSource source) { var file = LoadFile(); foreach (var oldItem in file.Items.Where(x => x.DisplayName.ToLower() == source.DisplayName.ToLower()).ToList()) { file.Items.Remove(oldItem); } file.Items.Add(new StorageItem { ImportSessionTypeName = source.ImportSessionType.FullName, DisplayName = source.DisplayName, ConnectionString = source.ConnectionString }); int fileCount, serverCount; file.Count(out fileCount, out serverCount); for (; fileCount > MAX_RECENTS; fileCount--) { file.RemoveFirst(typeof(IFileImportSession)); } for (; serverCount > MAX_RECENTS; serverCount--) { file.RemoveFirst(typeof(IDatabaseImportSession)); } SaveFile(file); }
public bool FromRecent(RecentDataSource recent, IWin32Window owner) { _builder = CreateBuilder(recent.ConnectionString); return(DoConnect(owner)); }
public bool FromRecent(RecentDataSource recent, IWin32Window owner) { FromFilePath(recent.ConnectionString); return(true); }