From fd2b7aa6f25519269e99a29b9bf6b966c856041f Mon Sep 17 00:00:00 2001 From: Michael Johne Date: Thu, 29 Nov 2018 23:36:21 +0100 Subject: [PATCH] Add files via upload --- FileDateTime Manipulator/FdtmForm.Designer.cs | 457 ++++++++++++++++-- FileDateTime Manipulator/FdtmForm.cs | 141 +++++- FileDateTime Manipulator/FdtmForm.resx | 3 + .../FileDateTime Manipulator.csproj | 4 +- .../Properties/AssemblyInfo.cs | 4 +- 5 files changed, 549 insertions(+), 60 deletions(-) diff --git a/FileDateTime Manipulator/FdtmForm.Designer.cs b/FileDateTime Manipulator/FdtmForm.Designer.cs index f276884..0ea9ce1 100644 --- a/FileDateTime Manipulator/FdtmForm.Designer.cs +++ b/FileDateTime Manipulator/FdtmForm.Designer.cs @@ -28,6 +28,7 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.labelPath = new System.Windows.Forms.Label(); this.textBoxPath = new System.Windows.Forms.TextBox(); this.buttonSelectFile = new System.Windows.Forms.Button(); @@ -42,17 +43,42 @@ private void InitializeComponent() this.labelNewAccessDate = new System.Windows.Forms.Label(); this.labelNewCreationDate = new System.Windows.Forms.Label(); this.tableLayoutPanelDate = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.radioButtonLastWriteDateUtc = new System.Windows.Forms.RadioButton(); + this.radioButtonLastWriteDateLocalTime = new System.Windows.Forms.RadioButton(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.radioButtonCreationDateUtc = new System.Windows.Forms.RadioButton(); + this.radioButtonCreationDateLocalTime = new System.Windows.Forms.RadioButton(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.radioButtonLastAccessDateUtc = new System.Windows.Forms.RadioButton(); + this.radioButtonLastAccessDateLocalTime = new System.Windows.Forms.RadioButton(); this.panelButtons = new System.Windows.Forms.Panel(); this.buttonClose = new System.Windows.Forms.Button(); this.buttonInfo = new System.Windows.Forms.Button(); this.buttonApply = new System.Windows.Forms.Button(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.dateTimePickerCreated = new System.Windows.Forms.DateTimePicker(); - this.dateTimePickerAccessed = new System.Windows.Forms.DateTimePicker(); + this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel(); + this.radioButtonNewCreationDateUtc = new System.Windows.Forms.RadioButton(); + this.radioButtonNewCreationDateLocalTime = new System.Windows.Forms.RadioButton(); + this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); + this.radioButtonNewLastAccessDateUtc = new System.Windows.Forms.RadioButton(); + this.radioButtonNewLastAccessDateLocalTime = new System.Windows.Forms.RadioButton(); + this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); + this.radioButtonNewLastWriteDateUtc = new System.Windows.Forms.RadioButton(); + this.radioButtonNewLastWriteDateLocalTime = new System.Windows.Forms.RadioButton(); this.dateTimePickerWrited = new System.Windows.Forms.DateTimePicker(); + this.dateTimePickerAccessed = new System.Windows.Forms.DateTimePicker(); + this.dateTimePickerCreated = new System.Windows.Forms.DateTimePicker(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.tableLayoutPanelDate.SuspendLayout(); + this.tableLayoutPanel4.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); this.panelButtons.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel7.SuspendLayout(); + this.tableLayoutPanel6.SuspendLayout(); + this.tableLayoutPanel5.SuspendLayout(); this.SuspendLayout(); // // labelPath @@ -75,6 +101,7 @@ private void InitializeComponent() this.textBoxPath.ReadOnly = true; this.textBoxPath.Size = new System.Drawing.Size(357, 20); this.textBoxPath.TabIndex = 1; + this.toolTip.SetToolTip(this.textBoxPath, "Full path name"); // // buttonSelectFile // @@ -85,6 +112,7 @@ private void InitializeComponent() this.buttonSelectFile.Size = new System.Drawing.Size(70, 20); this.buttonSelectFile.TabIndex = 2; this.buttonSelectFile.Text = "&Select file"; + this.toolTip.SetToolTip(this.buttonSelectFile, "Click to selected a file"); this.buttonSelectFile.UseVisualStyleBackColor = true; this.buttonSelectFile.Click += new System.EventHandler(this.ButtonSelectFile_Click); // @@ -108,7 +136,7 @@ private void InitializeComponent() this.labelLastAccessDate.Location = new System.Drawing.Point(156, 0); this.labelLastAccessDate.Name = "labelLastAccessDate"; this.labelLastAccessDate.Size = new System.Drawing.Size(147, 13); - this.labelLastAccessDate.TabIndex = 2; + this.labelLastAccessDate.TabIndex = 3; this.labelLastAccessDate.Text = "Last access date (&2):"; this.labelLastAccessDate.TextAlign = System.Drawing.ContentAlignment.TopCenter; // @@ -120,7 +148,7 @@ private void InitializeComponent() this.labelLastWriteDate.Location = new System.Drawing.Point(309, 0); this.labelLastWriteDate.Name = "labelLastWriteDate"; this.labelLastWriteDate.Size = new System.Drawing.Size(148, 13); - this.labelLastWriteDate.TabIndex = 4; + this.labelLastWriteDate.TabIndex = 6; this.labelLastWriteDate.Text = "Last write date (&3):"; this.labelLastWriteDate.TextAlign = System.Drawing.ContentAlignment.TopCenter; // @@ -136,6 +164,7 @@ private void InitializeComponent() this.textBoxCreationDate.Size = new System.Drawing.Size(147, 20); this.textBoxCreationDate.TabIndex = 1; this.textBoxCreationDate.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTip.SetToolTip(this.textBoxCreationDate, "Creation date of the file"); // // textBoxLastAccessDate // @@ -147,8 +176,9 @@ private void InitializeComponent() this.textBoxLastAccessDate.Name = "textBoxLastAccessDate"; this.textBoxLastAccessDate.ReadOnly = true; this.textBoxLastAccessDate.Size = new System.Drawing.Size(147, 20); - this.textBoxLastAccessDate.TabIndex = 3; + this.textBoxLastAccessDate.TabIndex = 4; this.textBoxLastAccessDate.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTip.SetToolTip(this.textBoxLastAccessDate, "Last access date of the file"); // // textBoxLastWriteDate // @@ -160,8 +190,9 @@ private void InitializeComponent() this.textBoxLastWriteDate.Name = "textBoxLastWriteDate"; this.textBoxLastWriteDate.ReadOnly = true; this.textBoxLastWriteDate.Size = new System.Drawing.Size(148, 20); - this.textBoxLastWriteDate.TabIndex = 5; + this.textBoxLastWriteDate.TabIndex = 7; this.textBoxLastWriteDate.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTip.SetToolTip(this.textBoxLastWriteDate, "Last write date of the file"); // // openFileDialog // @@ -173,10 +204,11 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.labelNewWriteDate.AutoSize = true; + this.labelNewWriteDate.Enabled = false; this.labelNewWriteDate.Location = new System.Drawing.Point(309, 0); this.labelNewWriteDate.Name = "labelNewWriteDate"; this.labelNewWriteDate.Size = new System.Drawing.Size(149, 13); - this.labelNewWriteDate.TabIndex = 4; + this.labelNewWriteDate.TabIndex = 6; this.labelNewWriteDate.Text = "Set new write date (&6):"; this.labelNewWriteDate.TextAlign = System.Drawing.ContentAlignment.TopCenter; // @@ -186,10 +218,11 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.labelNewAccessDate.AutoSize = true; + this.labelNewAccessDate.Enabled = false; this.labelNewAccessDate.Location = new System.Drawing.Point(156, 0); this.labelNewAccessDate.Name = "labelNewAccessDate"; this.labelNewAccessDate.Size = new System.Drawing.Size(147, 13); - this.labelNewAccessDate.TabIndex = 2; + this.labelNewAccessDate.TabIndex = 3; this.labelNewAccessDate.Text = "Set new access date (&5):"; this.labelNewAccessDate.TextAlign = System.Drawing.ContentAlignment.TopCenter; // @@ -199,6 +232,7 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.labelNewCreationDate.AutoSize = true; + this.labelNewCreationDate.Enabled = false; this.labelNewCreationDate.Location = new System.Drawing.Point(3, 0); this.labelNewCreationDate.Name = "labelNewCreationDate"; this.labelNewCreationDate.Size = new System.Drawing.Size(147, 13); @@ -214,20 +248,168 @@ private void InitializeComponent() this.tableLayoutPanelDate.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanelDate.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanelDate.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); + this.tableLayoutPanelDate.Controls.Add(this.tableLayoutPanel4, 2, 2); + this.tableLayoutPanelDate.Controls.Add(this.tableLayoutPanel3, 0, 2); this.tableLayoutPanelDate.Controls.Add(this.labelCreationDate, 0, 0); this.tableLayoutPanelDate.Controls.Add(this.labelLastAccessDate, 1, 0); this.tableLayoutPanelDate.Controls.Add(this.textBoxLastWriteDate, 2, 1); this.tableLayoutPanelDate.Controls.Add(this.labelLastWriteDate, 2, 0); this.tableLayoutPanelDate.Controls.Add(this.textBoxLastAccessDate, 1, 1); this.tableLayoutPanelDate.Controls.Add(this.textBoxCreationDate, 0, 1); + this.tableLayoutPanelDate.Controls.Add(this.tableLayoutPanel2, 1, 2); this.tableLayoutPanelDate.Location = new System.Drawing.Point(12, 32); this.tableLayoutPanelDate.Name = "tableLayoutPanelDate"; - this.tableLayoutPanelDate.RowCount = 2; + this.tableLayoutPanelDate.RowCount = 3; this.tableLayoutPanelDate.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanelDate.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelDate.Size = new System.Drawing.Size(460, 40); + this.tableLayoutPanelDate.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + this.tableLayoutPanelDate.Size = new System.Drawing.Size(460, 70); this.tableLayoutPanelDate.TabIndex = 3; // + // tableLayoutPanel4 + // + this.tableLayoutPanel4.ColumnCount = 2; + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel4.Controls.Add(this.radioButtonLastWriteDateUtc, 1, 0); + this.tableLayoutPanel4.Controls.Add(this.radioButtonLastWriteDateLocalTime, 0, 0); + this.tableLayoutPanel4.Location = new System.Drawing.Point(309, 42); + this.tableLayoutPanel4.Name = "tableLayoutPanel4"; + this.tableLayoutPanel4.RowCount = 1; + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel4.Size = new System.Drawing.Size(147, 25); + this.tableLayoutPanel4.TabIndex = 8; + // + // radioButtonLastWriteDateUtc + // + this.radioButtonLastWriteDateUtc.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))); + this.radioButtonLastWriteDateUtc.AutoSize = true; + this.radioButtonLastWriteDateUtc.Enabled = false; + this.radioButtonLastWriteDateUtc.Location = new System.Drawing.Point(78, 3); + this.radioButtonLastWriteDateUtc.Name = "radioButtonLastWriteDateUtc"; + this.radioButtonLastWriteDateUtc.Size = new System.Drawing.Size(66, 19); + this.radioButtonLastWriteDateUtc.TabIndex = 1; + this.radioButtonLastWriteDateUtc.Text = "UTC"; + this.toolTip.SetToolTip(this.radioButtonLastWriteDateUtc, "Convert the last write date to the universal time"); + this.radioButtonLastWriteDateUtc.UseVisualStyleBackColor = true; + this.radioButtonLastWriteDateUtc.CheckedChanged += new System.EventHandler(this.RadioButtonLastWriteDateUtc_CheckedChanged); + // + // radioButtonLastWriteDateLocalTime + // + this.radioButtonLastWriteDateLocalTime.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))); + this.radioButtonLastWriteDateLocalTime.AutoSize = true; + this.radioButtonLastWriteDateLocalTime.Checked = true; + this.radioButtonLastWriteDateLocalTime.Enabled = false; + this.radioButtonLastWriteDateLocalTime.Location = new System.Drawing.Point(3, 3); + this.radioButtonLastWriteDateLocalTime.Name = "radioButtonLastWriteDateLocalTime"; + this.radioButtonLastWriteDateLocalTime.Size = new System.Drawing.Size(69, 19); + this.radioButtonLastWriteDateLocalTime.TabIndex = 0; + this.radioButtonLastWriteDateLocalTime.TabStop = true; + this.radioButtonLastWriteDateLocalTime.Text = "local time"; + this.toolTip.SetToolTip(this.radioButtonLastWriteDateLocalTime, "Convert the last write date to the local time"); + this.radioButtonLastWriteDateLocalTime.UseVisualStyleBackColor = true; + this.radioButtonLastWriteDateLocalTime.CheckedChanged += new System.EventHandler(this.RadioButtonLastWriteDateLocalTime_CheckedChanged); + // + // tableLayoutPanel3 + // + this.tableLayoutPanel3.ColumnCount = 2; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel3.Controls.Add(this.radioButtonCreationDateUtc, 1, 0); + this.tableLayoutPanel3.Controls.Add(this.radioButtonCreationDateLocalTime, 0, 0); + this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 42); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 1; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(147, 25); + this.tableLayoutPanel3.TabIndex = 2; + // + // radioButtonCreationDateUtc + // + this.radioButtonCreationDateUtc.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))); + this.radioButtonCreationDateUtc.AutoSize = true; + this.radioButtonCreationDateUtc.Enabled = false; + this.radioButtonCreationDateUtc.Location = new System.Drawing.Point(78, 3); + this.radioButtonCreationDateUtc.Name = "radioButtonCreationDateUtc"; + this.radioButtonCreationDateUtc.Size = new System.Drawing.Size(66, 19); + this.radioButtonCreationDateUtc.TabIndex = 1; + this.radioButtonCreationDateUtc.Text = "UTC"; + this.toolTip.SetToolTip(this.radioButtonCreationDateUtc, "Convert the creation date to the universal time"); + this.radioButtonCreationDateUtc.UseVisualStyleBackColor = true; + this.radioButtonCreationDateUtc.CheckedChanged += new System.EventHandler(this.RadioButtonCreationDateUtc_CheckedChanged); + // + // radioButtonCreationDateLocalTime + // + this.radioButtonCreationDateLocalTime.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))); + this.radioButtonCreationDateLocalTime.AutoSize = true; + this.radioButtonCreationDateLocalTime.Checked = true; + this.radioButtonCreationDateLocalTime.Enabled = false; + this.radioButtonCreationDateLocalTime.Location = new System.Drawing.Point(3, 3); + this.radioButtonCreationDateLocalTime.Name = "radioButtonCreationDateLocalTime"; + this.radioButtonCreationDateLocalTime.Size = new System.Drawing.Size(69, 19); + this.radioButtonCreationDateLocalTime.TabIndex = 0; + this.radioButtonCreationDateLocalTime.TabStop = true; + this.radioButtonCreationDateLocalTime.Text = "local time"; + this.toolTip.SetToolTip(this.radioButtonCreationDateLocalTime, "Convert the creation date to the local time"); + this.radioButtonCreationDateLocalTime.UseVisualStyleBackColor = true; + this.radioButtonCreationDateLocalTime.CheckedChanged += new System.EventHandler(this.RadioButtonCreationDateLocalTime_CheckedChanged); + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 2; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.Controls.Add(this.radioButtonLastAccessDateUtc, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.radioButtonLastAccessDateLocalTime, 0, 0); + this.tableLayoutPanel2.Location = new System.Drawing.Point(156, 42); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 1; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(147, 25); + this.tableLayoutPanel2.TabIndex = 5; + // + // radioButtonLastAccessDateUtc + // + this.radioButtonLastAccessDateUtc.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))); + this.radioButtonLastAccessDateUtc.AutoSize = true; + this.radioButtonLastAccessDateUtc.Enabled = false; + this.radioButtonLastAccessDateUtc.Location = new System.Drawing.Point(78, 3); + this.radioButtonLastAccessDateUtc.Name = "radioButtonLastAccessDateUtc"; + this.radioButtonLastAccessDateUtc.Size = new System.Drawing.Size(66, 19); + this.radioButtonLastAccessDateUtc.TabIndex = 1; + this.radioButtonLastAccessDateUtc.Text = "UTC"; + this.toolTip.SetToolTip(this.radioButtonLastAccessDateUtc, "Convert the last access date to the universal time"); + this.radioButtonLastAccessDateUtc.UseVisualStyleBackColor = true; + this.radioButtonLastAccessDateUtc.CheckedChanged += new System.EventHandler(this.RadioButtonLastAccessDateUtc_CheckedChanged); + // + // radioButtonLastAccessDateLocalTime + // + this.radioButtonLastAccessDateLocalTime.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))); + this.radioButtonLastAccessDateLocalTime.AutoSize = true; + this.radioButtonLastAccessDateLocalTime.Checked = true; + this.radioButtonLastAccessDateLocalTime.Enabled = false; + this.radioButtonLastAccessDateLocalTime.Location = new System.Drawing.Point(3, 3); + this.radioButtonLastAccessDateLocalTime.Name = "radioButtonLastAccessDateLocalTime"; + this.radioButtonLastAccessDateLocalTime.Size = new System.Drawing.Size(69, 19); + this.radioButtonLastAccessDateLocalTime.TabIndex = 0; + this.radioButtonLastAccessDateLocalTime.TabStop = true; + this.radioButtonLastAccessDateLocalTime.Text = "local time"; + this.toolTip.SetToolTip(this.radioButtonLastAccessDateLocalTime, "Convert the last access date to the local time"); + this.radioButtonLastAccessDateLocalTime.UseVisualStyleBackColor = true; + this.radioButtonLastAccessDateLocalTime.CheckedChanged += new System.EventHandler(this.RadioButtonLastAccessDateLocalTime_CheckedChanged); + // // panelButtons // this.panelButtons.BackColor = System.Drawing.SystemColors.ControlLightLight; @@ -236,7 +418,7 @@ private void InitializeComponent() this.panelButtons.Controls.Add(this.buttonInfo); this.panelButtons.Controls.Add(this.buttonApply); this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panelButtons.Location = new System.Drawing.Point(0, 122); + this.panelButtons.Location = new System.Drawing.Point(0, 183); this.panelButtons.Name = "panelButtons"; this.panelButtons.Size = new System.Drawing.Size(484, 49); this.panelButtons.TabIndex = 5; @@ -250,6 +432,7 @@ private void InitializeComponent() this.buttonClose.Size = new System.Drawing.Size(67, 23); this.buttonClose.TabIndex = 2; this.buttonClose.Text = "&Close"; + this.toolTip.SetToolTip(this.buttonClose, "Close the application"); this.buttonClose.UseVisualStyleBackColor = true; this.buttonClose.Click += new System.EventHandler(this.ButtonClose_Click); // @@ -261,6 +444,7 @@ private void InitializeComponent() this.buttonInfo.Size = new System.Drawing.Size(67, 23); this.buttonInfo.TabIndex = 0; this.buttonInfo.Text = "&Info"; + this.toolTip.SetToolTip(this.buttonInfo, "Show some information"); this.buttonInfo.UseVisualStyleBackColor = true; this.buttonInfo.Click += new System.EventHandler(this.ButtonInfo_Click); // @@ -273,6 +457,7 @@ private void InitializeComponent() this.buttonApply.Size = new System.Drawing.Size(67, 23); this.buttonApply.TabIndex = 1; this.buttonApply.Text = "&Apply"; + this.toolTip.SetToolTip(this.buttonApply, "Apply the changes"); this.buttonApply.UseVisualStyleBackColor = true; this.buttonApply.Click += new System.EventHandler(this.ButtonApply_Click); // @@ -284,42 +469,191 @@ private void InitializeComponent() this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.tableLayoutPanel1.Controls.Add(this.dateTimePickerCreated, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.dateTimePickerAccessed, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel7, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel6, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel5, 0, 2); this.tableLayoutPanel1.Controls.Add(this.dateTimePickerWrited, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.dateTimePickerAccessed, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.dateTimePickerCreated, 0, 1); this.tableLayoutPanel1.Controls.Add(this.labelNewCreationDate, 0, 0); this.tableLayoutPanel1.Controls.Add(this.labelNewAccessDate, 1, 0); this.tableLayoutPanel1.Controls.Add(this.labelNewWriteDate, 2, 0); - this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 74); + this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 108); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(461, 40); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(461, 68); this.tableLayoutPanel1.TabIndex = 4; // - // dateTimePickerCreated + // tableLayoutPanel7 // - this.dateTimePickerCreated.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.tableLayoutPanel7.ColumnCount = 2; + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel7.Controls.Add(this.radioButtonNewCreationDateUtc, 1, 0); + this.tableLayoutPanel7.Controls.Add(this.radioButtonNewCreationDateLocalTime, 0, 0); + this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 42); + this.tableLayoutPanel7.Name = "tableLayoutPanel7"; + this.tableLayoutPanel7.RowCount = 1; + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel7.Size = new System.Drawing.Size(147, 23); + this.tableLayoutPanel7.TabIndex = 2; + // + // radioButtonNewCreationDateUtc + // + this.radioButtonNewCreationDateUtc.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))); - this.dateTimePickerCreated.CustomFormat = "d.M.yyyy h:m:s"; - this.dateTimePickerCreated.Enabled = false; - this.dateTimePickerCreated.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.dateTimePickerCreated.Format = System.Windows.Forms.DateTimePickerFormat.Custom; - this.dateTimePickerCreated.Location = new System.Drawing.Point(3, 16); - this.dateTimePickerCreated.Name = "dateTimePickerCreated"; - this.dateTimePickerCreated.ShowCheckBox = true; - this.dateTimePickerCreated.ShowUpDown = true; - this.dateTimePickerCreated.Size = new System.Drawing.Size(147, 20); - this.dateTimePickerCreated.TabIndex = 1; + this.radioButtonNewCreationDateUtc.AutoSize = true; + this.radioButtonNewCreationDateUtc.Enabled = false; + this.radioButtonNewCreationDateUtc.Location = new System.Drawing.Point(78, 3); + this.radioButtonNewCreationDateUtc.Name = "radioButtonNewCreationDateUtc"; + this.radioButtonNewCreationDateUtc.Size = new System.Drawing.Size(66, 17); + this.radioButtonNewCreationDateUtc.TabIndex = 1; + this.radioButtonNewCreationDateUtc.Text = "UTC"; + this.toolTip.SetToolTip(this.radioButtonNewCreationDateUtc, "Convert the creation date preview to the universal time"); + this.radioButtonNewCreationDateUtc.UseVisualStyleBackColor = true; + this.radioButtonNewCreationDateUtc.CheckedChanged += new System.EventHandler(this.RadioButtonNewCreationDateUtc_CheckedChanged); + // + // radioButtonNewCreationDateLocalTime + // + this.radioButtonNewCreationDateLocalTime.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))); + this.radioButtonNewCreationDateLocalTime.AutoSize = true; + this.radioButtonNewCreationDateLocalTime.Checked = true; + this.radioButtonNewCreationDateLocalTime.Enabled = false; + this.radioButtonNewCreationDateLocalTime.Location = new System.Drawing.Point(3, 3); + this.radioButtonNewCreationDateLocalTime.Name = "radioButtonNewCreationDateLocalTime"; + this.radioButtonNewCreationDateLocalTime.Size = new System.Drawing.Size(69, 17); + this.radioButtonNewCreationDateLocalTime.TabIndex = 0; + this.radioButtonNewCreationDateLocalTime.TabStop = true; + this.radioButtonNewCreationDateLocalTime.Text = "local time"; + this.toolTip.SetToolTip(this.radioButtonNewCreationDateLocalTime, "Convert the creation date preview to the local time"); + this.radioButtonNewCreationDateLocalTime.UseVisualStyleBackColor = true; + this.radioButtonNewCreationDateLocalTime.CheckedChanged += new System.EventHandler(this.RadioButtonNewCreationDateLocalTime_CheckedChanged); + // + // tableLayoutPanel6 + // + this.tableLayoutPanel6.ColumnCount = 2; + this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel6.Controls.Add(this.radioButtonNewLastAccessDateUtc, 1, 0); + this.tableLayoutPanel6.Controls.Add(this.radioButtonNewLastAccessDateLocalTime, 0, 0); + this.tableLayoutPanel6.Location = new System.Drawing.Point(156, 42); + this.tableLayoutPanel6.Name = "tableLayoutPanel6"; + this.tableLayoutPanel6.RowCount = 1; + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel6.Size = new System.Drawing.Size(147, 23); + this.tableLayoutPanel6.TabIndex = 5; + // + // radioButtonNewLastAccessDateUtc + // + this.radioButtonNewLastAccessDateUtc.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))); + this.radioButtonNewLastAccessDateUtc.AutoSize = true; + this.radioButtonNewLastAccessDateUtc.Enabled = false; + this.radioButtonNewLastAccessDateUtc.Location = new System.Drawing.Point(78, 3); + this.radioButtonNewLastAccessDateUtc.Name = "radioButtonNewLastAccessDateUtc"; + this.radioButtonNewLastAccessDateUtc.Size = new System.Drawing.Size(66, 17); + this.radioButtonNewLastAccessDateUtc.TabIndex = 1; + this.radioButtonNewLastAccessDateUtc.Text = "UTC"; + this.toolTip.SetToolTip(this.radioButtonNewLastAccessDateUtc, "Convert the last access date preview to the universal time"); + this.radioButtonNewLastAccessDateUtc.UseVisualStyleBackColor = true; + this.radioButtonNewLastAccessDateUtc.CheckedChanged += new System.EventHandler(this.RadioButtonNewLastAccessDateUtc_CheckedChanged); + // + // radioButtonNewLastAccessDateLocalTime + // + this.radioButtonNewLastAccessDateLocalTime.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))); + this.radioButtonNewLastAccessDateLocalTime.AutoSize = true; + this.radioButtonNewLastAccessDateLocalTime.Checked = true; + this.radioButtonNewLastAccessDateLocalTime.Enabled = false; + this.radioButtonNewLastAccessDateLocalTime.Location = new System.Drawing.Point(3, 3); + this.radioButtonNewLastAccessDateLocalTime.Name = "radioButtonNewLastAccessDateLocalTime"; + this.radioButtonNewLastAccessDateLocalTime.Size = new System.Drawing.Size(69, 17); + this.radioButtonNewLastAccessDateLocalTime.TabIndex = 0; + this.radioButtonNewLastAccessDateLocalTime.TabStop = true; + this.radioButtonNewLastAccessDateLocalTime.Text = "local time"; + this.toolTip.SetToolTip(this.radioButtonNewLastAccessDateLocalTime, "Convert the last access date preview to the local time"); + this.radioButtonNewLastAccessDateLocalTime.UseVisualStyleBackColor = true; + this.radioButtonNewLastAccessDateLocalTime.CheckedChanged += new System.EventHandler(this.RadioButtonNewLastAccessDateLocalTime_CheckedChanged); + // + // tableLayoutPanel5 + // + this.tableLayoutPanel5.ColumnCount = 2; + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel5.Controls.Add(this.radioButtonNewLastWriteDateUtc, 1, 0); + this.tableLayoutPanel5.Controls.Add(this.radioButtonNewLastWriteDateLocalTime, 0, 0); + this.tableLayoutPanel5.Location = new System.Drawing.Point(309, 42); + this.tableLayoutPanel5.Name = "tableLayoutPanel5"; + this.tableLayoutPanel5.RowCount = 1; + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel5.Size = new System.Drawing.Size(147, 23); + this.tableLayoutPanel5.TabIndex = 8; + // + // radioButtonNewLastWriteDateUtc + // + this.radioButtonNewLastWriteDateUtc.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))); + this.radioButtonNewLastWriteDateUtc.AutoSize = true; + this.radioButtonNewLastWriteDateUtc.Enabled = false; + this.radioButtonNewLastWriteDateUtc.Location = new System.Drawing.Point(78, 3); + this.radioButtonNewLastWriteDateUtc.Name = "radioButtonNewLastWriteDateUtc"; + this.radioButtonNewLastWriteDateUtc.Size = new System.Drawing.Size(66, 17); + this.radioButtonNewLastWriteDateUtc.TabIndex = 1; + this.radioButtonNewLastWriteDateUtc.Text = "UTC"; + this.toolTip.SetToolTip(this.radioButtonNewLastWriteDateUtc, "Convert the last write date preview to the universal time"); + this.radioButtonNewLastWriteDateUtc.UseVisualStyleBackColor = true; + this.radioButtonNewLastWriteDateUtc.CheckedChanged += new System.EventHandler(this.RadioButtonNewLastWriteDateUtc_CheckedChanged); + // + // radioButtonNewLastWriteDateLocalTime + // + this.radioButtonNewLastWriteDateLocalTime.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))); + this.radioButtonNewLastWriteDateLocalTime.AutoSize = true; + this.radioButtonNewLastWriteDateLocalTime.Checked = true; + this.radioButtonNewLastWriteDateLocalTime.Enabled = false; + this.radioButtonNewLastWriteDateLocalTime.Location = new System.Drawing.Point(3, 3); + this.radioButtonNewLastWriteDateLocalTime.Name = "radioButtonNewLastWriteDateLocalTime"; + this.radioButtonNewLastWriteDateLocalTime.Size = new System.Drawing.Size(69, 17); + this.radioButtonNewLastWriteDateLocalTime.TabIndex = 0; + this.radioButtonNewLastWriteDateLocalTime.TabStop = true; + this.radioButtonNewLastWriteDateLocalTime.Text = "local time"; + this.toolTip.SetToolTip(this.radioButtonNewLastWriteDateLocalTime, "Convert the last write date preview to the local time"); + this.radioButtonNewLastWriteDateLocalTime.UseVisualStyleBackColor = true; + this.radioButtonNewLastWriteDateLocalTime.CheckedChanged += new System.EventHandler(this.RadioButtonNewLastWriteDateLocalTime_CheckedChanged); + // + // dateTimePickerWrited + // + this.dateTimePickerWrited.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))); + this.dateTimePickerWrited.CustomFormat = "dd.MM.yyyy HH:mm:ss"; + this.dateTimePickerWrited.Enabled = false; + this.dateTimePickerWrited.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.dateTimePickerWrited.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dateTimePickerWrited.Location = new System.Drawing.Point(309, 16); + this.dateTimePickerWrited.Name = "dateTimePickerWrited"; + this.dateTimePickerWrited.ShowCheckBox = true; + this.dateTimePickerWrited.ShowUpDown = true; + this.dateTimePickerWrited.Size = new System.Drawing.Size(149, 20); + this.dateTimePickerWrited.TabIndex = 7; + this.toolTip.SetToolTip(this.dateTimePickerWrited, "Last write date preview of the file"); // // dateTimePickerAccessed // this.dateTimePickerAccessed.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))); - this.dateTimePickerAccessed.CustomFormat = "d.M.yyyy h:m:s"; + this.dateTimePickerAccessed.CustomFormat = "dd.MM.yyyy HH:mm:ss"; this.dateTimePickerAccessed.Enabled = false; this.dateTimePickerAccessed.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.dateTimePickerAccessed.Format = System.Windows.Forms.DateTimePickerFormat.Custom; @@ -328,29 +662,31 @@ private void InitializeComponent() this.dateTimePickerAccessed.ShowCheckBox = true; this.dateTimePickerAccessed.ShowUpDown = true; this.dateTimePickerAccessed.Size = new System.Drawing.Size(147, 20); - this.dateTimePickerAccessed.TabIndex = 3; + this.dateTimePickerAccessed.TabIndex = 4; + this.toolTip.SetToolTip(this.dateTimePickerAccessed, "Last access date preview of the file"); // - // dateTimePickerWrited + // dateTimePickerCreated // - this.dateTimePickerWrited.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.dateTimePickerCreated.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))); - this.dateTimePickerWrited.CustomFormat = "d.M.yyyy h:m:s"; - this.dateTimePickerWrited.Enabled = false; - this.dateTimePickerWrited.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.dateTimePickerWrited.Format = System.Windows.Forms.DateTimePickerFormat.Custom; - this.dateTimePickerWrited.Location = new System.Drawing.Point(309, 16); - this.dateTimePickerWrited.Name = "dateTimePickerWrited"; - this.dateTimePickerWrited.ShowCheckBox = true; - this.dateTimePickerWrited.ShowUpDown = true; - this.dateTimePickerWrited.Size = new System.Drawing.Size(149, 20); - this.dateTimePickerWrited.TabIndex = 5; + this.dateTimePickerCreated.CustomFormat = "dd.MM.yyyy HH:mm:ss"; + this.dateTimePickerCreated.Enabled = false; + this.dateTimePickerCreated.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.dateTimePickerCreated.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dateTimePickerCreated.Location = new System.Drawing.Point(3, 16); + this.dateTimePickerCreated.Name = "dateTimePickerCreated"; + this.dateTimePickerCreated.ShowCheckBox = true; + this.dateTimePickerCreated.ShowUpDown = true; + this.dateTimePickerCreated.Size = new System.Drawing.Size(147, 20); + this.dateTimePickerCreated.TabIndex = 1; + this.toolTip.SetToolTip(this.dateTimePickerCreated, "Creation date preview of the file"); // // FdtmForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(484, 171); + this.ClientSize = new System.Drawing.Size(484, 232); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.panelButtons); this.Controls.Add(this.tableLayoutPanelDate); @@ -366,9 +702,21 @@ private void InitializeComponent() this.Load += new System.EventHandler(this.FdtmForm_Load); this.tableLayoutPanelDate.ResumeLayout(false); this.tableLayoutPanelDate.PerformLayout(); + this.tableLayoutPanel4.ResumeLayout(false); + this.tableLayoutPanel4.PerformLayout(); + this.tableLayoutPanel3.ResumeLayout(false); + this.tableLayoutPanel3.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); this.panelButtons.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); + this.tableLayoutPanel7.ResumeLayout(false); + this.tableLayoutPanel7.PerformLayout(); + this.tableLayoutPanel6.ResumeLayout(false); + this.tableLayoutPanel6.PerformLayout(); + this.tableLayoutPanel5.ResumeLayout(false); + this.tableLayoutPanel5.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -395,9 +743,28 @@ private void InitializeComponent() private System.Windows.Forms.Button buttonClose; private System.Windows.Forms.Button buttonInfo; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.DateTimePicker dateTimePickerCreated; - private System.Windows.Forms.DateTimePicker dateTimePickerAccessed; private System.Windows.Forms.DateTimePicker dateTimePickerWrited; + private System.Windows.Forms.DateTimePicker dateTimePickerAccessed; + private System.Windows.Forms.DateTimePicker dateTimePickerCreated; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; + private System.Windows.Forms.RadioButton radioButtonLastWriteDateUtc; + private System.Windows.Forms.RadioButton radioButtonLastWriteDateLocalTime; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.RadioButton radioButtonCreationDateUtc; + private System.Windows.Forms.RadioButton radioButtonCreationDateLocalTime; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.RadioButton radioButtonLastAccessDateUtc; + private System.Windows.Forms.RadioButton radioButtonLastAccessDateLocalTime; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7; + private System.Windows.Forms.RadioButton radioButtonNewCreationDateUtc; + private System.Windows.Forms.RadioButton radioButtonNewCreationDateLocalTime; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6; + private System.Windows.Forms.RadioButton radioButtonNewLastAccessDateUtc; + private System.Windows.Forms.RadioButton radioButtonNewLastAccessDateLocalTime; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; + private System.Windows.Forms.RadioButton radioButtonNewLastWriteDateUtc; + private System.Windows.Forms.RadioButton radioButtonNewLastWriteDateLocalTime; + private System.Windows.Forms.ToolTip toolTip; } } diff --git a/FileDateTime Manipulator/FdtmForm.cs b/FileDateTime Manipulator/FdtmForm.cs index 90b1dbb..ba3ef62 100644 --- a/FileDateTime Manipulator/FdtmForm.cs +++ b/FileDateTime Manipulator/FdtmForm.cs @@ -7,8 +7,6 @@ namespace FileDateTime_Manipulator { public partial class FdtmForm : Form { - private FileInfo fileInfo; - #region Assemblyattributaccessoren /// @@ -101,18 +99,43 @@ private void FdtmForm_Load(object sender, EventArgs e) { } + #region Click-Eventhandler + private void ButtonSelectFile_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { textBoxPath.Text = openFileDialog.FileName; - textBoxCreationDate.Text = File.GetCreationTime(path: openFileDialog.FileName).ToString(); - textBoxLastAccessDate.Text = File.GetLastAccessTime(path: openFileDialog.FileName).ToString(); - textBoxLastWriteDate.Text = File.GetLastWriteTime(path: openFileDialog.FileName).ToString(); + RadioButtonCreationDateLocalTime_CheckedChanged(sender: sender, e: e); + RadioButtonLastAccessDateLocalTime_CheckedChanged(sender: sender, e: e); + RadioButtonLastWriteDateLocalTime_CheckedChanged(sender: sender, e: e); + + radioButtonCreationDateLocalTime.Enabled = true; + radioButtonCreationDateUtc.Enabled = true; + radioButtonLastAccessDateLocalTime.Enabled = true; + radioButtonLastAccessDateUtc.Enabled = true; + radioButtonLastWriteDateLocalTime.Enabled = true; + radioButtonLastWriteDateUtc.Enabled = true; + + radioButtonCreationDateLocalTime.Checked = true; + radioButtonLastAccessDateLocalTime.Checked = true; + radioButtonLastWriteDateLocalTime.Checked = true; + + labelNewCreationDate.Enabled = true; + labelNewAccessDate.Enabled = true; + labelNewWriteDate.Enabled = true; dateTimePickerCreated.Enabled = true; dateTimePickerAccessed.Enabled = true; dateTimePickerWrited.Enabled = true; + + radioButtonNewCreationDateLocalTime.Enabled = true; + radioButtonNewCreationDateUtc.Enabled = true; + radioButtonNewLastAccessDateLocalTime.Enabled = true; + radioButtonNewLastAccessDateUtc.Enabled = true; + radioButtonNewLastWriteDateLocalTime.Enabled = true; + radioButtonNewLastWriteDateUtc.Enabled = true; + buttonApply.Enabled = true; } } @@ -120,17 +143,47 @@ private void ButtonSelectFile_Click(object sender, EventArgs e) private void ButtonApply_Click(object sender, EventArgs e) { DateTime - creationTime = dateTimePickerCreated.Value, - lastAccessTime = dateTimePickerCreated.Value, - lastWriteTime = dateTimePickerCreated.Value; + creationTime = dateTimePickerWrited.Value, + lastAccessTime = dateTimePickerWrited.Value, + lastWriteTime = dateTimePickerWrited.Value; if (dateTimePickerCreated.Checked) File.SetCreationTime(path: textBoxPath.Text, creationTime: creationTime); if (dateTimePickerAccessed.Checked) File.SetLastAccessTime(path: textBoxPath.Text, lastAccessTime: lastAccessTime); if (dateTimePickerWrited.Checked) File.SetLastWriteTime(path: textBoxPath.Text, lastWriteTime: lastWriteTime); - textBoxCreationDate.Text = File.GetCreationTime(path: textBoxPath.Text).ToString(); - textBoxLastAccessDate.Text = File.GetLastAccessTime(path: textBoxPath.Text).ToString(); - textBoxLastWriteDate.Text = File.GetLastWriteTime(path: textBoxPath.Text).ToString(); + radioButtonCreationDateLocalTime.Checked = radioButtonNewCreationDateLocalTime.Checked; + radioButtonCreationDateUtc.Checked = radioButtonNewCreationDateUtc.Checked; + radioButtonLastAccessDateLocalTime.Checked = radioButtonNewLastAccessDateLocalTime.Checked; + radioButtonLastAccessDateUtc.Checked = radioButtonNewLastAccessDateUtc.Checked; + radioButtonLastWriteDateLocalTime.Checked = radioButtonNewLastWriteDateLocalTime.Checked; + radioButtonLastWriteDateUtc.Checked = radioButtonNewLastWriteDateUtc.Checked; + + if (radioButtonCreationDateLocalTime.Checked) + { + textBoxCreationDate.Text = File.GetCreationTime(path: textBoxPath.Text).ToString(); + } + else + { + textBoxCreationDate.Text = File.GetCreationTimeUtc(path: textBoxPath.Text).ToString(); + } + + if (radioButtonLastAccessDateLocalTime.Checked) + { + textBoxLastAccessDate.Text = File.GetLastAccessTime(path: textBoxPath.Text).ToString(); + } + else + { + textBoxLastAccessDate.Text = File.GetLastAccessTimeUtc(path: textBoxPath.Text).ToString(); + } + + if (radioButtonLastWriteDateLocalTime.Checked) + { + textBoxLastWriteDate.Text = File.GetLastWriteTime(path: textBoxPath.Text).ToString(); + } + else + { + textBoxLastWriteDate.Text = File.GetLastWriteTimeUtc(path: textBoxPath.Text).ToString(); + } MessageBox.Show(text: "All dates has been changed!", caption: "Information", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information); } @@ -145,5 +198,71 @@ private void ButtonClose_Click(object sender, EventArgs e) { this.Close(); } + + #endregion + + #region CheckedChanged-Eventhandler + + private void RadioButtonCreationDateLocalTime_CheckedChanged(object sender, EventArgs e) + { + textBoxCreationDate.Text = File.GetCreationTime(path: openFileDialog.FileName).ToString(); + } + + private void RadioButtonCreationDateUtc_CheckedChanged(object sender, EventArgs e) + { + textBoxCreationDate.Text = File.GetCreationTimeUtc(path: openFileDialog.FileName).ToString(); + } + + private void RadioButtonLastAccessDateLocalTime_CheckedChanged(object sender, EventArgs e) + { + textBoxLastAccessDate.Text = File.GetLastAccessTime(path: openFileDialog.FileName).ToString(); + } + + private void RadioButtonLastAccessDateUtc_CheckedChanged(object sender, EventArgs e) + { + textBoxLastAccessDate.Text = File.GetLastAccessTimeUtc(path: openFileDialog.FileName).ToString(); + } + + private void RadioButtonLastWriteDateLocalTime_CheckedChanged(object sender, EventArgs e) + { + textBoxLastWriteDate.Text = File.GetLastWriteTime(path: openFileDialog.FileName).ToString(); + } + + private void RadioButtonLastWriteDateUtc_CheckedChanged(object sender, EventArgs e) + { + textBoxLastWriteDate.Text = File.GetLastWriteTimeUtc(path: openFileDialog.FileName).ToString(); + } + + private void RadioButtonNewCreationDateLocalTime_CheckedChanged(object sender, EventArgs e) + { + dateTimePickerCreated.Value = dateTimePickerCreated.Value.ToLocalTime(); + } + + private void RadioButtonNewCreationDateUtc_CheckedChanged(object sender, EventArgs e) + { + dateTimePickerCreated.Value = dateTimePickerCreated.Value.ToUniversalTime(); + } + + private void RadioButtonNewLastAccessDateLocalTime_CheckedChanged(object sender, EventArgs e) + { + dateTimePickerAccessed.Value = dateTimePickerAccessed.Value.ToLocalTime(); + } + + private void RadioButtonNewLastAccessDateUtc_CheckedChanged(object sender, EventArgs e) + { + dateTimePickerAccessed.Value = dateTimePickerAccessed.Value.ToUniversalTime(); + } + + private void RadioButtonNewLastWriteDateLocalTime_CheckedChanged(object sender, EventArgs e) + { + dateTimePickerWrited.Value = dateTimePickerWrited.Value.ToLocalTime(); + } + + private void RadioButtonNewLastWriteDateUtc_CheckedChanged(object sender, EventArgs e) + { + dateTimePickerWrited.Value = dateTimePickerWrited.Value.ToUniversalTime(); + } + + #endregion } } diff --git a/FileDateTime Manipulator/FdtmForm.resx b/FileDateTime Manipulator/FdtmForm.resx index f5e1677..ceb396b 100644 --- a/FileDateTime Manipulator/FdtmForm.resx +++ b/FileDateTime Manipulator/FdtmForm.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 150, 17 + 17, 17 diff --git a/FileDateTime Manipulator/FileDateTime Manipulator.csproj b/FileDateTime Manipulator/FileDateTime Manipulator.csproj index 1f7d8fb..99740d3 100644 --- a/FileDateTime Manipulator/FileDateTime Manipulator.csproj +++ b/FileDateTime Manipulator/FileDateTime Manipulator.csproj @@ -22,8 +22,8 @@ false false true - 2 - 1.1.0.%2a + 3 + 1.2.0.%2a false true diff --git a/FileDateTime Manipulator/Properties/AssemblyInfo.cs b/FileDateTime Manipulator/Properties/AssemblyInfo.cs index 00d5b68..5b87d4c 100644 --- a/FileDateTime Manipulator/Properties/AssemblyInfo.cs +++ b/FileDateTime Manipulator/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.2")] -[assembly: AssemblyFileVersion("1.1.0.2")] +[assembly: AssemblyVersion("1.2.0.3")] +[assembly: AssemblyFileVersion("1.2.0.3")]