コード例 #1
0
        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);
        }
コード例 #2
0
        public void AddProfile(UciEngineProfile profile)
        {
            if (ExistsWithName(profile.Name))
            {
                throw new ArgumentException("Name already used");
            }

            profile.SetParent(this);
            Profiles.Add(profile);
            SerializeEngineList();
        }
コード例 #3
0
        private void LoadEngine(UciEngineProfile profile)
        {
            if (Engine != null)
            {
                UnloadEngine();
            }

            Engine = profile.LoadEngine();

            AfterEngineLoaded();
        }
コード例 #4
0
        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();
        }
コード例 #5
0
#pragma warning disable IDE0060 // Remove unused parameter
        public void OnProfileUpdated(UciEngineProfile profile)
#pragma warning restore IDE0060 // Remove unused parameter
        {
            SerializeEngineList();
        }
コード例 #6
0
 public UciEngineProxy(UciEngineProfile profile) :
     this(profile.Path)
 {
     Profile = profile;
     Profile.ApplyOptionsToEngine(this);
 }