Various fixes and improvements

This commit is contained in:
Michael Becker 2015-04-20 15:26:29 -04:00
parent 75fa8fe5ae
commit 543bc0371d
5 changed files with 249 additions and 140 deletions

View File

@ -194,6 +194,17 @@ namespace UniversalEditor.UserInterface.WindowsForms.Pages
{
this.Document = document;
if (System.IO.Directory.Exists(document.Accessor.GetFileName()))
{
// we're looking at a directory, so create a FileSystemObjectModel for it
FileSystemObjectModel fsom = FileSystemObjectModel.FromDirectory(document.Accessor.GetFileName());
Document = new Document(fsom, null, null);
NotifyOnFileOpened(this, EventArgs.Empty);
RefreshEditor();
return;
}
System.Threading.Thread tOpenFile = new System.Threading.Thread(tOpenFile_ThreadStart);
tOpenFile.Start();
}

View File

@ -28,24 +28,26 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("General");
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("General");
this.tv = new System.Windows.Forms.TreeView();
this.pnlGeneral = new System.Windows.Forms.Panel();
this.fraGeneralInformation = new System.Windows.Forms.GroupBox();
this.txtGeneralInformationSize = new System.Windows.Forms.TextBox();
this.lblGeneralInformationSize = new System.Windows.Forms.Label();
this.lblGeneralInformationDataFormat = new System.Windows.Forms.Label();
this.txtGeneralInformationDataFormat = new System.Windows.Forms.TextBox();
this.cmdGeneralInformationDataFormatChange = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.lblGeneralInformationDateCreated = new System.Windows.Forms.Label();
this.lblGeneralInformationDateModified = new System.Windows.Forms.Label();
this.lblGeneralInformationDateAccessed = new System.Windows.Forms.Label();
this.txtGeneralInformationDateCreated = new System.Windows.Forms.TextBox();
this.txtGeneralInformationDateModified = new System.Windows.Forms.TextBox();
this.txtGeneralInformationDateAccessed = new System.Windows.Forms.TextBox();
this.txtGeneralInformationLocation = new System.Windows.Forms.TextBox();
this.lblGeneralInformationDateAccessed = new System.Windows.Forms.Label();
this.lblGeneralInformationDateModified = new System.Windows.Forms.Label();
this.txtGeneralInformationDateModified = new System.Windows.Forms.TextBox();
this.lblGeneralInformationDateCreated = new System.Windows.Forms.Label();
this.txtGeneralInformationSize = new System.Windows.Forms.TextBox();
this.txtGeneralInformationDateCreated = new System.Windows.Forms.TextBox();
this.lblGeneralInformationObjectModel = new System.Windows.Forms.Label();
this.lblGeneralInformationDataFormat = new System.Windows.Forms.Label();
this.lblGeneralInformationSize = new System.Windows.Forms.Label();
this.txtGeneralInformationObjectModel = new System.Windows.Forms.TextBox();
this.txtGeneralInformationDataFormat = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.cmdGeneralInformationDataFormatChange = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.txtGeneralInformationLocation = new System.Windows.Forms.TextBox();
this.fraAttributes = new System.Windows.Forms.GroupBox();
this.chkGeneralAttributesArchive = new System.Windows.Forms.CheckBox();
this.chkGeneralAttributesHidden = new System.Windows.Forms.CheckBox();
@ -57,8 +59,8 @@
this.cmdOK = new System.Windows.Forms.Button();
this.pnlNoObjectsSelected = new System.Windows.Forms.Panel();
this.lblNoObjectsSelected = new System.Windows.Forms.Label();
this.txtGeneralInformationObjectModel = new System.Windows.Forms.TextBox();
this.lblGeneralInformationObjectModel = new System.Windows.Forms.Label();
this.cmdGeneralInformationLocationChange = new System.Windows.Forms.Button();
this.cmdGeneralInformationLocationBrowse = new System.Windows.Forms.Button();
this.pnlGeneral.SuspendLayout();
this.fraGeneralInformation.SuspendLayout();
this.fraAttributes.SuspendLayout();
@ -75,11 +77,11 @@
this.tv.HideSelection = false;
this.tv.Location = new System.Drawing.Point(0, 0);
this.tv.Name = "tv";
treeNode2.Name = "nodeGeneral";
treeNode2.Text = "General";
treeNode3.Name = "nodeGeneral";
treeNode3.Text = "General";
this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
treeNode2});
this.tv.Size = new System.Drawing.Size(127, 362);
treeNode3});
this.tv.Size = new System.Drawing.Size(127, 373);
this.tv.TabIndex = 0;
//
// pnlGeneral
@ -91,13 +93,13 @@
this.pnlGeneral.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlGeneral.Location = new System.Drawing.Point(0, 0);
this.pnlGeneral.Name = "pnlGeneral";
this.pnlGeneral.Size = new System.Drawing.Size(323, 362);
this.pnlGeneral.Size = new System.Drawing.Size(323, 373);
this.pnlGeneral.TabIndex = 0;
//
// fraGeneralInformation
//
this.fraGeneralInformation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
| System.Windows.Forms.AnchorStyles.Right)));
this.fraGeneralInformation.Controls.Add(this.txtGeneralInformationDateAccessed);
this.fraGeneralInformation.Controls.Add(this.lblGeneralInformationDateAccessed);
this.fraGeneralInformation.Controls.Add(this.lblGeneralInformationDateModified);
@ -111,36 +113,98 @@
this.fraGeneralInformation.Controls.Add(this.txtGeneralInformationObjectModel);
this.fraGeneralInformation.Controls.Add(this.txtGeneralInformationDataFormat);
this.fraGeneralInformation.Controls.Add(this.label2);
this.fraGeneralInformation.Controls.Add(this.cmdGeneralInformationLocationBrowse);
this.fraGeneralInformation.Controls.Add(this.cmdGeneralInformationLocationChange);
this.fraGeneralInformation.Controls.Add(this.cmdGeneralInformationDataFormatChange);
this.fraGeneralInformation.Controls.Add(this.label3);
this.fraGeneralInformation.Controls.Add(this.txtGeneralInformationLocation);
this.fraGeneralInformation.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.fraGeneralInformation.Location = new System.Drawing.Point(7, 45);
this.fraGeneralInformation.Name = "fraGeneralInformation";
this.fraGeneralInformation.Size = new System.Drawing.Size(313, 242);
this.fraGeneralInformation.Size = new System.Drawing.Size(313, 270);
this.fraGeneralInformation.TabIndex = 1;
this.fraGeneralInformation.TabStop = false;
this.fraGeneralInformation.Text = "Information";
//
// txtGeneralInformationDateAccessed
//
this.txtGeneralInformationDateAccessed.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationDateAccessed.Location = new System.Drawing.Point(101, 241);
this.txtGeneralInformationDateAccessed.Name = "txtGeneralInformationDateAccessed";
this.txtGeneralInformationDateAccessed.ReadOnly = true;
this.txtGeneralInformationDateAccessed.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationDateAccessed.TabIndex = 13;
//
// lblGeneralInformationDateAccessed
//
this.lblGeneralInformationDateAccessed.AutoSize = true;
this.lblGeneralInformationDateAccessed.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationDateAccessed.Location = new System.Drawing.Point(13, 244);
this.lblGeneralInformationDateAccessed.Name = "lblGeneralInformationDateAccessed";
this.lblGeneralInformationDateAccessed.Size = new System.Drawing.Size(82, 13);
this.lblGeneralInformationDateAccessed.TabIndex = 12;
this.lblGeneralInformationDateAccessed.Text = "Date accessed:";
//
// lblGeneralInformationDateModified
//
this.lblGeneralInformationDateModified.AutoSize = true;
this.lblGeneralInformationDateModified.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationDateModified.Location = new System.Drawing.Point(13, 218);
this.lblGeneralInformationDateModified.Name = "lblGeneralInformationDateModified";
this.lblGeneralInformationDateModified.Size = new System.Drawing.Size(75, 13);
this.lblGeneralInformationDateModified.TabIndex = 10;
this.lblGeneralInformationDateModified.Text = "Date modified:";
//
// txtGeneralInformationDateModified
//
this.txtGeneralInformationDateModified.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationDateModified.Location = new System.Drawing.Point(101, 215);
this.txtGeneralInformationDateModified.Name = "txtGeneralInformationDateModified";
this.txtGeneralInformationDateModified.ReadOnly = true;
this.txtGeneralInformationDateModified.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationDateModified.TabIndex = 11;
//
// lblGeneralInformationDateCreated
//
this.lblGeneralInformationDateCreated.AutoSize = true;
this.lblGeneralInformationDateCreated.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationDateCreated.Location = new System.Drawing.Point(13, 192);
this.lblGeneralInformationDateCreated.Name = "lblGeneralInformationDateCreated";
this.lblGeneralInformationDateCreated.Size = new System.Drawing.Size(72, 13);
this.lblGeneralInformationDateCreated.TabIndex = 8;
this.lblGeneralInformationDateCreated.Text = "Date created:";
//
// txtGeneralInformationSize
//
this.txtGeneralInformationSize.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationSize.Location = new System.Drawing.Point(101, 126);
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationSize.Location = new System.Drawing.Point(101, 155);
this.txtGeneralInformationSize.Name = "txtGeneralInformationSize";
this.txtGeneralInformationSize.ReadOnly = true;
this.txtGeneralInformationSize.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationSize.TabIndex = 6;
//
// lblGeneralInformationSize
// txtGeneralInformationDateCreated
//
this.lblGeneralInformationSize.AutoSize = true;
this.lblGeneralInformationSize.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationSize.Location = new System.Drawing.Point(13, 129);
this.lblGeneralInformationSize.Name = "lblGeneralInformationSize";
this.lblGeneralInformationSize.Size = new System.Drawing.Size(30, 13);
this.lblGeneralInformationSize.TabIndex = 5;
this.lblGeneralInformationSize.Text = "Size:";
this.txtGeneralInformationDateCreated.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationDateCreated.Location = new System.Drawing.Point(101, 189);
this.txtGeneralInformationDateCreated.Name = "txtGeneralInformationDateCreated";
this.txtGeneralInformationDateCreated.ReadOnly = true;
this.txtGeneralInformationDateCreated.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationDateCreated.TabIndex = 9;
//
// lblGeneralInformationObjectModel
//
this.lblGeneralInformationObjectModel.AutoSize = true;
this.lblGeneralInformationObjectModel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationObjectModel.Location = new System.Drawing.Point(13, 22);
this.lblGeneralInformationObjectModel.Name = "lblGeneralInformationObjectModel";
this.lblGeneralInformationObjectModel.Size = new System.Drawing.Size(72, 13);
this.lblGeneralInformationObjectModel.TabIndex = 0;
this.lblGeneralInformationObjectModel.Text = "Object model:";
//
// lblGeneralInformationDataFormat
//
@ -152,16 +216,46 @@
this.lblGeneralInformationDataFormat.TabIndex = 0;
this.lblGeneralInformationDataFormat.Text = "Data format:";
//
// lblGeneralInformationSize
//
this.lblGeneralInformationSize.AutoSize = true;
this.lblGeneralInformationSize.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationSize.Location = new System.Drawing.Point(13, 158);
this.lblGeneralInformationSize.Name = "lblGeneralInformationSize";
this.lblGeneralInformationSize.Size = new System.Drawing.Size(30, 13);
this.lblGeneralInformationSize.TabIndex = 5;
this.lblGeneralInformationSize.Text = "Size:";
//
// txtGeneralInformationObjectModel
//
this.txtGeneralInformationObjectModel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationObjectModel.Location = new System.Drawing.Point(101, 19);
this.txtGeneralInformationObjectModel.Name = "txtGeneralInformationObjectModel";
this.txtGeneralInformationObjectModel.ReadOnly = true;
this.txtGeneralInformationObjectModel.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationObjectModel.TabIndex = 1;
//
// txtGeneralInformationDataFormat
//
this.txtGeneralInformationDataFormat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationDataFormat.Location = new System.Drawing.Point(101, 45);
this.txtGeneralInformationDataFormat.Name = "txtGeneralInformationDataFormat";
this.txtGeneralInformationDataFormat.ReadOnly = true;
this.txtGeneralInformationDataFormat.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationDataFormat.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.label2.Location = new System.Drawing.Point(13, 103);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(51, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Location:";
//
// cmdGeneralInformationDataFormatChange
//
this.cmdGeneralInformationDataFormatChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -174,104 +268,34 @@
this.cmdGeneralInformationDataFormatChange.UseVisualStyleBackColor = true;
this.cmdGeneralInformationDataFormatChange.Click += new System.EventHandler(this.cmdGeneralInformationDataFormatChange_Click);
//
// label2
// label3
//
this.label2.AutoSize = true;
this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.label2.Location = new System.Drawing.Point(13, 103);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(51, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Location:";
//
// lblGeneralInformationDateCreated
//
this.lblGeneralInformationDateCreated.AutoSize = true;
this.lblGeneralInformationDateCreated.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationDateCreated.Location = new System.Drawing.Point(13, 163);
this.lblGeneralInformationDateCreated.Name = "lblGeneralInformationDateCreated";
this.lblGeneralInformationDateCreated.Size = new System.Drawing.Size(72, 13);
this.lblGeneralInformationDateCreated.TabIndex = 8;
this.lblGeneralInformationDateCreated.Text = "Date created:";
//
// lblGeneralInformationDateModified
//
this.lblGeneralInformationDateModified.AutoSize = true;
this.lblGeneralInformationDateModified.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationDateModified.Location = new System.Drawing.Point(13, 189);
this.lblGeneralInformationDateModified.Name = "lblGeneralInformationDateModified";
this.lblGeneralInformationDateModified.Size = new System.Drawing.Size(75, 13);
this.lblGeneralInformationDateModified.TabIndex = 10;
this.lblGeneralInformationDateModified.Text = "Date modified:";
//
// lblGeneralInformationDateAccessed
//
this.lblGeneralInformationDateAccessed.AutoSize = true;
this.lblGeneralInformationDateAccessed.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationDateAccessed.Location = new System.Drawing.Point(13, 215);
this.lblGeneralInformationDateAccessed.Name = "lblGeneralInformationDateAccessed";
this.lblGeneralInformationDateAccessed.Size = new System.Drawing.Size(82, 13);
this.lblGeneralInformationDateAccessed.TabIndex = 12;
this.lblGeneralInformationDateAccessed.Text = "Date accessed:";
//
// txtGeneralInformationDateCreated
//
this.txtGeneralInformationDateCreated.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationDateCreated.Location = new System.Drawing.Point(101, 160);
this.txtGeneralInformationDateCreated.Name = "txtGeneralInformationDateCreated";
this.txtGeneralInformationDateCreated.ReadOnly = true;
this.txtGeneralInformationDateCreated.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationDateCreated.TabIndex = 9;
//
// txtGeneralInformationDateModified
//
this.txtGeneralInformationDateModified.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationDateModified.Location = new System.Drawing.Point(101, 186);
this.txtGeneralInformationDateModified.Name = "txtGeneralInformationDateModified";
this.txtGeneralInformationDateModified.ReadOnly = true;
this.txtGeneralInformationDateModified.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationDateModified.TabIndex = 11;
//
// txtGeneralInformationDateAccessed
//
this.txtGeneralInformationDateAccessed.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationDateAccessed.Location = new System.Drawing.Point(101, 212);
this.txtGeneralInformationDateAccessed.Name = "txtGeneralInformationDateAccessed";
this.txtGeneralInformationDateAccessed.ReadOnly = true;
this.txtGeneralInformationDateAccessed.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationDateAccessed.TabIndex = 13;
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.label3.Location = new System.Drawing.Point(6, 181);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(301, 2);
this.label3.TabIndex = 7;
//
// txtGeneralInformationLocation
//
this.txtGeneralInformationLocation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationLocation.Location = new System.Drawing.Point(101, 100);
this.txtGeneralInformationLocation.Name = "txtGeneralInformationLocation";
this.txtGeneralInformationLocation.ReadOnly = true;
this.txtGeneralInformationLocation.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationLocation.TabIndex = 4;
//
// label3
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.label3.Location = new System.Drawing.Point(6, 152);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(301, 2);
this.label3.TabIndex = 7;
//
// fraAttributes
//
this.fraAttributes.Controls.Add(this.chkGeneralAttributesArchive);
this.fraAttributes.Controls.Add(this.chkGeneralAttributesHidden);
this.fraAttributes.Controls.Add(this.chkGeneralAttributesReadOnly);
this.fraAttributes.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.fraAttributes.Location = new System.Drawing.Point(7, 293);
this.fraAttributes.Location = new System.Drawing.Point(7, 321);
this.fraAttributes.Name = "fraAttributes";
this.fraAttributes.Size = new System.Drawing.Size(313, 47);
this.fraAttributes.TabIndex = 2;
@ -311,7 +335,7 @@
// txtFileName
//
this.txtFileName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
| System.Windows.Forms.AnchorStyles.Right)));
this.txtFileName.Location = new System.Drawing.Point(45, 7);
this.txtFileName.Name = "txtFileName";
this.txtFileName.Size = new System.Drawing.Size(275, 20);
@ -328,8 +352,8 @@
// sc
//
this.sc.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.sc.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.sc.Location = new System.Drawing.Point(12, 12);
this.sc.Name = "sc";
@ -341,7 +365,7 @@
// sc.Panel2
//
this.sc.Panel2.Controls.Add(this.pnlGeneral);
this.sc.Size = new System.Drawing.Size(454, 362);
this.sc.Size = new System.Drawing.Size(454, 373);
this.sc.SplitterDistance = 127;
this.sc.TabIndex = 0;
//
@ -350,7 +374,7 @@
this.cmdCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cmdCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdCancel.Location = new System.Drawing.Point(391, 380);
this.cmdCancel.Location = new System.Drawing.Point(391, 391);
this.cmdCancel.Name = "cmdCancel";
this.cmdCancel.Size = new System.Drawing.Size(75, 23);
this.cmdCancel.TabIndex = 2;
@ -362,7 +386,7 @@
//
this.cmdOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cmdOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdOK.Location = new System.Drawing.Point(310, 380);
this.cmdOK.Location = new System.Drawing.Point(310, 391);
this.cmdOK.Name = "cmdOK";
this.cmdOK.Size = new System.Drawing.Size(75, 23);
this.cmdOK.TabIndex = 1;
@ -390,25 +414,29 @@
this.lblNoObjectsSelected.TabIndex = 0;
this.lblNoObjectsSelected.Text = "Nothing selected";
//
// txtGeneralInformationObjectModel
// cmdGeneralInformationLocationChange
//
this.txtGeneralInformationObjectModel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtGeneralInformationObjectModel.Location = new System.Drawing.Point(101, 19);
this.txtGeneralInformationObjectModel.Name = "txtGeneralInformationObjectModel";
this.txtGeneralInformationObjectModel.ReadOnly = true;
this.txtGeneralInformationObjectModel.Size = new System.Drawing.Size(206, 20);
this.txtGeneralInformationObjectModel.TabIndex = 1;
this.cmdGeneralInformationLocationChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cmdGeneralInformationLocationChange.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdGeneralInformationLocationChange.Location = new System.Drawing.Point(232, 126);
this.cmdGeneralInformationLocationChange.Name = "cmdGeneralInformationLocationChange";
this.cmdGeneralInformationLocationChange.Size = new System.Drawing.Size(75, 23);
this.cmdGeneralInformationLocationChange.TabIndex = 2;
this.cmdGeneralInformationLocationChange.Text = "&Change...";
this.cmdGeneralInformationLocationChange.UseVisualStyleBackColor = true;
this.cmdGeneralInformationLocationChange.Click += new System.EventHandler(this.cmdGeneralInformationLocationChange_Click);
//
// lblGeneralInformationObjectModel
// cmdGeneralInformationLocationBrowse
//
this.lblGeneralInformationObjectModel.AutoSize = true;
this.lblGeneralInformationObjectModel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.lblGeneralInformationObjectModel.Location = new System.Drawing.Point(13, 22);
this.lblGeneralInformationObjectModel.Name = "lblGeneralInformationObjectModel";
this.lblGeneralInformationObjectModel.Size = new System.Drawing.Size(72, 13);
this.lblGeneralInformationObjectModel.TabIndex = 0;
this.lblGeneralInformationObjectModel.Text = "Object model:";
this.cmdGeneralInformationLocationBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cmdGeneralInformationLocationBrowse.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdGeneralInformationLocationBrowse.Location = new System.Drawing.Point(151, 126);
this.cmdGeneralInformationLocationBrowse.Name = "cmdGeneralInformationLocationBrowse";
this.cmdGeneralInformationLocationBrowse.Size = new System.Drawing.Size(75, 23);
this.cmdGeneralInformationLocationBrowse.TabIndex = 2;
this.cmdGeneralInformationLocationBrowse.Text = "&Browse";
this.cmdGeneralInformationLocationBrowse.UseVisualStyleBackColor = true;
this.cmdGeneralInformationLocationBrowse.Click += new System.EventHandler(this.cmdGeneralInformationLocationBrowse_Click);
//
// FilePropertiesDialogImpl
//
@ -416,11 +444,12 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cmdCancel;
this.ClientSize = new System.Drawing.Size(478, 415);
this.ClientSize = new System.Drawing.Size(478, 426);
this.Controls.Add(this.cmdOK);
this.Controls.Add(this.cmdCancel);
this.Controls.Add(this.sc);
this.Controls.Add(this.pnlNoObjectsSelected);
this.MinimumSize = new System.Drawing.Size(494, 464);
this.Name = "FilePropertiesDialogImpl";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Properties";
@ -472,6 +501,8 @@
private System.Windows.Forms.Label lblNoObjectsSelected;
private System.Windows.Forms.TextBox txtGeneralInformationObjectModel;
private System.Windows.Forms.Label lblGeneralInformationObjectModel;
private System.Windows.Forms.Button cmdGeneralInformationLocationBrowse;
private System.Windows.Forms.Button cmdGeneralInformationLocationChange;
}
}

