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);
        }
Exemplo n.º 2
0
        public void AddProfile(UciEngineProfile profile)
        {
            if (ExistsWithName(profile.Name))
            {
                throw new ArgumentException("Name already used");
            }

            profile.SetParent(this);
            Profiles.Add(profile);
            SerializeEngineList();
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 5
0
#pragma warning disable IDE0060 // Remove unused parameter
        public void OnProfileUpdated(UciEngineProfile profile)
#pragma warning restore IDE0060 // Remove unused parameter
        {
            SerializeEngineList();
        }
Exemplo n.º 6
0
 public UciEngineProxy(UciEngineProfile profile) :
     this(profile.Path)
 {
     Profile = profile;
     Profile.ApplyOptionsToEngine(this);
 }