/// <summary> /// /// </summary> /// <param name="filename"></param> private static void CheckFileForVersionAndAddToVersionTable(string filename) { version v; string strVersion; string strPath; if (filename.Length > 0) { strPath = filename; int posIndex = strPath.LastIndexOf(@"\"); if (posIndex != -1) { strPath = Left(strPath, posIndex); } strVersion = strPath; posIndex = strVersion.LastIndexOf(@"\"); if (posIndex != -1) { strVersion = strVersion.Substring(posIndex + 1); } v = new version(strVersion, strPath); vtable.AddVersion(v); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripButton3_Click(object sender, EventArgs e) { if ((currentDrivePlatform.Version != null) && (currentDrivePlatform.Version.Length > 0)) { version v = currentDrivePlatform.FindVersion(currentDrivePlatform.Version); if (v != null) { string buildPath = null; buildPath = v.path; currentDrivePlatform.pBar = toolStripProgressBar; // progressBar1; currentDrivePlatform.DeleteFilesByFilter(buildPath, "*.pch;*.obj"); } } }
private void toolStripButton2_Click_1(object sender, EventArgs e) { if ((currentDrivePlatform.Version != null) && (currentDrivePlatform.Version.Length > 0)) { version v = currentDrivePlatform.FindVersion(currentDrivePlatform.Version); if (v != null) { string buildtool = v.path + @"\Devtree\bldtools\BuildMS.exe"; string bldtoopen = currentDrivePlatform.BldDirectortyPath + @"\" + currentDrivePlatform.BldFileName; Process.Start(buildtool, bldtoopen); } } }
/// <summary> /// Return the version object of a given version. /// </summary> /// <param name="versionKey"></param> /// <returns></returns> public version GetVersion(string versionKey) { version returnVersion = null; foreach (version vr in vrList) { if (vr.versionName == versionKey) { returnVersion = vr; break; } } return(returnVersion); }
public static version FindVersion(string strVersion) { version version = null; foreach (version v in vtable) { if (v.versionName == strVersion) { version = v; break; } } return(version); }
private void SetSubstituteDrives(string strVersion) { if ((strVersion != null) && (strVersion.Length > 0)) { version v = currentDrivePlatform.FindVersion(strVersion); if (v != null) { string setdrivespath = null; setdrivespath = v.path + @"\set_drive.bat"; currentDrivePlatform.QuickSetToolPath = setdrivespath; Process.Start(setdrivespath); this.Text = "RAD Platform Drives [" + selectedVersion + "]"; } } }
private void toolStripSetDriveScript_Click(object sender, EventArgs e) { string dirPath = currentDrivePlatform.BldDirectortyPath; //string buildPath = currentDrivePlatform.BuildsPath; string filePath = currentDrivePlatform.BldFileName; version v = currentDrivePlatform.FindVersion(toolStripPlatformCombo.Text); string SetDrivesFilePath = v.path + @"/set_drive.bat"; int posIndex = -1; if (SetDrivesFilePath.Length != 0) { StreamWriter file = new StreamWriter(SetDrivesFilePath); file.WriteLine("REM Set Drive.bat file for " + v.versionName); file.WriteLine(); if (currentDrivePlatform.GenerateSubstDelete) { file.WriteLine(@"subst L: /d"); file.WriteLine(@"subst M: /d"); file.WriteLine(@"subst R: /d"); file.WriteLine(@"subst T: /d"); file.WriteLine(@"subst X: /d"); file.WriteLine(@"subst S: /d"); file.WriteLine(@"subst K: /d"); file.WriteLine(@"subst Y: /d"); file.WriteLine(@"subst N: /d"); file.WriteLine(@"subst Z: /d"); } else { foreach (string d in Directory.GetDirectories(v.path)) { dirPath = d.ToUpper(); posIndex = dirPath.LastIndexOf(@"DEVTREE"); if (posIndex != -1) { file.WriteLine(@"subst L: /d"); continue; } posIndex = dirPath.LastIndexOf(@"MROOT"); if (posIndex != -1) { file.WriteLine(@"subst M: /d"); continue; } posIndex = dirPath.LastIndexOf(@"RROOT"); if (posIndex != -1) { file.WriteLine(@"subst R: /d"); continue; } posIndex = dirPath.LastIndexOf(@"TROOT"); if (posIndex != -1) { file.WriteLine(@"subst T: /d"); continue; } posIndex = dirPath.LastIndexOf(@"XROOT"); if (posIndex != -1) { file.WriteLine(@"subst X: /d"); continue; } posIndex = dirPath.LastIndexOf(@"SROOT"); if (posIndex != -1) { file.WriteLine(@"subst S: /d"); continue; } posIndex = dirPath.LastIndexOf(@"KROOT"); if (posIndex != -1) { file.WriteLine(@"subst K: /d"); continue; } posIndex = dirPath.LastIndexOf(@"YROOT"); if (posIndex != -1) { file.WriteLine(@"subst Y: /d"); continue; } posIndex = dirPath.LastIndexOf(@"NROOT"); if (posIndex != -1) { file.WriteLine(@"subst N: /d"); continue; } posIndex = dirPath.LastIndexOf(@"ZROOT"); if (posIndex != -1) { file.WriteLine(@"subst Z: /d"); continue; } } } file.WriteLine(@"subst U: /d"); file.WriteLine(); foreach (string d in Directory.GetDirectories(v.path)) { dirPath = d.ToUpper(); posIndex = dirPath.LastIndexOf(@"DEVTREE"); if (posIndex != -1) { file.WriteLine(@"subst L: " + "\"" + d + "\""); continue; } posIndex = dirPath.LastIndexOf(@"MROOT"); if (posIndex != -1) { file.WriteLine(@"subst M: " + "\"" + d + "\""); continue; } posIndex = dirPath.LastIndexOf(@"RROOT"); if (posIndex != -1) { file.WriteLine(@"subst R: " + "\"" + d + "\""); continue; } posIndex = dirPath.LastIndexOf(@"TROOT"); if (posIndex != -1) { file.WriteLine(@"subst T: " + "\"" + d + "\""); continue; } posIndex = dirPath.LastIndexOf(@"XROOT"); if (posIndex != -1) { file.WriteLine(@"subst X: " + "\"" + d + "\""); continue; } posIndex = dirPath.LastIndexOf(@"SROOT"); if (posIndex != -1) { file.WriteLine(@"subst S: " + "\"" + d + "\""); continue; } posIndex = dirPath.LastIndexOf(@"KROOT"); if (posIndex != -1) { file.WriteLine(@"subst K: " + "\"" + d + "\""); continue; } posIndex = dirPath.LastIndexOf(@"YROOT"); if (posIndex != -1) { file.WriteLine(@"subst Y: " + "\"" + d + "\""); continue; } posIndex = dirPath.LastIndexOf(@"NROOT"); if (posIndex != -1) { file.WriteLine(@"subst N: " + "\"" + d + "\""); continue; } posIndex = dirPath.LastIndexOf(@"ZROOT"); if (posIndex != -1) { file.WriteLine(@"subst Z: " + "\"" + d + "\""); continue; } } file.WriteLine(@"subst U: " + "\"" + v.path + "\""); file.Close(); file.Dispose(); file = null; } return; }
/// <summary> /// Add a version to the collection. /// </summary> /// <param name="vr"></param> public void AddVersion(version vr) { vrList.Add(vr); }