Plugin stuff, open multiple files at a time, bugfix

This commit is contained in:
Gericom 2014-11-06 19:16:24 +01:00
parent 4adb414a72
commit cabb11d440
10 changed files with 130 additions and 52 deletions

View File

@ -35,6 +35,7 @@
this.tabPage1 = new System.Windows.Forms.TabPage();
this.treeView1 = new System.Windows.Forms.TreeView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.treeView2 = new System.Windows.Forms.TreeView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.tabPage5 = new System.Windows.Forms.TabPage();
@ -42,7 +43,6 @@
this.simpleOpenGlControl1 = new Tao.Platform.Windows.SimpleOpenGlControl();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.mainMenu1 = new LibEveryFileExplorer.UI.MainMenu(this.components);
this.treeView2 = new System.Windows.Forms.TreeView();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@ -138,6 +138,16 @@
this.tabPage2.Text = "Groups";
this.tabPage2.UseVisualStyleBackColor = true;
//
// treeView2
//
this.treeView2.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView2.HideSelection = false;
this.treeView2.HotTracking = true;
this.treeView2.Location = new System.Drawing.Point(0, 0);
this.treeView2.Name = "treeView2";
this.treeView2.Size = new System.Drawing.Size(186, 156);
this.treeView2.TabIndex = 0;
//
// tabPage3
//
this.tabPage3.Location = new System.Drawing.Point(4, 22);
@ -200,16 +210,6 @@
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// treeView2
//
this.treeView2.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView2.HideSelection = false;
this.treeView2.HotTracking = true;
this.treeView2.Location = new System.Drawing.Point(0, 0);
this.treeView2.Name = "treeView2";
this.treeView2.Size = new System.Drawing.Size(186, 156);
this.treeView2.TabIndex = 0;
//
// CLYTViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -219,6 +219,7 @@
this.Menu = this.mainMenu1;
this.Name = "CLYTViewer";
this.Text = "CLYTViewer";
this.Activated += new System.EventHandler(this.CLYTViewer_Activated);
this.Load += new System.EventHandler(this.CLYTViewer_Load);
this.Layout += new System.Windows.Forms.LayoutEventHandler(this.CLYTViewer_Layout);
this.Resize += new System.EventHandler(this.CLYTViewer_Resize);

View File

@ -231,5 +231,10 @@ namespace _3DS.UI
Render();
Render();
}
private void CLYTViewer_Activated(object sender, EventArgs e)
{
for (int i = 0; i < 8; i++) Render();
}
}
}

View File

