/// <summary> /// Új project /// </summary> public void New(string deviceName, string badurate) { OnLoading(); if (System.IO.Directory.Exists(Settings.Default.BrowseLocation)) { Environment.CurrentDirectory = Settings.Default.BrowseLocation; } FileName = AppConstants.NewFileName; FullPath = Environment.CurrentDirectory + "\\" + FileName + AppConstants.FileExtension; IsSaved = false; _fileStorage.New(); _fileStorage.Parameters.DeviceName = deviceName; _fileStorage.Parameters.Baudrate = badurate; _fileStorage.Parameters.CopyTo(Parameters); _fileStorage.Filters.CopyTo(Filters); _fileStorage.Tools.CopyTo(Tools); CustomArbIdColumns.Clear(); LogGridLayout.Clear(); TraceGridLayout.Clear(); IsChanged = false; OnLoadCompleted(); }
/// <summary> /// Új project /// </summary> public void New() { TraceGridLayout.Clear(); LogGridLayout.Clear(); StatisticsGridLayout.Clear(); FilterGridLayout.Clear(); Tools.Clear(); ToolsLayouts.Clear(); FileVersion = "1.0.0.0"; Parameters.New(); Tools.New(); }
/// <summary> /// Mentsd másként az aktuális projectet /// </summary> public void SaveAs(string path) { OnSaving(); if (System.IO.Path.IsPathRooted(path)) { FullPath = path; FileName = System.IO.Path.GetFileNameWithoutExtension(path); Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(path); } else { FullPath = path; FileName = path; } OnProgressChanged(new ProgressChangedEventArgs(30, "Saving...")); Parameters.CopyTo(_fileStorage.Parameters); OnProgressChanged(new ProgressChangedEventArgs(40, "Parameters Saving...")); Filters.CopyTo(_fileStorage.Filters); OnProgressChanged(new ProgressChangedEventArgs(60, "Filters Saving...")); CustomArbIdColumns.CopyTo(_fileStorage.CustomArbIdColumns); OnProgressChanged(new ProgressChangedEventArgs(80, "CustomArbIdColumns Saving...")); TraceGridLayout.CopyTo(_fileStorage.TraceGridLayout); OnProgressChanged(new ProgressChangedEventArgs(80, "TraceGridLayout Saving...")); LogGridLayout.CopyTo(_fileStorage.LogGridLayout); OnProgressChanged(new ProgressChangedEventArgs(80, "LogGridLayout Saving...")); StatisticsGridLayout.CopyTo(_fileStorage.StatisticsGridLayout); OnProgressChanged(new ProgressChangedEventArgs(80, "StatisticsGridLayout Saving...")); FilterGridLayout.CopyTo(_fileStorage.FilterGridLayout); OnProgressChanged(new ProgressChangedEventArgs(80, "FilterGridLayout Saving...")); Tools.CopyTo(_fileStorage.Tools); OnProgressChanged(new ProgressChangedEventArgs(80, "ToolTables Saving...")); _fileStorage.SaveToFile(path); IsSaved = true; IsChanged = false; OnSaveCompleted(); OnProgressChanged(new ProgressChangedEventArgs(100, "Completed.")); }