public static MainModel ToModel(TextDemoSettings Settings) { var model = new MainModel() { UserName = Settings.UserName, IpAddr = Settings.IpAddr, Password = Settings.Password, FtpCommandRecentList = Settings.FtpCommandRecentList }; return(model); }
private void MainWindow_Closed(object sender, EventArgs e) { { var settings = TextDemoSettings.RecallSettings(); settings.WindowClientSize = new Size(this.ActualWidth, this.ActualHeight); settings.IpAddr = this.Model.IpAddr; settings.UserName = this.Model.UserName; settings.Password = this.Model.Password; settings.FtpCommandRecentList = this.Model.FtpCommandRecentList; settings.StoreSettings(); } }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { var settings = TextDemoSettings.RecallSettings(); if (settings.WindowClientSize.Height > 0) { this.Height = settings.WindowClientSize.Height; this.Width = settings.WindowClientSize.Width; } this.Model = MainModel.ToModel(settings); grdMain.DataContext = this.Model; this.Canvas1.Focusable = true; this.Canvas1.Focus(); this.ScreenCanvas = new TestCanvas(this.Canvas1, 9.83, 18.5, 50, 15); this.ScreenCanvas.ScreenExitEvent += ScreenCanvas_ScreenExitEvent; this.LogFile = new LogFile("c:\\downloads\\textCanvasLog.txt", LogFileAction.Clear); this.ScreenCanvas.LogFile = this.LogFile; }