Пример #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            _engineManager = new InfinitySettings.EngineManager.EngineManager();
            _engineManager.EngineObject.EngineTitle   = txtEngine.Text;
            _engineManager.EngineObject.Name          = txtName.Text;
            _engineManager.EngineObject.Author        = txtAuthor.Text;
            _engineManager.EngineObject.IsBelowNormal = false;
            _engineManager.EngineObject.IsActive      = true;
            _engineManager.EngineObject.FilePath      = sourceFilePath;

            if (_engineManager.AddEngineNode() == true)
            {
                string targetFilePath = Ap.FolderEngines + engineFileName;
                if (sourceFilePath != targetFilePath && !UFile.Exists(targetFilePath))
                {
                    UFile.Copy(sourceFilePath, targetFilePath);
                }

                MessageForm.Show(this, MsgE.InfoEngineLoaded);
                this.Close();
            }
            else
            {
                MessageForm.Show(this, MsgE.InfoEngineExsist);
            }
        }
Пример #2
0
 public bool Load(string engineParameterFilePath)
 {
     if (UFile.Exists(engineParameterFilePath))
     {
         EngineParameterData.Rows.Clear();
         MemoryStream memoryStream = InfinityStreamsManager.ReadStreamFromFile(engineParameterFilePath);
         EngineParameterData.ReadXml(memoryStream);
         memoryStream.Close();
         SortParameters();
         OnParametersLoaded();
         return(true);
     }
     return(false);
 }
Пример #3
0
        private bool ValidateMatchSettings()
        {
            if (uciEngineWhite == null)
            {
                MessageForm.Show(this, MsgE.InfoSelectEngineForWhite);
                return(false);
            }
            if (uciEngineBlack == null)
            {
                MessageForm.Show(this, MsgE.InfoSelectEngineForBlack);
                return(false);
            }

            string dbFilePath = txtDatabasePath.Text.Trim();

            if (string.IsNullOrEmpty(dbFilePath) || !UFile.Exists(dbFilePath))
            {
                MessageForm.Show(this, MsgE.InfoSelectDatabaseFileForE2E);
                return(false);
            }

            return(true);
        }