View File

@ -41,7 +41,12 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs.FileSystem.Internal
if (fso is File)
{
File file = (fso as File);
txtFileName.Text = file.Name;
string fileTitle = System.IO.Path.GetFileName(file.Name);
string fileLocation = System.IO.Path.GetDirectoryName(file.Name);
txtFileName.Text = fileTitle;
txtGeneralInformationLocation.Text = fileLocation;
Accessors.MemoryAccessor ma = new Accessors.MemoryAccessor(file.GetDataAsByteArray(), file.Name);
Association[] assocs = Association.FromCriteria(new AssociationCriteria() { Accessor = ma });
@ -140,5 +145,33 @@ namespace UniversalEditor.UserInterface.WindowsForms.Dialogs.FileSystem.Internal
if (value != null) mvarSelectedObjects = value;
}
}
private void cmdGeneralInformationLocationBrowse_Click(object sender, EventArgs e)
{
// Check if location is a directory so we don't inadvertently launch a program
if (System.IO.Directory.Exists(txtGeneralInformationLocation.Text))
{
System.Diagnostics.Process.Start(txtGeneralInformationLocation.Text);
}
}
private void cmdGeneralInformationLocationChange_Click(object sender, EventArgs e)
{
// Check if location is a directory so we don't inadvertently move a program
if (System.IO.Directory.Exists(txtGeneralInformationLocation.Text))
{
string oldFilePath = txtGeneralInformationLocation.Text + System.IO.Path.DirectorySeparatorChar.ToString() + txtFileName.Text;
// use AC NativeDialog for FolderBrowserDialog because it looks much sexier than the built-in WinForms one
AwesomeControls.NativeDialogs.FolderBrowserDialog dlg = new AwesomeControls.NativeDialogs.FolderBrowserDialog();
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string newFilePath = dlg.SelectedPath + System.IO.Path.DirectorySeparatorChar.ToString() + txtFileName.Text;
// move the specified file from the old location to the new location
System.IO.File.Move(oldFilePath, newFilePath);
}
}
}
}
}

