Ejemplo n.º 1
0
        public MapImportSelectionForm(IEnumerable <string> maps, string downloadurl, MapsProvider mapsProvider)
        {
            InitializeComponent();

            DialogResult = DialogResult.Cancel;
            webClient.DownloadProgressChanged += WebClientDownloadProgressChanged;

            _downloadurl  = downloadurl;
            _mapsProvider = mapsProvider;
            mapsProvider.Refresh();
            var totalCount  = maps.Count();
            var existsCount = 0;

            foreach (var map in maps.OrderBy(m => m))
            {
                if (mapsProvider.Collection.Any(m => m.Name == map))
                {
                    existsCount++;
                    continue;
                }

                checkedListBox.Items.Add(map);
            }

            MessageBox.Show(
                string.Format("Found {0} maps, of which you already have downloaded {1}. Showing remaining maps...", totalCount, existsCount),
                "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Reloads the data.
        /// </summary>
        private void ReloadData()
        {
            rotationElementPreview.Element = null;
            _mapRotation.Clear();

            _gameModesProvider.Refresh();
            _mapsProvider.Refresh();

            // Reload data set
            rotationElementEditor.GameModesProvider = _gameModesProvider;
            rotationElementEditor.MapsProvider      = _mapsProvider;

            mapRotationEditor.NextGameMode = _gameModesProvider.Collection.FirstOrDefault();
            mapRotationEditor.NextMap      = _mapsProvider.Collection.FirstOrDefault();

            IsFileModified = false;
        }