コード例 #1
0
        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>());
        }
コード例 #2
0
 public BasicTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields)
 {
     InitializeComponent();
     m_key          = key;
     m_title        = title;
     Adapter        = adapter;
     m_selectFields = selectFields.ToArray();
 }
コード例 #3
0
 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;
 }
コード例 #4
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);
     }
 }
コード例 #5
0
        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;
        }
コード例 #6
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);
            }
        }
コード例 #7
0
        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;
            }
        }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
        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);
            }
        }
コード例 #10
0
        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;
        }
コード例 #11
0
 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);
     }
 }
コード例 #12
0
 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
         {
         }
     }
 }
コード例 #13
0
        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
                }
            }
        }
コード例 #14
0
 public void UpdateGameFileViewSearch(IGameFileDataSourceAdapter adapter, GameFileViewControl ctrl, GameFileGetOptions options)
 {
     this.Update(adapter, ctrl, options, null);
 }
コード例 #15
0
 public void UpdateGameFileView(IGameFileDataSourceAdapter adapter, GameFileViewControl ctrl)
 {
     this.Update(adapter, ctrl, null, null);
 }
コード例 #16
0
 public UntaggedTabView(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, ITagMapLookup lookup, GameFileViewFactory factory)
     : base(key, title, adapter, selectFields, lookup, factory)
 {
 }
コード例 #17
0
 public BasicTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, GameFileViewFactory factory)
     : this(key, title, adapter, selectFields, factory.CreateGameFileView())
 {
     m_factory = factory;
 }
コード例 #18
0
 public OptionsTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields, ITagMapLookup lookup) : base(key, title, adapter, selectFields, lookup)
 {
     this.InitializeComponent();
 }
コード例 #19
0
 public IdGamesTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields) : base(key, title, adapter, selectFields)
 {
     this.InitializeComponent();
 }
コード例 #20
0
 public OptionsTabViewCtrl(object key, string title, IGameFileDataSourceAdapter adapter, GameFileFieldType[] selectFields)
     : base(key, title, adapter, selectFields, null)
 {
     InitializeComponent();
 }