Exemplo n.º 1
0
        public MainForm()
        {
            Repository r = new Repository("http://files.markjohansen.dk/nwn/ravenloft_downloader/", "nothing");
            manager.setMirror(r);
            manager.SetForm(this);

            try
            {
                conf = Configuration.Load();
            }
            catch (FileNotFoundException e)
            {
                conf = new Configuration();
            }

            InitializeComponent();

            this.txtServerIP.Text = ip + ":" + port;

            this._isExpanded = true;
            this.ToggleExpandForm();

            timer.Tick += new EventHandler(timer_Tick); // Everytime timer ticks, timer_Tick will be called
            timer.Interval = (1000) * (10);             // Timer will tick evert 10 seconds
            timer.Enabled = true;                       // Enable the timer
            timer.Start();                              // Start the timer

            Random rnd = new Random();

            this.findGameInstall();

            if (!_gameFound)
            {
                this.btnJoin.Enabled = false;
                this.btnToggleWindow.Enabled = false;
            }

            this.FormClosing += new FormClosingEventHandler(MainForm_FormClosing);

            this.manager.getPackages();
        }
Exemplo n.º 2
0
 public void setMirror(Repository r)
 {
     this.repo = r;
 }