From 3286345165eb40bbc4014d68460f0ff0b21ca3d9 Mon Sep 17 00:00:00 2001 From: Brett Sanderson Date: Fri, 21 Jun 2019 23:09:22 -0400 Subject: [PATCH] exporting paths done --- PegasusExportPlugin/Extensions/String.cs | 17 ++ .../PegasusExportPlugin.csproj | 8 +- PegasusExportPlugin/Program.cs | 4 - PegasusExportPlugin/ProgramEntry.cs | 28 +++ .../frmPegasusExport.Designer.cs | 170 +++++++++--------- PegasusExportPlugin/frmPegasusExport.cs | 123 +++++++------ 6 files changed, 210 insertions(+), 140 deletions(-) create mode 100644 PegasusExportPlugin/Extensions/String.cs create mode 100644 PegasusExportPlugin/ProgramEntry.cs diff --git a/PegasusExportPlugin/Extensions/String.cs b/PegasusExportPlugin/Extensions/String.cs new file mode 100644 index 0000000..8128fc1 --- /dev/null +++ b/PegasusExportPlugin/Extensions/String.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PegasusExportPlugin.Extensions +{ + public static class String + { + public static bool EndsWith(this string stringValue, char value) + { + int length = stringValue.Length; + return length != 0 && (int)stringValue[length - 1] == (int)value; + } + } +} diff --git a/PegasusExportPlugin/PegasusExportPlugin.csproj b/PegasusExportPlugin/PegasusExportPlugin.csproj index bc08dff..219fb95 100644 --- a/PegasusExportPlugin/PegasusExportPlugin.csproj +++ b/PegasusExportPlugin/PegasusExportPlugin.csproj @@ -17,7 +17,7 @@ true full false - ..\..\..\..\..\LaunchBox\Plugins\ + ..\..\..\..\LaunchBox\Plugins\ DEBUG;TRACE prompt 4 @@ -45,10 +45,10 @@ - ..\..\..\..\..\LaunchBox\Metadata\Unbroken.dll + ..\..\..\..\LaunchBox\Metadata\Unbroken.dll - ..\..\..\..\..\LaunchBox\Metadata\Unbroken.LaunchBox.Plugins.dll + ..\..\..\..\LaunchBox\Metadata\Unbroken.LaunchBox.Plugins.dll @@ -56,6 +56,7 @@ + Form @@ -70,6 +71,7 @@ + diff --git a/PegasusExportPlugin/Program.cs b/PegasusExportPlugin/Program.cs index cd2d222..94151cd 100644 --- a/PegasusExportPlugin/Program.cs +++ b/PegasusExportPlugin/Program.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace PegasusExportPlugin diff --git a/PegasusExportPlugin/ProgramEntry.cs b/PegasusExportPlugin/ProgramEntry.cs new file mode 100644 index 0000000..0a89095 --- /dev/null +++ b/PegasusExportPlugin/ProgramEntry.cs @@ -0,0 +1,28 @@ +using PegasusExportPlugin.Properties; +using System.Drawing; +using Unbroken.LaunchBox.Plugins; + +namespace PegasusExportPlugin +{ + class ProgramEntry : ISystemMenuItemPlugin + { + public string Caption => "Pegasus Export"; + + public Image IconImage => Resources.favicon96; + + public bool ShowInLaunchBox => true; + + public bool ShowInBigBox => false; + + public bool AllowInBigBoxWhenLocked => false; + + public void OnSelected() + { + using(var frmPegasusExport = new frmPegasusExport()) + { + frmPegasusExport.ShowDialog(); + } + } + + } +} diff --git a/PegasusExportPlugin/frmPegasusExport.Designer.cs b/PegasusExportPlugin/frmPegasusExport.Designer.cs index 17594e2..8d0b069 100644 --- a/PegasusExportPlugin/frmPegasusExport.Designer.cs +++ b/PegasusExportPlugin/frmPegasusExport.Designer.cs @@ -43,6 +43,9 @@ private void InitializeComponent() this.btnDown = new System.Windows.Forms.Button(); this.radChoose = new System.Windows.Forms.RadioButton(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.gbAssetPath = new System.Windows.Forms.GroupBox(); + this.radioButton3 = new System.Windows.Forms.RadioButton(); + this.radAbsoluteAssets = new System.Windows.Forms.RadioButton(); this.radLinkAssets = new System.Windows.Forms.RadioButton(); this.radCopyAssets = new System.Windows.Forms.RadioButton(); this.clbAssetList = new System.Windows.Forms.CheckedListBox(); @@ -60,24 +63,21 @@ private void InitializeComponent() this.groupBox5 = new System.Windows.Forms.GroupBox(); this.panel1 = new System.Windows.Forms.Panel(); this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.gbApplicationPath = new System.Windows.Forms.GroupBox(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.radAbsoluteApplication = new System.Windows.Forms.RadioButton(); this.radLinkApplication = new System.Windows.Forms.RadioButton(); this.radCopyApplication = new System.Windows.Forms.RadioButton(); - this.groupBox7 = new System.Windows.Forms.GroupBox(); - this.radAbsoluteApplication = new System.Windows.Forms.RadioButton(); - this.radioButton2 = new System.Windows.Forms.RadioButton(); - this.groupBox8 = new System.Windows.Forms.GroupBox(); - this.radioButton3 = new System.Windows.Forms.RadioButton(); - this.radAbsoluteAssets = new System.Windows.Forms.RadioButton(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); + this.gbAssetPath.SuspendLayout(); this.groupBox3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvPlatforms)).BeginInit(); this.groupBox4.SuspendLayout(); this.groupBox5.SuspendLayout(); this.panel1.SuspendLayout(); this.groupBox6.SuspendLayout(); - this.groupBox7.SuspendLayout(); - this.groupBox8.SuspendLayout(); + this.gbApplicationPath.SuspendLayout(); this.SuspendLayout(); // // btnExport @@ -234,7 +234,7 @@ private void InitializeComponent() // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.groupBox2.Controls.Add(this.groupBox8); + this.groupBox2.Controls.Add(this.gbAssetPath); this.groupBox2.Controls.Add(this.radLinkAssets); this.groupBox2.Controls.Add(this.radCopyAssets); this.groupBox2.Controls.Add(this.clbAssetList); @@ -245,6 +245,41 @@ private void InitializeComponent() this.groupBox2.TabStop = false; this.groupBox2.Text = "Asset Export"; // + // gbAssetPath + // + this.gbAssetPath.Controls.Add(this.radioButton3); + this.gbAssetPath.Controls.Add(this.radAbsoluteAssets); + this.gbAssetPath.Location = new System.Drawing.Point(177, 62); + this.gbAssetPath.Name = "gbAssetPath"; + this.gbAssetPath.Size = new System.Drawing.Size(107, 68); + this.gbAssetPath.TabIndex = 6; + this.gbAssetPath.TabStop = false; + this.gbAssetPath.Text = "Path"; + // + // radioButton3 + // + this.radioButton3.AutoSize = true; + this.radioButton3.Enabled = false; + this.radioButton3.Location = new System.Drawing.Point(16, 42); + this.radioButton3.Name = "radioButton3"; + this.radioButton3.Size = new System.Drawing.Size(64, 17); + this.radioButton3.TabIndex = 5; + this.radioButton3.Text = "Relative"; + this.radioButton3.UseVisualStyleBackColor = true; + // + // radAbsoluteAssets + // + this.radAbsoluteAssets.AutoSize = true; + this.radAbsoluteAssets.Checked = true; + this.radAbsoluteAssets.Enabled = false; + this.radAbsoluteAssets.Location = new System.Drawing.Point(16, 19); + this.radAbsoluteAssets.Name = "radAbsoluteAssets"; + this.radAbsoluteAssets.Size = new System.Drawing.Size(66, 17); + this.radAbsoluteAssets.TabIndex = 4; + this.radAbsoluteAssets.TabStop = true; + this.radAbsoluteAssets.Text = "Absolute"; + this.radAbsoluteAssets.UseVisualStyleBackColor = true; + // // radLinkAssets // this.radLinkAssets.AutoSize = true; @@ -254,6 +289,7 @@ private void InitializeComponent() this.radLinkAssets.TabIndex = 2; this.radLinkAssets.Text = "Link to Assets"; this.radLinkAssets.UseVisualStyleBackColor = true; + this.radLinkAssets.CheckedChanged += new System.EventHandler(this.RadLinkAssets_CheckedChanged); // // radCopyAssets // @@ -434,7 +470,7 @@ private void InitializeComponent() // this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.groupBox6.Controls.Add(this.groupBox7); + this.groupBox6.Controls.Add(this.gbApplicationPath); this.groupBox6.Controls.Add(this.radLinkApplication); this.groupBox6.Controls.Add(this.radCopyApplication); this.groupBox6.Location = new System.Drawing.Point(305, 208); @@ -444,6 +480,41 @@ private void InitializeComponent() this.groupBox6.TabStop = false; this.groupBox6.Text = "Application Export"; // + // gbApplicationPath + // + this.gbApplicationPath.Controls.Add(this.radioButton2); + this.gbApplicationPath.Controls.Add(this.radAbsoluteApplication); + this.gbApplicationPath.Location = new System.Drawing.Point(6, 62); + this.gbApplicationPath.Name = "gbApplicationPath"; + this.gbApplicationPath.Size = new System.Drawing.Size(115, 68); + this.gbApplicationPath.TabIndex = 5; + this.gbApplicationPath.TabStop = false; + this.gbApplicationPath.Text = "Path"; + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Enabled = false; + this.radioButton2.Location = new System.Drawing.Point(16, 42); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(64, 17); + this.radioButton2.TabIndex = 5; + this.radioButton2.Text = "Relative"; + this.radioButton2.UseVisualStyleBackColor = true; + // + // radAbsoluteApplication + // + this.radAbsoluteApplication.AutoSize = true; + this.radAbsoluteApplication.Checked = true; + this.radAbsoluteApplication.Enabled = false; + this.radAbsoluteApplication.Location = new System.Drawing.Point(16, 19); + this.radAbsoluteApplication.Name = "radAbsoluteApplication"; + this.radAbsoluteApplication.Size = new System.Drawing.Size(69, 17); + this.radAbsoluteApplication.TabIndex = 4; + this.radAbsoluteApplication.TabStop = true; + this.radAbsoluteApplication.Text = "Absolute."; + this.radAbsoluteApplication.UseVisualStyleBackColor = true; + // // radLinkApplication // this.radLinkApplication.AutoSize = true; @@ -453,6 +524,7 @@ private void InitializeComponent() this.radLinkApplication.TabIndex = 4; this.radLinkApplication.Text = "Link to Application"; this.radLinkApplication.UseVisualStyleBackColor = true; + this.radLinkApplication.CheckedChanged += new System.EventHandler(this.RadLinkApplication_CheckedChanged); // // radCopyApplication // @@ -466,72 +538,6 @@ private void InitializeComponent() this.radCopyApplication.Text = "Copy Application"; this.radCopyApplication.UseVisualStyleBackColor = true; // - // groupBox7 - // - this.groupBox7.Controls.Add(this.radioButton2); - this.groupBox7.Controls.Add(this.radAbsoluteApplication); - this.groupBox7.Location = new System.Drawing.Point(6, 62); - this.groupBox7.Name = "groupBox7"; - this.groupBox7.Size = new System.Drawing.Size(115, 68); - this.groupBox7.TabIndex = 5; - this.groupBox7.TabStop = false; - this.groupBox7.Text = "Path"; - // - // radAbsoluteApplication - // - this.radAbsoluteApplication.AutoSize = true; - this.radAbsoluteApplication.Checked = true; - this.radAbsoluteApplication.Location = new System.Drawing.Point(16, 19); - this.radAbsoluteApplication.Name = "radAbsoluteApplication"; - this.radAbsoluteApplication.Size = new System.Drawing.Size(69, 17); - this.radAbsoluteApplication.TabIndex = 4; - this.radAbsoluteApplication.TabStop = true; - this.radAbsoluteApplication.Text = "Absolute."; - this.radAbsoluteApplication.UseVisualStyleBackColor = true; - // - // radioButton2 - // - this.radioButton2.AutoSize = true; - this.radioButton2.Location = new System.Drawing.Point(16, 42); - this.radioButton2.Name = "radioButton2"; - this.radioButton2.Size = new System.Drawing.Size(64, 17); - this.radioButton2.TabIndex = 5; - this.radioButton2.Text = "Relative"; - this.radioButton2.UseVisualStyleBackColor = true; - // - // groupBox8 - // - this.groupBox8.Controls.Add(this.radioButton3); - this.groupBox8.Controls.Add(this.radAbsoluteAssets); - this.groupBox8.Location = new System.Drawing.Point(177, 62); - this.groupBox8.Name = "groupBox8"; - this.groupBox8.Size = new System.Drawing.Size(107, 68); - this.groupBox8.TabIndex = 6; - this.groupBox8.TabStop = false; - this.groupBox8.Text = "Path"; - // - // radioButton3 - // - this.radioButton3.AutoSize = true; - this.radioButton3.Location = new System.Drawing.Point(16, 42); - this.radioButton3.Name = "radioButton3"; - this.radioButton3.Size = new System.Drawing.Size(64, 17); - this.radioButton3.TabIndex = 5; - this.radioButton3.Text = "Relative"; - this.radioButton3.UseVisualStyleBackColor = true; - // - // radAbsoluteAssets - // - this.radAbsoluteAssets.AutoSize = true; - this.radAbsoluteAssets.Checked = true; - this.radAbsoluteAssets.Location = new System.Drawing.Point(16, 19); - this.radAbsoluteAssets.Name = "radAbsoluteAssets"; - this.radAbsoluteAssets.Size = new System.Drawing.Size(66, 17); - this.radAbsoluteAssets.TabIndex = 4; - this.radAbsoluteAssets.TabStop = true; - this.radAbsoluteAssets.Text = "Absolute"; - this.radAbsoluteAssets.UseVisualStyleBackColor = true; - // // frmPegasusExport // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -552,6 +558,8 @@ private void InitializeComponent() this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + this.gbAssetPath.ResumeLayout(false); + this.gbAssetPath.PerformLayout(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvPlatforms)).EndInit(); @@ -561,10 +569,8 @@ private void InitializeComponent() this.panel1.ResumeLayout(false); this.groupBox6.ResumeLayout(false); this.groupBox6.PerformLayout(); - this.groupBox7.ResumeLayout(false); - this.groupBox7.PerformLayout(); - this.groupBox8.ResumeLayout(false); - this.groupBox8.PerformLayout(); + this.gbApplicationPath.ResumeLayout(false); + this.gbApplicationPath.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -606,10 +612,10 @@ private void InitializeComponent() private System.Windows.Forms.GroupBox groupBox6; private System.Windows.Forms.RadioButton radLinkApplication; private System.Windows.Forms.RadioButton radCopyApplication; - private System.Windows.Forms.GroupBox groupBox8; + private System.Windows.Forms.GroupBox gbAssetPath; private System.Windows.Forms.RadioButton radioButton3; private System.Windows.Forms.RadioButton radAbsoluteAssets; - private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.GroupBox gbApplicationPath; private System.Windows.Forms.RadioButton radioButton2; private System.Windows.Forms.RadioButton radAbsoluteApplication; } diff --git a/PegasusExportPlugin/frmPegasusExport.cs b/PegasusExportPlugin/frmPegasusExport.cs index c15ff8f..7bf9a96 100644 --- a/PegasusExportPlugin/frmPegasusExport.cs +++ b/PegasusExportPlugin/frmPegasusExport.cs @@ -16,11 +16,11 @@ using Unbroken; using Unbroken.LaunchBox.Plugins; using Unbroken.LaunchBox.Plugins.Data; -using Resources = PegasusExportPlugin.Properties.Resources; +using PegasusExportPlugin.Extensions; namespace PegasusExportPlugin { - public partial class frmPegasusExport : Form, ISystemMenuItemPlugin + public partial class frmPegasusExport : Form { public frmPegasusExport() { @@ -30,27 +30,16 @@ public frmPegasusExport() private IDataManager _dataManager = PluginHelper.DataManager; private Dictionary _imageTypeDictionary = new Dictionary(); - public string Caption => "Pegasus Export"; - - public Image IconImage => Resources.favicon96; - - public bool ShowInLaunchBox => true; - - public bool ShowInBigBox => false; - - public bool AllowInBigBoxWhenLocked => false; - - public void OnSelected() - { - Show(); - } + public string GetRelativePath(string relativeTo, string path) { - if(!relativeTo.EndsWith(Path.DirectorySeparatorChar.ToString())) + path = Path.GetFullPath(path); + if (!relativeTo.EndsWith(Path.DirectorySeparatorChar)) { relativeTo += Path.DirectorySeparatorChar; } + var uri = new Uri(relativeTo); var rel = Uri.UnescapeDataString(uri.MakeRelativeUri(new Uri(path)).ToString()).Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); if (rel.Contains(Path.DirectorySeparatorChar.ToString()) == false) @@ -94,9 +83,9 @@ private async void BtnExport_Click(object sender, EventArgs e) try { - bool exportAssets = chkAssets.Checked; - bool exportMetadata = chkMetaData.Checked; - bool exportApplication = chkApplication.Checked; + bool exportAssetsChecked = chkAssets.Checked; + bool exportMetadataChecked = chkMetaData.Checked; + bool exportApplicationChecked = chkApplication.Checked; bool copyAssets = radCopyAssets.Checked; bool copyApplication = radCopyApplication.Checked; bool assetsAbsolutePath = radAbsoluteAssets.Checked; @@ -123,7 +112,15 @@ await Task.Run(() => var platformPath = Path.Combine(selectedFolder, platformFolderName); Directory.CreateDirectory(platformPath); var metadataBuilder = new StringBuilder(); - metadataBuilder.AppendLine($"collection: {platform}"); + + bool exportAssets = exportAssetsChecked && platformAssetExportList.Contains(platform); + bool exportApplication = exportApplicationChecked && platformApplicationExportList.Contains(platform); + bool exportMetadata = (exportMetadataChecked && platformMetadataExportList.Contains(platform)) || (exportApplication && !copyApplication) || (exportAssets && !copyAssets); + + if (exportMetadata) + { + metadataBuilder.AppendLine($"collection: {platform}"); + } var gamesMetadata = new Dictionary(); var imageList = new Dictionary>>(); @@ -136,7 +133,7 @@ await Task.Run(() => foreach (var game in gamePlatform) { - if ((exportMetadata && platformMetadataExportList.Contains(platform)) || (exportAssets && platformAssetExportList.Contains(platform) && !copyAssets)) + if (exportMetadata) { var gameMetadataBuilder = new StringBuilder(); @@ -159,7 +156,7 @@ await Task.Run(() => } else { - file = GetRelativePath(platformPath, Path.GetFullPath(game.ApplicationPath)); + file = GetRelativePath(platformPath, game.ApplicationPath); } } gameMetadataBuilder.AppendLine($"file: {file}"); @@ -209,7 +206,7 @@ await Task.Run(() => } } - if (exportAssets && platformAssetExportList.Contains(platform)) + if (exportAssets) { var mediaFolder = Path.Combine(platformPath, "media", Path.GetFileNameWithoutExtension(game.ApplicationPath)); @@ -278,14 +275,21 @@ await Task.Run(() => } else { - gamesMetadata[game].AppendLine($@"assets.{PegasusAssetType.Video}: {video}"); + if (assetsAbsolutePath) + { + gamesMetadata[game].AppendLine($@"assets.{PegasusAssetType.Video}: {Path.GetFullPath(video)}"); + } + else + { + gamesMetadata[game].AppendLine($@"assets.{PegasusAssetType.Video}: {GetRelativePath(platformPath, video)}"); + } } } } } //Export Roms - if (copyApplication && exportApplication && platformApplicationExportList.Contains(platform)) + if (copyApplication && exportApplication) { if (!string.IsNullOrWhiteSpace(game.ApplicationPath) && File.Exists(game.ApplicationPath)) { @@ -303,7 +307,7 @@ await Task.Run(() => BeginInvoke(new MethodInvoker(() => { - progressBar.Value = (int)(progress / (double)numberOfGames * 100); + progressBar.Value = (int)((progress / (double)numberOfGames) * 100); })); } @@ -316,16 +320,18 @@ await Task.Run(() => var mediaFolder = Path.Combine(platformPath, "media", Path.GetFileNameWithoutExtension(game.Key.ApplicationPath)); + ImageDetails exportImage; + if (pegasusImageType == PegasusAssetType.BoxFront) { - ImageDetails bestImage = game.Value.First().Image; + exportImage = game.Value.First().Image; double? minDifference = null; foreach(var imageDetail in game.Value) { var difference = Math.Abs(boxFrontAspectRatioMode - imageDetail.AspectRatio); if(difference == 0) { - bestImage = imageDetail.Image; + exportImage = imageDetail.Image; break; } else @@ -333,44 +339,39 @@ await Task.Run(() => if(minDifference is null || difference < minDifference) { minDifference = difference; - bestImage = imageDetail.Image; + exportImage = imageDetail.Image; } } } - - if (copyAssets) - { - Directory.CreateDirectory(mediaFolder); - File.Copy(bestImage.FilePath, - Path.Combine(mediaFolder, pegasusImageType + Path.GetExtension(bestImage.FilePath)), - true); - } - else - { - gamesMetadata[game.Key].AppendLine($@"assets.{pegasusImageType}: {bestImage.FilePath}"); - } - } else { - var firstImage = game.Value.First().Image; - if (copyAssets) + exportImage = game.Value.First().Image; + } + + if (copyAssets) + { + Directory.CreateDirectory(mediaFolder); + File.Copy(exportImage.FilePath, + Path.Combine(mediaFolder, pegasusImageType + Path.GetExtension(exportImage.FilePath)), + true); + } + else + { + if (assetsAbsolutePath) { - Directory.CreateDirectory(mediaFolder); - File.Copy(firstImage.FilePath, - Path.Combine(mediaFolder, pegasusImageType + Path.GetExtension(firstImage.FilePath)), - true); + gamesMetadata[game.Key].AppendLine($@"assets.{pegasusImageType}: {Path.GetFullPath(exportImage.FilePath)}"); } else { - gamesMetadata[game.Key].AppendLine($@"assets.{pegasusImageType}: {firstImage.FilePath}"); + gamesMetadata[game.Key].AppendLine($@"assets.{pegasusImageType}: {GetRelativePath(platformPath,exportImage.FilePath)}"); } } } } //Export Metadata - if ((exportMetadata && platformMetadataExportList.Contains(platform)) || (exportAssets && platformAssetExportList.Contains(platform) && !copyAssets)) + if (exportMetadata) { if (fileExtensions.Count > 0) { @@ -461,5 +462,25 @@ private void FrmPegasusExport_Load(object sender, EventArgs e) ((DataGridViewCheckBoxColumnHeaderCell)colSelected.HeaderCell).Select(true); } + + private void RadLinkAssets_CheckedChanged(object sender, EventArgs e) + { + var radChecked = radLinkAssets.Checked; + foreach (var control in gbAssetPath.Controls) + { + var radio = control as RadioButton; + radio.Enabled = radChecked; + } + } + + private void RadLinkApplication_CheckedChanged(object sender, EventArgs e) + { + var radChecked = radLinkApplication.Checked; + foreach(var control in gbApplicationPath.Controls) + { + var radio = control as RadioButton; + radio.Enabled = radChecked; + } + } } } \ No newline at end of file