private void UpdateBase(IGameFileDataSourceAdapter adapter, GameFileViewControl ctrl, GameFileGetOptions options, IEnumerable <GameFileSearchField> searchFields) { IEnumerable <IGameFileDataSource> first = new IGameFileDataSource[0]; GameFileFieldType[] defaultGameFileSelectFields = this.DefaultGameFileSelectFields; if (options == null) { foreach (GameFileSearchField field in searchFields) { first = first.Union <IGameFileDataSource>(adapter.GetGameFiles(new GameFileGetOptions(defaultGameFileSelectFields, field))); } } else { foreach (GameFileSearchField field2 in searchFields) { options.SearchField = field2; first = first.Union <IGameFileDataSource>(adapter.GetGameFiles(options)); } if (options.SearchField != null) { first = first.Union <IGameFileDataSource>(adapter.GetGameFiles(new GameFileGetOptions(defaultGameFileSelectFields, options.SearchField))); } } this.SetDataSource(ctrl, first.ToList <IGameFileDataSource>()); }
public BasicTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields) { InitializeComponent(); m_key = key; m_title = title; Adapter = adapter; m_selectFields = selectFields.ToArray(); }
public SyncLibraryHandler(IGameFileDataSourceAdapter dbDataSource, IGameFileDataSourceAdapter syncDataSource, LauncherPath gameFileDirectory, LauncherPath tempDirectory) { this.DbDataSource = dbDataSource; this.SyncDataSource = syncDataSource; this.GameFileDirectory = gameFileDirectory; this.TempDirectory = tempDirectory; this.SyncFileCurrent = this.SyncFileCount = 0; }
public LocalTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, ITagMapLookup lookup) : base(key, title, adapter, selectFields) { base.GameFileViewControl.DoomLauncherParent = this; this.m_tagLookup = lookup; if (this.m_tagLookup != null) { base.GameFileViewControl.CustomRowColorPaint = true; base.GameFileViewControl.CustomRowPaint += new CancelEventHandler(this.GameFileViewControl_CustomRowPaint); } }
public SyncLibraryHandler(IGameFileDataSourceAdapter dbDataSource, IGameFileDataSourceAdapter syncDataSource, LauncherPath gameFileDirectory, LauncherPath tempDirectory, string[] dateParseFormats) { DbDataSource = dbDataSource; SyncDataSource = syncDataSource; GameFileDirectory = gameFileDirectory; TempDirectory = tempDirectory; DateParseFormats = dateParseFormats; SyncFileCurrent = SyncFileCount = 0; }
public void Download(IGameFileDataSourceAdapter adapter, string dlFilename) { IdGamesDataAdapater adapater = adapter as IdGamesDataAdapater; if (adapater != null) { this.m_webClient = new WebClient(); this.m_webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(this.client_DownloadProgressChanged); this.m_webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(this.client_DownloadFileCompleted); this.m_webClient.DownloadFileAsync(new Uri(adapater.MirrorUrl + this.dir + this.filename), dlFilename, this.id); } }
public LocalTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, ITagMapLookup lookup, GameFileViewFactory factory) : base(key, title, adapter, selectFields, factory) { GameFileViewControl.DoomLauncherParent = this; m_tagLookup = lookup; if (m_tagLookup != null && GameFileViewControl is IGameFileColumnView columnView) { columnView.CustomRowColorPaint = true; columnView.CustomRowPaint += GameFileViewControl_CustomRowPaint; } }
public void Download(IGameFileDataSourceAdapter adapter, string dlFilename) { IdGamesDataAdapater dataAdapter = adapter as IdGamesDataAdapater; if (dataAdapter != null) { m_webClient = new WebClient(); m_webClient.DownloadProgressChanged += client_DownloadProgressChanged; m_webClient.DownloadFileCompleted += client_DownloadFileCompleted; m_webClient.DownloadFileAsync(new Uri(dataAdapter.MirrorUrl + dir + filename), dlFilename, id); } }
public void UpdateGameFileViewSearch(IGameFileDataSourceAdapter adapter, GameFileViewControl ctrl) { string searchText = this.SearchControl.SearchText; if (!string.IsNullOrEmpty(searchText.Trim())) { this.Update(adapter, ctrl, null, this.GetSelectedSearchFields(searchText)); } else { this.Update(adapter, ctrl, null, null); } }
protected BasicTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, IGameFileView view) { InitializeComponent(); m_key = key; Title = title; Adapter = adapter; m_selectFields = selectFields.ToArray(); UserControl ctrl = (UserControl)view; ctrl.Anchor = AnchorStyles.Top | AnchorStyles.Left; ctrl.Dock = DockStyle.Fill; Controls.Add(ctrl); GameFileView = (IGameFileView)ctrl; }
private void Update(IGameFileDataSourceAdapter adapter, GameFileViewControl ctrl, GameFileGetOptions options, IEnumerable <GameFileSearchField> searchFields) { if ((searchFields == null) || (searchFields.Count <GameFileSearchField>() == 0)) { if (options == null) { this.SetDataSource(ctrl, adapter.GetGameFiles().ToList <IGameFileDataSource>()); } else { this.SetDataSource(ctrl, adapter.GetGameFiles(options).ToList <IGameFileDataSource>()); } } else { this.UpdateBase(adapter, ctrl, options, searchFields); } }
public void Download(IGameFileDataSourceAdapter adapter, IGameFileDownloadable dlItem) { if ((dlItem != null) && !this.IsDownloading(dlItem)) { try { this.m_currentDownloads.Add(dlItem); dlItem.DownloadProgressChanged += new DownloadProgressChangedEventHandler(this.dlItem_DownloadProgressChanged); dlItem.DownloadCompleted += new AsyncCompletedEventHandler(this.dlItem_DownloadCompleted); if (this.DownloadView != null) { this.DownloadView.AddDownload(dlItem, dlItem.FileName); } dlItem.Download(adapter, Path.Combine(this.DownloadDirectory.GetFullPath(), dlItem.FileName)); } catch { } } }
public void Download(IGameFileDataSourceAdapter adapter, IGameFileDownloadable dlItem) { if (dlItem != null && !IsDownloading(dlItem)) { try { m_currentDownloads.Add(dlItem); dlItem.DownloadProgressChanged += dlItem_DownloadProgressChanged; dlItem.DownloadCompleted += dlItem_DownloadCompleted; if (DownloadView != null) { DownloadView.AddDownload(dlItem, dlItem.FileName); } dlItem.Download(adapter, Path.Combine(DownloadDirectory.GetFullPath(), dlItem.FileName)); } catch { //failed, nothing to do } } }
public void UpdateGameFileViewSearch(IGameFileDataSourceAdapter adapter, GameFileViewControl ctrl, GameFileGetOptions options) { this.Update(adapter, ctrl, options, null); }
public void UpdateGameFileView(IGameFileDataSourceAdapter adapter, GameFileViewControl ctrl) { this.Update(adapter, ctrl, null, null); }
public UntaggedTabView(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, ITagMapLookup lookup, GameFileViewFactory factory) : base(key, title, adapter, selectFields, lookup, factory) { }
public BasicTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, GameFileViewFactory factory) : this(key, title, adapter, selectFields, factory.CreateGameFileView()) { m_factory = factory; }
public OptionsTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, ITagMapLookup lookup) : base(key, title, adapter, selectFields, lookup) { this.InitializeComponent(); }
public IdGamesTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields) : base(key, title, adapter, selectFields) { this.InitializeComponent(); }
public OptionsTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields) : base(key, title, adapter, selectFields, null) { InitializeComponent(); }