View File

@ -766,7 +766,25 @@ namespace UniversalEditor.UserInterface.WindowsForms.Editors
{
if (lv.SelectedItems.Count == 0)
{
string fileName = ObjectModel.Accessor.GetFileName();
if (System.IO.File.Exists(fileName))
{
File file = new File();
file.Name = fileName;
file.SetDataAsByteArray(System.IO.File.ReadAllBytes(fileName));
Dialogs.FileSystem.FilePropertiesDialog dlg = new Dialogs.FileSystem.FilePropertiesDialog();
dlg.SelectedObjects.Add(file);
if (dlg.ShowDialog() == DialogResult.OK)
{
}
}
else
{
MessageBox.Show("Could not get file information for this editor.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else if (lv.SelectedItems.Count == 1)
{

View File

@ -64,8 +64,24 @@ namespace UniversalEditor.ObjectModels.FileSystem
}
public static FileSystemObjectModel FromDirectory(string path, string searchPattern = "*.*", System.IO.SearchOption searchOption = System.IO.SearchOption.TopDirectoryOnly)
{
string[] files = System.IO.Directory.GetFiles(path, searchPattern, searchOption);
return FromFiles(files);
string[] folders = System.IO.Directory.GetDirectories(path);
string[] files = System.IO.Directory.GetFiles(path);
FileSystemObjectModel fsom = new FileSystemObjectModel();
foreach (string folder in folders)
{
string title = System.IO.Path.GetFileName(folder);
fsom.Folders.Add(title);
}
foreach (string fileName in files)
{
string title = System.IO.Path.GetFileName(fileName);
fsom.Files.Add(title, fileName);
}
return fsom;
// string[] files = System.IO.Directory.GetFiles(path, searchPattern, searchOption);
// return FromFiles(files);
}
private File.FileCollection mvarFiles = new File.FileCollection();