@ -36,6 +36,9 @@
<PropertyGroup>
<ApplicationIcon>Propeller_Box_Artwork_-_Super_Mario_3D_World.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>EveryFileExplorer.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@ -34,14 +34,22 @@
this.menuFile = new System.Windows.Forms.MenuItem();
this.menuNew = new System.Windows.Forms.MenuItem();
this.menuFileNew = new System.Windows.Forms.MenuItem();
this.menuItem10 = new System.Windows.Forms.MenuItem();
this.menuItem11 = new System.Windows.Forms.MenuItem();
this.menuOpen = new System.Windows.Forms.MenuItem();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem8 = new System.Windows.Forms.MenuItem();
this.menuClose = new System.Windows.Forms.MenuItem();
this.menuItem9 = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.menuSave = new System.Windows.Forms.MenuItem();
this.menuSaveAs = new System.Windows.Forms.MenuItem();
this.menuItem7 = new System.Windows.Forms.MenuItem();
this.menuExit = new System.Windows.Forms.MenuItem();
this.menuEdit = new System.Windows.Forms.MenuItem();
this.menuProject = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.menuTools = new System.Windows.Forms.MenuItem();
this.menuCompression = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
@ -59,9 +67,6 @@
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.panel2 = new System.Windows.Forms.Panel();
this.splitter1 = new System.Windows.Forms.Splitter();
this.menuProject = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.panel1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
@ -82,8 +87,13 @@
this.menuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuNew,
this.menuFileNew,
this.menuItem10,
this.menuItem11,
this.menuOpen,
this.menuItem1,
this.menuItem8,
this.menuClose,
this.menuItem9,
this.menuItem5,
this.menuSave,
this.menuSaveAs,
@ -101,46 +111,72 @@
this.menuFileNew.Index = 1;
this.menuFileNew.Text = "New from File";
//
// menuItem10
//
this.menuItem10.Index = 2;
this.menuItem10.Text = "New Project";
//
// menuItem11
//
this.menuItem11.Index = 3;
this.menuItem11.Text = "-";
//
// menuOpen
//
this.menuOpen.Index = 2;
this.menuOpen.Index = 4;
this.menuOpen.Text = "Open...";
this.menuOpen.Click += new System.EventHandler(this.OpenFile);
//
// menuItem1
//
this.menuItem1.Index = 5;
this.menuItem1.Text = "Open Project...";
//
// menuItem8
//
this.menuItem8.Index = 6;
this.menuItem8.Text = "-";
//
// menuClose
//
this.menuClose.Enabled = false;
this.menuClose.Index = 3;
this.menuClose.Index = 7;
this.menuClose.Text = "Close";
this.menuClose.Click += new System.EventHandler(this.menuClose_Click);
//
// menuItem9
//
this.menuItem9.Enabled = false;
this.menuItem9.Index = 8;
this.menuItem9.Text = "Close Project";
//
// menuItem5
//
this.menuItem5.Index = 4;
this.menuItem5.Index = 9;
this.menuItem5.Text = "-";
//
// menuSave
//
this.menuSave.Enabled = false;
this.menuSave.Index = 5;
this.menuSave.Index = 10;
this.menuSave.Text = "Save";
this.menuSave.Click += new System.EventHandler(this.SaveFile);
//
// menuSaveAs
//
this.menuSaveAs.Enabled = false;
this.menuSaveAs.Index = 6;
this.menuSaveAs.Index = 11;
this.menuSaveAs.Text = "Save As...";
this.menuSaveAs.Click += new System.EventHandler(this.menuSaveAs_Click);
//
// menuItem7
//
this.menuItem7.Index = 7;
this.menuItem7.Index = 12;
this.menuItem7.Text = "-";
//
// menuExit
//
this.menuExit.Index = 8;
this.menuExit.Index = 13;
this.menuExit.Text = "Exit";
this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
//
@ -151,6 +187,29 @@
this.menuEdit.MergeType = System.Windows.Forms.MenuMerge.MergeItems;
this.menuEdit.Text = "Edit";
//
// menuProject
//
this.menuProject.Index = 2;
this.menuProject.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem3,
this.menuItem6});
this.menuProject.MergeOrder = 2;
this.menuProject.MergeType = System.Windows.Forms.MenuMerge.MergeItems;
this.menuProject.Text = "Project";
this.menuProject.Visible = false;
//
// menuItem3
//
this.menuItem3.Index = 0;
this.menuItem3.Shortcut = System.Windows.Forms.Shortcut.F6;
this.menuItem3.Text = "Build";
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.Shortcut = System.Windows.Forms.Shortcut.F5;
this.menuItem6.Text = "Build and Run";
//
// menuTools
//
this.menuTools.Index = 3;
@ -215,6 +274,7 @@
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
this.openFileDialog1.Multiselect = true;
//
// panel1
//
@ -276,29 +336,6 @@
this.splitter1.TabStop = false;
this.splitter1.Visible = false;
//
// menuProject
//
this.menuProject.Index = 2;
this.menuProject.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem3,
this.menuItem6});
this.menuProject.MergeOrder = 2;
this.menuProject.MergeType = System.Windows.Forms.MenuMerge.MergeItems;
this.menuProject.Text = "Project";
this.menuProject.Visible = false;
//
// menuItem3
//
this.menuItem3.Index = 0;
this.menuItem3.Shortcut = System.Windows.Forms.Shortcut.F6;
this.menuItem3.Text = "Build";
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.Shortcut = System.Windows.Forms.Shortcut.F5;
this.menuItem6.Text = "Build and Run";
//
// Form1
//
this.AllowDrop = true;
@ -361,6 +398,11 @@
private System.Windows.Forms.MenuItem menuProject;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem8;
private System.Windows.Forms.MenuItem menuItem9;
private System.Windows.Forms.MenuItem menuItem10;
private System.Windows.Forms.MenuItem menuItem11;
}
}

