private void InstanceOnProjectOpened( string testProgramSetName )
{
try
{
dgPropertyInfo.Rows.Clear();
_projectOpened = true;
_projectInfo = ProjectManager.ProjectInfo;
_originalProjectInfo = XmlUtils.SerializeObject( _projectInfo );
_projectInfo.TranslationInfo = _projectInfo.TranslationInfo ?? new TranslationInfo();
chkSegmentedSource.Checked = _projectInfo.TranslationInfo.Segmented;
_sourceFiles = _projectInfo.TranslationInfo.SourceFiles;
var fileNames = new List<string>();
if (_projectInfo != null)
{
CreatePropertyInfoComboRow( "Station Type", _projectInfo.ClassName );
dgPropertyInfo.Rows.Add( CreatePropertyInfoTextRow( "Project Name", _projectInfo.ProjectName ) );
dgPropertyInfo.Rows.Add( CreatePropertyInfoTextRow( "ID", _projectInfo.Uuid ) );
dgPropertyInfo.Rows.Add( CreatePropertyInfoTextRow( "UUT", _projectInfo.UutName ) );
dgPropertyInfo.Rows.Add( CreatePropertyInfoTextRow( "UUT ID", _projectInfo.UutId ) );
}
FileManager.GetFileNames( fileNames, ATMLContext.ProjectTranslatorSourcePath, false, "*.as", true );
if (_sourceFiles == null)
{
_sourceFiles = new List<TranslationSourceInfo>();
foreach (string fileName in fileNames)
{
_sourceFiles.Add( new TranslationSourceInfo( fileName ) );
}
if (_sourceFiles.Count > 0)
_sourceFiles[0].Primary = true;
_projectInfo.TranslationInfo.SourceFiles = _sourceFiles;
}
_bindingSource.DataSource = _sourceFiles;
dgBuildList.DataSource = _bindingSource;
dgBuildList.CellClick += DgBuildListOnCellClick;
dgBuildList.CellValueChanged += DgBuildListOnCellValueChanged;
dgBuildList.CellMouseUp += DgBuildListOnCellMouseUp;
SetSourceGridState();
SetButtonStates();
ResizePropertyGrid();
}
catch (Exception err)
{
LogManager.Error( err );
}
}