diff --git a/ANX.Framework.Content.Pipeline/Tasks/ImporterManager.cs b/ANX.Framework.Content.Pipeline/Tasks/ImporterManager.cs index 042e88ba..00c5770a 100644 --- a/ANX.Framework.Content.Pipeline/Tasks/ImporterManager.cs +++ b/ANX.Framework.Content.Pipeline/Tasks/ImporterManager.cs @@ -26,6 +26,8 @@ namespace ANX.Framework.Content.Pipeline.Tasks foreach (Type type in TypeHelper.SafelyExtractTypesFrom(assembly)) { + if (type == null) + continue; ContentImporterAttribute[] value = (ContentImporterAttribute[])type.GetCustomAttributes(typeof(ContentImporterAttribute), true); if (value.Length > 0) { diff --git a/ANX.Framework/Content/ContentReader.cs b/ANX.Framework/Content/ContentReader.cs index e05e42d4..d54dbd7f 100644 --- a/ANX.Framework/Content/ContentReader.cs +++ b/ANX.Framework/Content/ContentReader.cs @@ -458,7 +458,10 @@ namespace ANX.Framework.Content var service = this.ContentManager.ServiceProvider.GetService(typeof(IGraphicsDeviceService)) as IGraphicsDeviceService; if (service == null) { - throw new ContentLoadException("Service not found: IGraphicsDeviceService"); + var device2 = ContentManager.ServiceProvider.GetService(typeof (GraphicsDevice)) as GraphicsDevice; + if (device2 == null) + throw new ContentLoadException("Service not found: IGraphicsDeviceService"); + return device2; } var device = service.GraphicsDevice; if (device == null) diff --git a/Tools/ProjectConverter/GUI/MainWindow.Designer.cs b/Tools/ProjectConverter/GUI/MainWindow.Designer.cs index 02ed098a..b4c56075 100644 --- a/Tools/ProjectConverter/GUI/MainWindow.Designer.cs +++ b/Tools/ProjectConverter/GUI/MainWindow.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow)); this.textBoxSource = new System.Windows.Forms.TextBox(); this.buttonSearch = new System.Windows.Forms.Button(); this.comboBoxTarget = new System.Windows.Forms.ComboBox(); @@ -40,6 +41,7 @@ this.label3 = new System.Windows.Forms.Label(); this.buttonClose = new System.Windows.Forms.Label(); this.buttonHelp = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // textBoxSource @@ -126,7 +128,7 @@ // buttonConvert // this.buttonConvert.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.buttonConvert.Location = new System.Drawing.Point(100, 221); + this.buttonConvert.Location = new System.Drawing.Point(101, 236); this.buttonConvert.Name = "buttonConvert"; this.buttonConvert.Size = new System.Drawing.Size(296, 39); this.buttonConvert.TabIndex = 7; @@ -139,10 +141,11 @@ this.textBoxDestination.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.textBoxDestination.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.textBoxDestination.ForeColor = System.Drawing.Color.White; - this.textBoxDestination.Location = new System.Drawing.Point(59, 193); + this.textBoxDestination.Location = new System.Drawing.Point(59, 206); this.textBoxDestination.Name = "textBoxDestination"; this.textBoxDestination.Size = new System.Drawing.Size(321, 22); this.textBoxDestination.TabIndex = 9; + this.textBoxDestination.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // buttonSearch2 // @@ -150,7 +153,7 @@ this.buttonSearch2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.buttonSearch2.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.buttonSearch2.ForeColor = System.Drawing.Color.White; - this.buttonSearch2.Location = new System.Drawing.Point(386, 193); + this.buttonSearch2.Location = new System.Drawing.Point(386, 206); this.buttonSearch2.Name = "buttonSearch2"; this.buttonSearch2.Size = new System.Drawing.Size(68, 22); this.buttonSearch2.TabIndex = 10; @@ -197,12 +200,22 @@ this.buttonHelp.MouseEnter += new System.EventHandler(this.LabelMouseEnter); this.buttonHelp.MouseLeave += new System.EventHandler(this.LabelMouseLeave); // + // label4 + // + this.label4.Location = new System.Drawing.Point(61, 177); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(393, 27); + this.label4.TabIndex = 15; + this.label4.Text = "The converted file(s) will be placed in here:"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // MainWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.ClientSize = new System.Drawing.Size(496, 269); + this.ClientSize = new System.Drawing.Size(496, 287); + this.Controls.Add(this.label4); this.Controls.Add(this.buttonHelp); this.Controls.Add(this.buttonClose); this.Controls.Add(this.label3); @@ -218,6 +231,7 @@ this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ForeColor = System.Drawing.Color.White; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "MainWindow"; this.Text = "ANX Project Converter"; @@ -240,5 +254,6 @@ private System.Windows.Forms.Label label3; private System.Windows.Forms.Label buttonHelp; private System.Windows.Forms.Label buttonClose; + private System.Windows.Forms.Label label4; } } \ No newline at end of file diff --git a/Tools/ProjectConverter/GUI/MainWindow.cs b/Tools/ProjectConverter/GUI/MainWindow.cs index 5b89150c..f5a9c7ca 100644 --- a/Tools/ProjectConverter/GUI/MainWindow.cs +++ b/Tools/ProjectConverter/GUI/MainWindow.cs @@ -103,26 +103,26 @@ namespace ProjectConverter.GUI "All supported files (*.sln, *.csproj, *.contentproj, *.cproj) | *sln; *.csproj; *.contentproj; *.cproj"; openFileDialog.Title = "Select project to convert"; openFileDialog.Multiselect = false; - if (openFileDialog.ShowDialog() == DialogResult.OK) + if (openFileDialog.ShowDialog() != DialogResult.OK) return; + textBoxSource.Text = openFileDialog.FileName; + string fileExt = Path.GetExtension(openFileDialog.FileName).ToLowerInvariant(); + switch (fileExt) { - textBoxSource.Text = openFileDialog.FileName; - string fileExt = Path.GetExtension(openFileDialog.FileName).ToLowerInvariant(); - switch (fileExt) - { - case ".sln": - case ".csproj": - comboBoxType.SelectedIndex = 0; - break; - case ".contentproject": - comboBoxType.SelectedIndex = 1; - comboBoxTarget.SelectedIndex = 0; - break; - case ".cproj": - comboBoxType.SelectedIndex = 1; - comboBoxTarget.SelectedIndex = 1; - break; - } + case ".sln": + case ".csproj": + comboBoxType.SelectedIndex = 0; + comboBoxTarget.SelectedIndex = 0; + break; + case ".contentproject": + comboBoxType.SelectedIndex = 1; + comboBoxTarget.SelectedIndex = 0; + break; + case ".cproj": + comboBoxType.SelectedIndex = 1; + comboBoxTarget.SelectedIndex = 1; + break; } + textBoxDestination.Text = Path.GetDirectoryName(openFileDialog.FileName); } } @@ -132,6 +132,7 @@ namespace ProjectConverter.GUI { folderDialog.ShowNewFolderButton = true; folderDialog.Description = "Select the output folder for the converted project"; + folderDialog.SelectedPath = textBoxDestination.Text; if (folderDialog.ShowDialog() == DialogResult.OK) textBoxDestination.Text = folderDialog.SelectedPath; } diff --git a/Tools/ProjectConverter/GUI/MainWindow.resx b/Tools/ProjectConverter/GUI/MainWindow.resx new file mode 100644 index 00000000..7c86b981 --- /dev/null +++ b/Tools/ProjectConverter/GUI/MainWindow.resx @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAA + AAoHK0S5BytEuQAAAAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wAAAAAKBy1EwhWS5P8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAAAACgctRMIVkuT/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAAAAAoHLUTCFZLk/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wAAAAAKBy1EwhWS5P8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAA + AAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAAAACgctRMIVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed + 9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AAAAAAoHLUTCFZLk/xed9f8XnfX/F531/xed9f8XnfX/F531/xed + 9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAAAAKBy1EwhWS5P8XnfX/F531/xed9f8XnfX/F531/xed + 9f8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAAAACgctRMIVkuT/F531/xed9f8XnfX/F531/xed + 9f8XnfX/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAoHLUTCDFOb/wcvjP8HL4z/By+M/wg3 + iP8Vjt3/EXe6/xJ7wP8VkeL/EG6r/xN/x/8Tf8f/E3/H/xSH0v8XnfX/F531/xed9f8VkuT/By1EwgAA + AAr///8A////AP///wD///8A////AP///wD///8A////AP///wAAAAAKBy1EwhWS5P8OYaz/AACA/wAA + gP8AAID/AAF7/xJ7yf8Se7//F531/xJ8wv8Rd7r/F531/xed9f8XnfX/E3/G/xed9f8XnfX/F531/xed + 9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8AAAAACgctRMIVkuT/F531/xWR + 4/8CCnT/AACA/wAAgP8AAID/DFKj/xJ6vv8XnfX/Enq+/xF3uf8XnfX/F531/xed9f8SfsT/F531/xed + 9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AAAAAAoHLUTCFZLk/xed + 9f8XnfX/F531/wYogf8AAID/AACA/wAAgP8GLYj/FY7e/xN/x/8UhtH/FpPm/xJ7wf8Se8H/EnvB/xJ9 + w/8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wAAAAAKBy1EwhWS + 5P8XnfX/F531/xed9f8XnfX/C0ma/wAAgP8AAID/AACA/wIMc/8Wluv/F531/xed9f8Wk+b/AxFi/wIL + cf8CC3H/Agtx/xBstv8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8AAAAACgct + RMIVkuT/F531/xed9f8XnfX/F531/xed9f8Qbrj/AAB9/wAAgP8AAID/AAB//w5ksP8XnfX/F531/xed + 9f8FJH3/AACA/wAAgP8AAID/C0mb/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAA + AAoHK0S5FZLk/xed9f8XnfX/F531/xed9f8XnfX/F531/xaZ7/8CEXT/AACA/wAAgP8AAID/BSd//wpE + l/8KQ5b/CUKV/wUeev8AAID/AACA/wAAgP8GKoP/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed + 9f8VkuT/BytEuQcrRLkVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/wcxif8AAID/AACA/wAA + gP8AAID/AACA/wAAgP8AAID/AACA/wAAgP8AAID/AACA/wILdP8Wkub/F531/xed9f8XnfX/F531/xed + 9f8XnfX/F531/xWS5P8HK0S5AAAACgcrRMIVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/DFKi/wAA + gP8AAID/AACA/wAAf/8DF3f/BB18/wUhf/8GJID/AQZ6/wAAgP8AAID/AACA/w9lr/8XnfX/F531/xed + 9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8AAAAACgcrRMIVkuT/F531/xed9f8XnfX/F531/xed + 9f8Se8j/AAF5/wAAgP8AAID/AACA/w5dp/8XnfX/F531/xed9f8FI37/AACA/wAAgP8AAID/CkSW/xed + 9f8XnfX/F531/xed9f8XnfX/FZLk/wctRMIAAAAK////AP///wD///8AAAAACgcrQ8MVkuT/F531/xed + 9f8XnfX/F531/xed9f8EGHf/AACA/wAAgP8AAID/Bid9/xeb8v8XnfX/F531/wlAlf8AAID/AACA/wAA + gP8FJH7/F531/xed9f8XnfX/F531/xWS5P8HLUTCAAAACv///wD///8A////AP///wD///8AAAAACgcr + Q8MVkuT/F531/xed9f8XnfX/F531/wtJmf8AAID/AACA/wAAgP8AAH7/BSOA/wk9lf8JP5f/BimA/wAA + gP8AAID/AACA/wEHdv8VjNv/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP// + /wD///8AAAAACgcrQ8MVkuT/F531/xed9f8XnfX/FpLm/wITd/8AAID/AACA/wAAgP8AAID/AACA/wAA + gP8AAID/AACA/wAAgP8AAID/AACA/w5eqf8XnfX/FZLk/wctRMIAAAAK////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAAAACgcrQ8MVkuT/F531/xed9f8XnfX/DFOh/wEHdv8AAID/AACA/wAA + gP8AAID/AACA/wAAgP8AAID/AACA/wAAgP8AAID/CT6S/xWS5P8HLUTCAAAACv///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAAAACwcrQ8MVkuT/F531/xed9f8XnfX/FY/h/w5f + q/8JQZT/CTuQ/wk6kP8JOY7/CDeN/wg2jP8IN43/CTmP/wk7kP8KRo7/By1EwgAAAAr///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAAAACwcrQ8MVkuT/F531/xed + 9f8XnfX/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8XnfX/FZLk/wctRMIAAAAK////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAAAACwcr + QsQVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xWS5P8HLUTCAAAACv// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAAAACwcrQsQVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAA + AAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAAAACwcrQsQVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/FZLk/wct + RMIAAAAK////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAAAACwcqQcQVkuT/F531/xed9f8XnfX/F531/xWS + 5P8HLUTCAAAACv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAAAADAcqQcQVkuT/F531/xed + 9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAAAADAYp + QcUVkuT/FZLk/wctRMIAAAAK////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAAAADAcpQLsHK0S5AAAACv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A//5////8P///+B////AP///gB///wAP//4AB//8AAP/+AAB//AAAP/gA + AB/wAAAP4AAAB8AAAAOAAAABAAAAAAAAAACAAAABwAAAA+AAAAfwAAAP+AAAH/wAAD/+AAB//wAA//+A + Af//wAP//+AH///wD///+B////w////+f/8= + + + \ No newline at end of file