Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            myFiles = new MyFilesDB();
            scheduler = new MovingTCPScheduler(myFiles);
            myNeighbors = new MyNeighbors(scheduler);
            filesToShareForm = new AddFilesToShare(myFiles);
            scheduler.Start();

            fileSearchForm = new FileSearchForm(myNeighbors, scheduler);

            refreshDataTimer = new System.Windows.Forms.Timer();
            refreshDataTimer.Interval = 10 * 1000;
            refreshDataTimer.Tick += new EventHandler(refreshDataTimer_Tick);
            refreshDataTimer.Start();
            refreshDataTimer_Tick(null, null);

            if (myNeighbors.GetListOfNeighbors().Count == 0)
            {
                MessageBox.Show("Hello, you must be new here...\n\nYou must enter the IP address of someone already in the neighborhood to join.\n\nOnce you are connected go to File>Hash Files to begin sharing and search for filesfrom the main screen.");
                AddNeighborForm addnb = new AddNeighborForm(myNeighbors);
                addnb.ShowDialog();
            }
        }
Ejemplo n.º 2
0
 private void addNeighborToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AddNeighborForm addnb = new AddNeighborForm(myNeighbors);
     addnb.ShowDialog();
 }