/// <summary> /// Constructs a new Spreadsheet when you open a new spreadsheet from the server. /// </summary> /// <param name="filepath">Path to file</param> public Form1(string filepath, string user, int p, string pass) { InitializeComponent(); //ss = new Spreadsheet(filepath, isValidName, s => s.ToUpper(), "Spreadsheet"); ss = new Spreadsheet(isValidName, s => s.ToUpper(), filepath); fileList = new List<string>(); first = false; //Will this be bad?? scm = new SpreadsheetClientModel(); scm.Connect(user, p, pass); scm.SendMessage("CREATE" + "\\e" + filepath + "\n"); username = user; port = p; password = pass; version = 0; filename = filepath; this.Text = filename; spreadsheetPanel1.SetSelection(0, 0); selectedCell.Text = "A1"; selectedValue.Text = ""; editCell.Text = ""; scm.IncomingLineEvent += MessageReceived; UpdateCell(); //testing success //new OpenF(this, first); }
//private SpreadsheetController ssController; /// <summary> /// Constructs a new default Spreadsheet /// </summary> public Form1() { InitializeComponent(); ss = new Spreadsheet(isValidName, s => s.ToUpper(), "Spreadsheet"); scm = new SpreadsheetClientModel(); fileList = new List<string>(); version = 0; filename = null; this.Text = ss.Version; spreadsheetPanel1.SetSelection(0, 0); selectedCell.Text = "A1"; selectedValue.Text = ""; editCell.Text = ""; scm.IncomingLineEvent += MessageReceived; UpdateCell(); }
/* public Form1(SpreadsheetClientModel scm) { InitializeComponent(); ss = new Spreadsheet(isValidName, s => s.ToUpper(), "Spreadsheet"); scm = new SpreadsheetClientModel(); logWin = new LoginWindow(scm); version = 0; filename = null; this.Text = ss.Version; spreadsheetPanel1.SetSelection(0, 0); selectedCell.Text = "A1"; selectedValue.Text = ""; editCell.Text = ""; this.Visible = false; scm.IncomingLineEvent += MessageReceived; UpdateCell(); } */ /// <summary> /// The initial constructor that the AuthenicationF uses. /// </summary> /// <param name="loginWindow"></param> public Form1(LoginWindow loginWindow, string user, int p, string pass) { logWin = loginWindow; InitializeComponent(); ss = new Spreadsheet(isValidName, s => s.ToUpper(), "Spreadsheet"); scm = new SpreadsheetClientModel(); fileList = new List<string>(); username = user; port = p; password = pass; first = true; filename = null; this.Text = ss.Version; spreadsheetPanel1.SetSelection(0, 0); selectedCell.Text = "A1"; selectedValue.Text = ""; editCell.Text = ""; this.Visible = false; scm.IncomingLineEvent += MessageReceived; UpdateCell(); //testing success //new OpenF(this, first); }