private void AddProfile(UciEngineProfile profile) { if (profilesListBox.Items.Contains(profile.Name)) { throw new ArgumentException("Name already used"); } Profiles.AddProfile(profile); profilesListBox.Items.Add(profile.Name); }
public void AddProfile(UciEngineProfile profile) { if (ExistsWithName(profile.Name)) { throw new ArgumentException("Name already used"); } profile.SetParent(this); Profiles.Add(profile); SerializeEngineList(); }
private void LoadEngine(UciEngineProfile profile) { if (Engine != null) { UnloadEngine(); } Engine = profile.LoadEngine(); AfterEngineLoaded(); }
private void AddButton_Click(object sender, EventArgs e) { var name = nameTextBox.Text; var path = pathTextBox.Text; if (name == "" || path == "") { MessageBox.Show("Name and path must be non empty"); return; } if (Profiles.ExistsWithName(name)) { MessageBox.Show("Name already in use"); return; } Profile = new UciEngineProfile(null, name, path); Close(); }
#pragma warning disable IDE0060 // Remove unused parameter public void OnProfileUpdated(UciEngineProfile profile) #pragma warning restore IDE0060 // Remove unused parameter { SerializeEngineList(); }
public UciEngineProxy(UciEngineProfile profile) : this(profile.Path) { Profile = profile; Profile.ApplyOptionsToEngine(this); }