예제 #1
0
파일: MainGUI.cs 프로젝트: amozoss/CS3505
        /// <summary>
        /// This method is one of the delegates sent to CreateOrJoin, it's call means the user wants to join a spreadsheet.
        /// </summary>
        /// <param name="IPaddress"></param>
        /// <param name="port"></param>
        /// <param name="ssName"></param>
        /// <param name="psword"></param>
        private void JoinDelegate(string IPaddress, string port, string ssName, string psword)
        {
            if (this.IsHandleCreated)
            {
                this.Invoke((MethodInvoker)delegate
                    {
                        int num = 0;
                        if (Int32.TryParse(port, out num))
                        {
                            if (!ReferenceEquals(clientCommunication, null))
                                clientCommunication.Leave();
                            spreadsheet = new Spreadsheet(s => Regex.IsMatch(s, @"^[a-zA-Z]{1}[0-9]{1,2}$"), s => s.ToUpper(), "ps6");
                            clientCommunication = new ClientSocket(IPaddress, changeCell, Update, num, this.SendXML);
                            EmptySSPanel();
                            clientCommunication.JoinSpreadsheet(ssName, psword);
                            refreshSpreadsheet();

                        }
                    });
            }
        }