void Event_uiTimer_Tick(object sender, EventArgs e)
        {
            if (!Visible) return;

            //update minimap when startbox changed or when map changed
            if (requestMinimapRefresh || (mouseIsDown & mouseOnStartBox > -1))
            {
                Refresh_MinimapImage();
                requestMinimapRefresh = false;
            }

            //update combobox
            bool downloadFinished = (download != null && download.IsComplete.GetValueOrDefault());
            if (downloadFinished || requestComboBoxRefresh)
            {
                timerCount++;
                //wait 3 second after LocalResourceAdded() to avoid ComboBox flicker if its called too often, 
                //and wait 3 second for download finish just in case the file is extracting
                if (timerCount >= timerFPS * 3)
                {
                    suppressEvent_SelectedIndexChanged = true;
                    Setup_ComboBox_AndRestore();
                    suppressEvent_SelectedIndexChanged = false;
                    
                    download = null;
                    requestComboBoxRefresh = false;
                    timerCount = 0;
                }
            }
        }
Пример #2
0
        protected internal void AddNeededDownload(Download down)
        {
					if (down != this)
					{
						down.parents.Add(this);
						neededDownloads.Add(down);
					} else Trace.TraceWarning(string.Format("{0} depends on itself", down.Name));
        }
 private void Event_Downloader_DownloadAdded(object sender, EventArgs<Download> e)
 {
     download = e.Data;
     timerCount = 0;
 }
 public DownloadBar(Download down): this()
 {
     Dock = DockStyle.Top;
     Download = down;
 }