public void Save(string file) { // Check if the file does not exist if (!File.Exists(file)) { // Create the file File.CreateText(file); } // Save the file M_PVP_Tact.Save(file); }
public M_PvpTactControl(string file) { // Check if the file does not exist if (!File.Exists(file)) { // Throw a new file not found exception throw new FileNotFoundException("Specified file could not be located.", file); } // Set the file _file = file; // Load the configurations M_PVP_Tact.Load(_file); // Pregenerated designer code InitializeComponent(); }
public M_PvpTactControl() { // Check if the file does not exist if (File.Exists(_file)) { // Load the configurations M_PVP_Tact.Load(_file); } else { // Throw a new file not found exception // throw new FileNotFoundException("Default file could not be located.", _file); } // Pregenerated designer code InitializeComponent(); }
public void Open(string file) { // Load the configurations from the file M_PVP_Tact.Load(file); // Create a new tactics array M_PvpTact[] items = new M_PvpTact[M_PVP_Tact.Tactics.Count]; // Copy the old tactics to the new array M_PVP_Tact.Tactics.CopyTo(items, 0); // Clear the listBoxTactics items list listBoxTactics.Items.Clear(); // Add the new tactics array to the listBoxTactics items array listBoxTactics.Items.AddRange(items); // Set the listBoxTactics selected index to 0 listBoxTactics.SelectedIndex = 0; }
public void Save() { // Save the file M_PVP_Tact.Save(_file); }