public filechooser(SpreadsheetModel ssm)
     : this()
 {
     this.spreadsheetmodel = ssm;
     BindingModelEvent();
     String command = "PASSWORD\x1B" + SpreadsheetModel.password + "\n";        // initial the password command
     spreadsheetmodel.Connect(command);
 }
Example #2
0
        private void opencreateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String command = "PASSWORD\x1B" + SpreadsheetModel.password + "\n";        // initial the password command
            SpreadsheetModel ssm = new SpreadsheetModel();

            //SpreadsheetApplicationContext appContext = SpreadsheetApplicationContext.getAppContext();
            //appContext.RunForm(new SpreadsheetGUI.Form1());
            spreadsheetPanel1.Invoke(new Action(() =>
            {
                Thread thread = new Thread(() =>
                {
                    Application.Run(new FileChooser.filechooser(ssm));
                });
                thread.Start();
            }));
            ssm.Connect(command);
        }
Example #3
0
        /// <summary>
        /// Authentication
        /// When the spreadsheet client is run the user will be prompted to enter 
        /// a password to gain access to the server. The format of the message 
        /// with which the client will request authentication is as follows:
        ///
        ///          PASSWORD[esc]password\n
        /// </summary>
        private void button1_Click(object sender, EventArgs e)
        {
            //check if the IP address and the port is vaild.
            if (!Is_The_IP_Vaild()) { return; }

            SpreadsheetModel.IP       = ServerIP.Text;                                            // get the server Ip address.
            SpreadsheetModel.password = Password.Text;                                            // get the password for authentication.
            String command            = "PASSWORD\x1B" + SpreadsheetModel.password + "\n";        // initial the password command.
            spreadsheetmodel          = new SpreadsheetModel();                                   // initial the spreadsheetmodel.
            BindingModelEvent();                                                                  // binding the function to the model.
            spreadsheetmodel.Connect(command);                                                    // Connect the socket to the server.
        }