View File

@ -171,7 +171,10 @@ namespace EveryFileExplorer
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK
&& openFileDialog1.FileName.Length > 0)
{
Program.FileManager.OpenFile(new EFEDiskFile(openFileDialog1.FileName));
foreach (String s in openFileDialog1.FileNames)
{
Program.FileManager.OpenFile(new EFEDiskFile(s));
}
}
opening = false;
}

View File

@ -126,9 +126,6 @@
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>379, 17</value>
</metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>379, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -15,6 +15,7 @@ namespace EveryFileExplorer.Plugins
public String Version;
public Type[] CompressionTypes;
public Type[] FileFormatTypes;
public Type[] ProjectTypes;
public Plugin(Assembly Assembly)
{
@ -31,15 +32,18 @@ namespace EveryFileExplorer.Plugins
Type[] tt = Assembly.GetExportedTypes();
List<Type> fe = new List<Type>();
List<Type> ce = new List<Type>();
List<Type> pe = new List<Type>();
foreach (var t in tt)
{
if (!t.IsClass) continue;
var v = t.GetInterfaces();
if (v.Length != 0 && t.GetInterfaces()[0].Name == "FileFormatBase") fe.Add(t);
else if (v.Length != 0 && t.GetInterfaces()[0].Name == "CompressionFormatBase") ce.Add(t);
else if (v.Length != 0 && t.GetInterfaces()[0].Name == "ProjectBase") pe.Add(t);
}
FileFormatTypes = fe.ToArray();
CompressionTypes = ce.ToArray();
ProjectTypes = pe.ToArray();
}
public static bool IsPlugin(Assembly Assembly)
@ -49,7 +53,7 @@ namespace EveryFileExplorer.Plugins
{
if (!t.IsClass) continue;
var v = t.GetInterfaces();
if (v.Length != 0 && (t.GetInterfaces()[0].Name == "FileFormatBase" || t.GetInterfaces()[0].Name == "CompressionFormatBase")) return true;
if (v.Length != 0 && (t.GetInterfaces()[0].Name == "FileFormatBase" || t.GetInterfaces()[0].Name == "CompressionFormatBase" || t.GetInterfaces()[0].Name == "ProjectBase")) return true;
}
return false;
}

View File

@ -6,8 +6,8 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Every File Explorer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("Takes hacking to a higher level!")]
[assembly: AssemblyConfiguration("Devbuild")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Every File Explorer")]
[assembly: AssemblyCopyright("Copyright © Florian Nouwt 2014")]

View File

@ -6,8 +6,23 @@ using System.Windows.Forms;
namespace LibEveryFileExplorer.Projects
{
public abstract class Project
public interface ProjectBase
{
String ProjectDirectory { get; }
bool CanRun { get; }
Control GetProjectControl();
void Build();
void Run();
void SaveProjectFile();
}
public abstract class Project<T> : ProjectBase where T : ProjectIdentifier, new()
{
private static T _identifier = new T();
public static T Identifier { get { return _identifier; } }
public Project(String ProjectDir)
{
ProjectDirectory = ProjectDir;
@ -20,5 +35,12 @@ namespace LibEveryFileExplorer.Projects
public abstract void Build();
public abstract void Run();
public abstract void SaveProjectFile();
}
public abstract class ProjectIdentifier
{
public abstract String GetProjectDescription();
public abstract bool IsProject(byte[] Data);
}
}

View File

@ -10,5 +10,6 @@ Just open the project in Visual Studio, and build it. You may need to specify th
* 3DS
* Common Compressors
* Common Files
* Lego Pirates of the Carribean
* Mario Kart
* NDS