852 lines
29 KiB
C#
852 lines
29 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: CarotDAV.ConflictPromptForm
|
|
// Assembly: CarotDAV, Version=1.13.2.18337, Culture=neutral, PublicKeyToken=null
|
|
// MVID: C31F2651-A4A8-4D09-916A-8C6106F5E7C8
|
|
// Assembly location: F:\Eigene Dateien\Dropbox\portable Collection\Progs\CarotDAV\CarotDAV.exe
|
|
|
|
using Microsoft.VisualBasic.CompilerServices;
|
|
using Rei.Fs;
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CarotDAV
|
|
{
|
|
[DesignerGenerated]
|
|
public class ConflictPromptForm : Form
|
|
{
|
|
private IContainer components;
|
|
[AccessedThroughProperty("OverwriteRadio")]
|
|
private RadioButton _OverwriteRadio;
|
|
[AccessedThroughProperty("OverwriteNewerRadio")]
|
|
private RadioButton _OverwriteNewerRadio;
|
|
[AccessedThroughProperty("SkipRadio")]
|
|
private RadioButton _SkipRadio;
|
|
[AccessedThroughProperty("SourceTextBox")]
|
|
private TextBox _SourceTextBox;
|
|
[AccessedThroughProperty("m_CancelButton")]
|
|
private Button _m_CancelButton;
|
|
[AccessedThroughProperty("OKButton")]
|
|
private Button _OKButton;
|
|
[AccessedThroughProperty("IntegrateRadio")]
|
|
private RadioButton _IntegrateRadio;
|
|
[AccessedThroughProperty("DeleteRadio")]
|
|
private RadioButton _DeleteRadio;
|
|
[AccessedThroughProperty("ToAllCheck")]
|
|
private CheckBox _ToAllCheck;
|
|
[AccessedThroughProperty("RetryButton")]
|
|
private Button _RetryButton;
|
|
[AccessedThroughProperty("DestinationTextBox")]
|
|
private TextBox _DestinationTextBox;
|
|
[AccessedThroughProperty("Label1")]
|
|
private Label _Label1;
|
|
[AccessedThroughProperty("Label2")]
|
|
private Label _Label2;
|
|
[AccessedThroughProperty("MessageTextBox")]
|
|
private TextBox _MessageTextBox;
|
|
[AccessedThroughProperty("ChangeNameRadio")]
|
|
private RadioButton _ChangeNameRadio;
|
|
[AccessedThroughProperty("ResumeRadio")]
|
|
private RadioButton _ResumeRadio;
|
|
[AccessedThroughProperty("DestInfoTextBox")]
|
|
private TextBox _DestInfoTextBox;
|
|
[AccessedThroughProperty("SourceInfoTextBox")]
|
|
private TextBox _SourceInfoTextBox;
|
|
[AccessedThroughProperty("Timer1")]
|
|
private Timer _Timer1;
|
|
private ConflictType pConflict;
|
|
private ConflictAction pSolution;
|
|
private bool pEnableResume;
|
|
private FsAbility pDestinationAbility;
|
|
private int pRetryMinutes;
|
|
private DateTime pIdleStartTime;
|
|
|
|
public ConflictPromptForm()
|
|
{
|
|
this.Load += new EventHandler(this.ConflictPromptForm_Load);
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
[DebuggerNonUserCode]
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
try
|
|
{
|
|
if (!disposing || this.components == null)
|
|
return;
|
|
this.components.Dispose();
|
|
}
|
|
finally
|
|
{
|
|
base.Dispose(disposing);
|
|
}
|
|
}
|
|
|
|
[DebuggerStepThrough]
|
|
private void InitializeComponent()
|
|
{
|
|
this.components = (IContainer) new System.ComponentModel.Container();
|
|
this.OverwriteRadio = new RadioButton();
|
|
this.OverwriteNewerRadio = new RadioButton();
|
|
this.SkipRadio = new RadioButton();
|
|
this.SourceTextBox = new TextBox();
|
|
this.m_CancelButton = new Button();
|
|
this.OKButton = new Button();
|
|
this.IntegrateRadio = new RadioButton();
|
|
this.DeleteRadio = new RadioButton();
|
|
this.ToAllCheck = new CheckBox();
|
|
this.RetryButton = new Button();
|
|
this.DestinationTextBox = new TextBox();
|
|
this.Label1 = new Label();
|
|
this.Label2 = new Label();
|
|
this.MessageTextBox = new TextBox();
|
|
this.ChangeNameRadio = new RadioButton();
|
|
this.ResumeRadio = new RadioButton();
|
|
this.DestInfoTextBox = new TextBox();
|
|
this.SourceInfoTextBox = new TextBox();
|
|
this.Timer1 = new Timer(this.components);
|
|
this.SuspendLayout();
|
|
this.OverwriteRadio.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
this.OverwriteRadio.AutoSize = true;
|
|
RadioButton overwriteRadio1 = this.OverwriteRadio;
|
|
Point point1 = new Point(8, 216);
|
|
Point point2 = point1;
|
|
overwriteRadio1.Location = point2;
|
|
this.OverwriteRadio.Name = "OverwriteRadio";
|
|
RadioButton overwriteRadio2 = this.OverwriteRadio;
|
|
Size size1 = new Size(92, 16);
|
|
Size size2 = size1;
|
|
overwriteRadio2.Size = size2;
|
|
this.OverwriteRadio.TabIndex = 7;
|
|
this.OverwriteRadio.TabStop = true;
|
|
this.OverwriteRadio.Text = "Overwrite (&O)";
|
|
this.OverwriteRadio.UseVisualStyleBackColor = true;
|
|
this.OverwriteNewerRadio.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
this.OverwriteNewerRadio.AutoSize = true;
|
|
RadioButton overwriteNewerRadio1 = this.OverwriteNewerRadio;
|
|
point1 = new Point(8, 240);
|
|
Point point3 = point1;
|
|
overwriteNewerRadio1.Location = point3;
|
|
this.OverwriteNewerRadio.Name = "OverwriteNewerRadio";
|
|
RadioButton overwriteNewerRadio2 = this.OverwriteNewerRadio;
|
|
size1 = new Size(137, 16);
|
|
Size size3 = size1;
|
|
overwriteNewerRadio2.Size = size3;
|
|
this.OverwriteNewerRadio.TabIndex = 8;
|
|
this.OverwriteNewerRadio.TabStop = true;
|
|
this.OverwriteNewerRadio.Text = "Overwrite if newer (&N)";
|
|
this.OverwriteNewerRadio.UseVisualStyleBackColor = true;
|
|
this.SkipRadio.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
this.SkipRadio.AutoSize = true;
|
|
RadioButton skipRadio1 = this.SkipRadio;
|
|
point1 = new Point(168, 240);
|
|
Point point4 = point1;
|
|
skipRadio1.Location = point4;
|
|
this.SkipRadio.Name = "SkipRadio";
|
|
RadioButton skipRadio2 = this.SkipRadio;
|
|
size1 = new Size(64, 16);
|
|
Size size4 = size1;
|
|
skipRadio2.Size = size4;
|
|
this.SkipRadio.TabIndex = 12;
|
|
this.SkipRadio.TabStop = true;
|
|
this.SkipRadio.Text = "Skip (&S)";
|
|
this.SkipRadio.UseVisualStyleBackColor = true;
|
|
this.SourceTextBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
TextBox sourceTextBox1 = this.SourceTextBox;
|
|
point1 = new Point(8, 48);
|
|
Point point5 = point1;
|
|
sourceTextBox1.Location = point5;
|
|
this.SourceTextBox.Multiline = true;
|
|
this.SourceTextBox.Name = "SourceTextBox";
|
|
this.SourceTextBox.ReadOnly = true;
|
|
TextBox sourceTextBox2 = this.SourceTextBox;
|
|
size1 = new Size(312, 40);
|
|
Size size5 = size1;
|
|
sourceTextBox2.Size = size5;
|
|
this.SourceTextBox.TabIndex = 2;
|
|
this.SourceTextBox.TabStop = false;
|
|
this.m_CancelButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
this.m_CancelButton.DialogResult = DialogResult.Cancel;
|
|
Button mCancelButton1 = this.m_CancelButton;
|
|
point1 = new Point(248, 352);
|
|
Point point6 = point1;
|
|
mCancelButton1.Location = point6;
|
|
this.m_CancelButton.Name = "m_CancelButton";
|
|
Button mCancelButton2 = this.m_CancelButton;
|
|
size1 = new Size(72, 24);
|
|
Size size6 = size1;
|
|
mCancelButton2.Size = size6;
|
|
this.m_CancelButton.TabIndex = 17;
|
|
this.m_CancelButton.Text = "Cancel All";
|
|
this.m_CancelButton.UseVisualStyleBackColor = true;
|
|
this.OKButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
Button okButton1 = this.OKButton;
|
|
point1 = new Point(168, 352);
|
|
Point point7 = point1;
|
|
okButton1.Location = point7;
|
|
this.OKButton.Name = "OKButton";
|
|
Button okButton2 = this.OKButton;
|
|
size1 = new Size(72, 24);
|
|
Size size7 = size1;
|
|
okButton2.Size = size7;
|
|
this.OKButton.TabIndex = 16;
|
|
this.OKButton.Text = "OK";
|
|
this.OKButton.UseVisualStyleBackColor = true;
|
|
this.IntegrateRadio.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
this.IntegrateRadio.AutoSize = true;
|
|
RadioButton integrateRadio1 = this.IntegrateRadio;
|
|
point1 = new Point(168, 216);
|
|
Point point8 = point1;
|
|
integrateRadio1.Location = point8;
|
|
this.IntegrateRadio.Name = "IntegrateRadio";
|
|
RadioButton integrateRadio2 = this.IntegrateRadio;
|
|
size1 = new Size(83, 16);
|
|
Size size8 = size1;
|
|
integrateRadio2.Size = size8;
|
|
this.IntegrateRadio.TabIndex = 11;
|
|
this.IntegrateRadio.TabStop = true;
|
|
this.IntegrateRadio.Text = "Integrate (&I)";
|
|
this.IntegrateRadio.UseVisualStyleBackColor = true;
|
|
this.DeleteRadio.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
this.DeleteRadio.AutoSize = true;
|
|
RadioButton deleteRadio1 = this.DeleteRadio;
|
|
point1 = new Point(8, 288);
|
|
Point point9 = point1;
|
|
deleteRadio1.Location = point9;
|
|
this.DeleteRadio.Name = "DeleteRadio";
|
|
RadioButton deleteRadio2 = this.DeleteRadio;
|
|
size1 = new Size((int) sbyte.MaxValue, 16);
|
|
Size size9 = size1;
|
|
deleteRadio2.Size = size9;
|
|
this.DeleteRadio.TabIndex = 10;
|
|
this.DeleteRadio.TabStop = true;
|
|
this.DeleteRadio.Text = "Delete and write (&D)";
|
|
this.DeleteRadio.UseVisualStyleBackColor = true;
|
|
this.ToAllCheck.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
this.ToAllCheck.AutoSize = true;
|
|
CheckBox toAllCheck1 = this.ToAllCheck;
|
|
point1 = new Point(8, 320);
|
|
Point point10 = point1;
|
|
toAllCheck1.Location = point10;
|
|
this.ToAllCheck.Name = "ToAllCheck";
|
|
CheckBox toAllCheck2 = this.ToAllCheck;
|
|
size1 = new Size(73, 16);
|
|
Size size10 = size1;
|
|
toAllCheck2.Size = size10;
|
|
this.ToAllCheck.TabIndex = 14;
|
|
this.ToAllCheck.Text = "To all (&A)";
|
|
this.ToAllCheck.UseVisualStyleBackColor = true;
|
|
this.RetryButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
Button retryButton1 = this.RetryButton;
|
|
point1 = new Point(64, 352);
|
|
Point point11 = point1;
|
|
retryButton1.Location = point11;
|
|
this.RetryButton.Name = "RetryButton";
|
|
Button retryButton2 = this.RetryButton;
|
|
size1 = new Size(96, 24);
|
|
Size size11 = size1;
|
|
retryButton2.Size = size11;
|
|
this.RetryButton.TabIndex = 15;
|
|
this.RetryButton.Text = "Retry";
|
|
this.RetryButton.UseVisualStyleBackColor = true;
|
|
this.DestinationTextBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
TextBox destinationTextBox1 = this.DestinationTextBox;
|
|
point1 = new Point(8, 136);
|
|
Point point12 = point1;
|
|
destinationTextBox1.Location = point12;
|
|
this.DestinationTextBox.Multiline = true;
|
|
this.DestinationTextBox.Name = "DestinationTextBox";
|
|
this.DestinationTextBox.ReadOnly = true;
|
|
TextBox destinationTextBox2 = this.DestinationTextBox;
|
|
size1 = new Size(312, 40);
|
|
Size size12 = size1;
|
|
destinationTextBox2.Size = size12;
|
|
this.DestinationTextBox.TabIndex = 5;
|
|
this.DestinationTextBox.TabStop = false;
|
|
this.Label1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
this.Label1.AutoSize = true;
|
|
Label label1_1 = this.Label1;
|
|
point1 = new Point(8, 32);
|
|
Point point13 = point1;
|
|
label1_1.Location = point13;
|
|
this.Label1.Name = "Label1";
|
|
Label label1_2 = this.Label1;
|
|
size1 = new Size(40, 12);
|
|
Size size13 = size1;
|
|
label1_2.Size = size13;
|
|
this.Label1.TabIndex = 1;
|
|
this.Label1.Text = "Source";
|
|
this.Label2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
this.Label2.AutoSize = true;
|
|
Label label2_1 = this.Label2;
|
|
point1 = new Point(8, 120);
|
|
Point point14 = point1;
|
|
label2_1.Location = point14;
|
|
this.Label2.Name = "Label2";
|
|
Label label2_2 = this.Label2;
|
|
size1 = new Size(63, 12);
|
|
Size size14 = size1;
|
|
label2_2.Size = size14;
|
|
this.Label2.TabIndex = 4;
|
|
this.Label2.Text = "Destination";
|
|
this.MessageTextBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
this.MessageTextBox.BorderStyle = BorderStyle.None;
|
|
TextBox messageTextBox1 = this.MessageTextBox;
|
|
point1 = new Point(8, 8);
|
|
Point point15 = point1;
|
|
messageTextBox1.Location = point15;
|
|
this.MessageTextBox.Name = "MessageTextBox";
|
|
this.MessageTextBox.ReadOnly = true;
|
|
TextBox messageTextBox2 = this.MessageTextBox;
|
|
size1 = new Size(312, 12);
|
|
Size size15 = size1;
|
|
messageTextBox2.Size = size15;
|
|
this.MessageTextBox.TabIndex = 0;
|
|
this.MessageTextBox.TabStop = false;
|
|
this.MessageTextBox.Text = "Message";
|
|
this.ChangeNameRadio.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
this.ChangeNameRadio.AutoSize = true;
|
|
RadioButton changeNameRadio1 = this.ChangeNameRadio;
|
|
point1 = new Point(168, 264);
|
|
Point point16 = point1;
|
|
changeNameRadio1.Location = point16;
|
|
this.ChangeNameRadio.Name = "ChangeNameRadio";
|
|
RadioButton changeNameRadio2 = this.ChangeNameRadio;
|
|
size1 = new Size(114, 16);
|
|
Size size16 = size1;
|
|
changeNameRadio2.Size = size16;
|
|
this.ChangeNameRadio.TabIndex = 13;
|
|
this.ChangeNameRadio.TabStop = true;
|
|
this.ChangeNameRadio.Text = "Change Name (&C)";
|
|
this.ChangeNameRadio.UseVisualStyleBackColor = true;
|
|
this.ResumeRadio.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
this.ResumeRadio.AutoSize = true;
|
|
RadioButton resumeRadio1 = this.ResumeRadio;
|
|
point1 = new Point(8, 264);
|
|
Point point17 = point1;
|
|
resumeRadio1.Location = point17;
|
|
this.ResumeRadio.Name = "ResumeRadio";
|
|
RadioButton resumeRadio2 = this.ResumeRadio;
|
|
size1 = new Size(136, 16);
|
|
Size size17 = size1;
|
|
resumeRadio2.Size = size17;
|
|
this.ResumeRadio.TabIndex = 9;
|
|
this.ResumeRadio.TabStop = true;
|
|
this.ResumeRadio.Text = "Resume if smaller (&R)";
|
|
this.ResumeRadio.UseVisualStyleBackColor = true;
|
|
this.DestInfoTextBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
TextBox destInfoTextBox1 = this.DestInfoTextBox;
|
|
point1 = new Point(136, 176);
|
|
Point point18 = point1;
|
|
destInfoTextBox1.Location = point18;
|
|
this.DestInfoTextBox.Multiline = true;
|
|
this.DestInfoTextBox.Name = "DestInfoTextBox";
|
|
this.DestInfoTextBox.ReadOnly = true;
|
|
TextBox destInfoTextBox2 = this.DestInfoTextBox;
|
|
size1 = new Size(184, 32);
|
|
Size size18 = size1;
|
|
destInfoTextBox2.Size = size18;
|
|
this.DestInfoTextBox.TabIndex = 6;
|
|
this.DestInfoTextBox.TabStop = false;
|
|
this.DestInfoTextBox.TextAlign = HorizontalAlignment.Right;
|
|
this.SourceInfoTextBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
TextBox sourceInfoTextBox1 = this.SourceInfoTextBox;
|
|
point1 = new Point(136, 88);
|
|
Point point19 = point1;
|
|
sourceInfoTextBox1.Location = point19;
|
|
this.SourceInfoTextBox.Multiline = true;
|
|
this.SourceInfoTextBox.Name = "SourceInfoTextBox";
|
|
this.SourceInfoTextBox.ReadOnly = true;
|
|
TextBox sourceInfoTextBox2 = this.SourceInfoTextBox;
|
|
size1 = new Size(184, 32);
|
|
Size size19 = size1;
|
|
sourceInfoTextBox2.Size = size19;
|
|
this.SourceInfoTextBox.TabIndex = 3;
|
|
this.SourceInfoTextBox.TabStop = false;
|
|
this.SourceInfoTextBox.TextAlign = HorizontalAlignment.Right;
|
|
this.AcceptButton = (IButtonControl) this.OKButton;
|
|
this.AutoScaleDimensions = new SizeF(6f, 12f);
|
|
this.AutoScaleMode = AutoScaleMode.Font;
|
|
this.CancelButton = (IButtonControl) this.m_CancelButton;
|
|
size1 = new Size(328, 384);
|
|
this.ClientSize = size1;
|
|
this.Controls.Add((Control) this.DestInfoTextBox);
|
|
this.Controls.Add((Control) this.SourceInfoTextBox);
|
|
this.Controls.Add((Control) this.ResumeRadio);
|
|
this.Controls.Add((Control) this.ChangeNameRadio);
|
|
this.Controls.Add((Control) this.MessageTextBox);
|
|
this.Controls.Add((Control) this.Label2);
|
|
this.Controls.Add((Control) this.Label1);
|
|
this.Controls.Add((Control) this.DestinationTextBox);
|
|
this.Controls.Add((Control) this.RetryButton);
|
|
this.Controls.Add((Control) this.ToAllCheck);
|
|
this.Controls.Add((Control) this.DeleteRadio);
|
|
this.Controls.Add((Control) this.IntegrateRadio);
|
|
this.Controls.Add((Control) this.m_CancelButton);
|
|
this.Controls.Add((Control) this.OKButton);
|
|
this.Controls.Add((Control) this.SourceTextBox);
|
|
this.Controls.Add((Control) this.SkipRadio);
|
|
this.Controls.Add((Control) this.OverwriteNewerRadio);
|
|
this.Controls.Add((Control) this.OverwriteRadio);
|
|
this.MaximizeBox = false;
|
|
this.MinimizeBox = false;
|
|
size1 = new Size(344, 422);
|
|
this.MinimumSize = size1;
|
|
this.Name = nameof (ConflictPromptForm);
|
|
this.StartPosition = FormStartPosition.CenterParent;
|
|
this.Text = "Overwrite Confirmation";
|
|
this.ResumeLayout(false);
|
|
this.PerformLayout();
|
|
}
|
|
|
|
internal virtual RadioButton OverwriteRadio
|
|
{
|
|
get
|
|
{
|
|
return this._OverwriteRadio;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._OverwriteRadio = value;
|
|
}
|
|
}
|
|
|
|
internal virtual RadioButton OverwriteNewerRadio
|
|
{
|
|
get
|
|
{
|
|
return this._OverwriteNewerRadio;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._OverwriteNewerRadio = value;
|
|
}
|
|
}
|
|
|
|
internal virtual RadioButton SkipRadio
|
|
{
|
|
get
|
|
{
|
|
return this._SkipRadio;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._SkipRadio = value;
|
|
}
|
|
}
|
|
|
|
internal virtual TextBox SourceTextBox
|
|
{
|
|
get
|
|
{
|
|
return this._SourceTextBox;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._SourceTextBox = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Button m_CancelButton
|
|
{
|
|
get
|
|
{
|
|
return this._m_CancelButton;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
EventHandler eventHandler = new EventHandler(this.m_CancelButton_Click);
|
|
if (this._m_CancelButton != null)
|
|
this._m_CancelButton.Click -= eventHandler;
|
|
this._m_CancelButton = value;
|
|
if (this._m_CancelButton == null)
|
|
return;
|
|
this._m_CancelButton.Click += eventHandler;
|
|
}
|
|
}
|
|
|
|
internal virtual Button OKButton
|
|
{
|
|
get
|
|
{
|
|
return this._OKButton;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
EventHandler eventHandler = new EventHandler(this.OKButton_Click);
|
|
if (this._OKButton != null)
|
|
this._OKButton.Click -= eventHandler;
|
|
this._OKButton = value;
|
|
if (this._OKButton == null)
|
|
return;
|
|
this._OKButton.Click += eventHandler;
|
|
}
|
|
}
|
|
|
|
internal virtual RadioButton IntegrateRadio
|
|
{
|
|
get
|
|
{
|
|
return this._IntegrateRadio;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._IntegrateRadio = value;
|
|
}
|
|
}
|
|
|
|
internal virtual RadioButton DeleteRadio
|
|
{
|
|
get
|
|
{
|
|
return this._DeleteRadio;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._DeleteRadio = value;
|
|
}
|
|
}
|
|
|
|
internal virtual CheckBox ToAllCheck
|
|
{
|
|
get
|
|
{
|
|
return this._ToAllCheck;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._ToAllCheck = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Button RetryButton
|
|
{
|
|
get
|
|
{
|
|
return this._RetryButton;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
EventHandler eventHandler = new EventHandler(this.RetryButton_Click);
|
|
if (this._RetryButton != null)
|
|
this._RetryButton.Click -= eventHandler;
|
|
this._RetryButton = value;
|
|
if (this._RetryButton == null)
|
|
return;
|
|
this._RetryButton.Click += eventHandler;
|
|
}
|
|
}
|
|
|
|
internal virtual TextBox DestinationTextBox
|
|
{
|
|
get
|
|
{
|
|
return this._DestinationTextBox;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._DestinationTextBox = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label1
|
|
{
|
|
get
|
|
{
|
|
return this._Label1;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._Label1 = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Label Label2
|
|
{
|
|
get
|
|
{
|
|
return this._Label2;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._Label2 = value;
|
|
}
|
|
}
|
|
|
|
internal virtual TextBox MessageTextBox
|
|
{
|
|
get
|
|
{
|
|
return this._MessageTextBox;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._MessageTextBox = value;
|
|
}
|
|
}
|
|
|
|
internal virtual RadioButton ChangeNameRadio
|
|
{
|
|
get
|
|
{
|
|
return this._ChangeNameRadio;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._ChangeNameRadio = value;
|
|
}
|
|
}
|
|
|
|
internal virtual RadioButton ResumeRadio
|
|
{
|
|
get
|
|
{
|
|
return this._ResumeRadio;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._ResumeRadio = value;
|
|
}
|
|
}
|
|
|
|
internal virtual TextBox DestInfoTextBox
|
|
{
|
|
get
|
|
{
|
|
return this._DestInfoTextBox;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._DestInfoTextBox = value;
|
|
}
|
|
}
|
|
|
|
internal virtual TextBox SourceInfoTextBox
|
|
{
|
|
get
|
|
{
|
|
return this._SourceInfoTextBox;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
this._SourceInfoTextBox = value;
|
|
}
|
|
}
|
|
|
|
internal virtual Timer Timer1
|
|
{
|
|
get
|
|
{
|
|
return this._Timer1;
|
|
}
|
|
[MethodImpl(MethodImplOptions.Synchronized)] set
|
|
{
|
|
EventHandler eventHandler = new EventHandler(this.Timer1_Tick);
|
|
if (this._Timer1 != null)
|
|
this._Timer1.Tick -= eventHandler;
|
|
this._Timer1 = value;
|
|
if (this._Timer1 == null)
|
|
return;
|
|
this._Timer1.Tick += eventHandler;
|
|
}
|
|
}
|
|
|
|
public ConflictType Conflict
|
|
{
|
|
get
|
|
{
|
|
return this.pConflict;
|
|
}
|
|
set
|
|
{
|
|
this.pConflict = value;
|
|
}
|
|
}
|
|
|
|
public ConflictAction Solution
|
|
{
|
|
get
|
|
{
|
|
return this.pSolution;
|
|
}
|
|
}
|
|
|
|
public bool ToAll
|
|
{
|
|
get
|
|
{
|
|
return this.ToAllCheck.Checked;
|
|
}
|
|
}
|
|
|
|
private void ConflictPromptForm_Load(object sender, EventArgs e)
|
|
{
|
|
this.Icon = CarotDAV.My.Resources.Resources.CarotDAV;
|
|
switch (this.Conflict)
|
|
{
|
|
case ConflictType.FolderToFolder:
|
|
this.MessageTextBox.Text = "Same name folder exists. Choose action.";
|
|
this.OverwriteRadio.Enabled = false;
|
|
this.OverwriteNewerRadio.Enabled = false;
|
|
this.ResumeRadio.Enabled = false;
|
|
this.IntegrateRadio.Enabled = true;
|
|
this.DeleteRadio.Enabled = true;
|
|
this.SkipRadio.Enabled = true;
|
|
this.ChangeNameRadio.Enabled = true;
|
|
this.IntegrateRadio.Checked = true;
|
|
break;
|
|
case ConflictType.FolderToFile:
|
|
this.MessageTextBox.Text = "Same name file exists. Choose action.";
|
|
this.OverwriteRadio.Enabled = false;
|
|
this.OverwriteNewerRadio.Enabled = false;
|
|
this.ResumeRadio.Enabled = false;
|
|
this.IntegrateRadio.Enabled = false;
|
|
this.DeleteRadio.Enabled = true;
|
|
this.SkipRadio.Enabled = true;
|
|
this.ChangeNameRadio.Enabled = true;
|
|
this.SkipRadio.Checked = true;
|
|
break;
|
|
case ConflictType.FileToFolder:
|
|
this.MessageTextBox.Text = "Same name folder exists. Choose action.";
|
|
this.OverwriteRadio.Enabled = false;
|
|
this.OverwriteNewerRadio.Enabled = false;
|
|
this.ResumeRadio.Enabled = false;
|
|
this.IntegrateRadio.Enabled = false;
|
|
this.DeleteRadio.Enabled = true;
|
|
this.SkipRadio.Enabled = true;
|
|
this.ChangeNameRadio.Enabled = true;
|
|
this.SkipRadio.Checked = true;
|
|
break;
|
|
case ConflictType.FileToFile:
|
|
this.MessageTextBox.Text = "Same name file exists. Choose action.";
|
|
this.OverwriteRadio.Enabled = (this.pDestinationAbility & FsAbility.OverWriteFile) != FsAbility.None;
|
|
this.OverwriteNewerRadio.Enabled = (this.pDestinationAbility & FsAbility.OverWriteFile) != FsAbility.None;
|
|
this.ResumeRadio.Enabled = this.pEnableResume;
|
|
this.IntegrateRadio.Enabled = false;
|
|
this.DeleteRadio.Enabled = true;
|
|
this.SkipRadio.Enabled = true;
|
|
this.ChangeNameRadio.Enabled = true;
|
|
if (this.OverwriteRadio.Enabled)
|
|
{
|
|
this.OverwriteRadio.Checked = true;
|
|
break;
|
|
}
|
|
if (this.DeleteRadio.Enabled)
|
|
{
|
|
this.DeleteRadio.Checked = true;
|
|
break;
|
|
}
|
|
break;
|
|
case ConflictType.Move:
|
|
this.MessageTextBox.Text = "Same name resource exists. Choose action.";
|
|
this.OverwriteRadio.Enabled = (this.pDestinationAbility & FsAbility.MoveOver) != FsAbility.None;
|
|
this.OverwriteNewerRadio.Enabled = false;
|
|
this.ResumeRadio.Enabled = false;
|
|
this.IntegrateRadio.Enabled = false;
|
|
this.DeleteRadio.Enabled = true;
|
|
this.SkipRadio.Enabled = true;
|
|
this.ChangeNameRadio.Enabled = true;
|
|
this.ChangeNameRadio.Checked = true;
|
|
break;
|
|
case ConflictType.Copy:
|
|
this.MessageTextBox.Text = "Same name resource exists. Choose action.";
|
|
this.OverwriteRadio.Enabled = (this.pDestinationAbility & FsAbility.CopyOver) != FsAbility.None;
|
|
this.OverwriteNewerRadio.Enabled = false;
|
|
this.ResumeRadio.Enabled = false;
|
|
this.IntegrateRadio.Enabled = false;
|
|
this.DeleteRadio.Enabled = true;
|
|
this.SkipRadio.Enabled = true;
|
|
this.ChangeNameRadio.Enabled = true;
|
|
this.ChangeNameRadio.Checked = true;
|
|
break;
|
|
}
|
|
this.pIdleStartTime = DateTime.MaxValue;
|
|
this.Activate();
|
|
this.Timer1.Start();
|
|
}
|
|
|
|
private void RetryButton_Click(object sender, EventArgs e)
|
|
{
|
|
this.pSolution = ConflictAction.Retry;
|
|
this.DialogResult = DialogResult.Retry;
|
|
}
|
|
|
|
private void OKButton_Click(object sender, EventArgs e)
|
|
{
|
|
this.pSolution = !this.OverwriteRadio.Checked ? (!this.OverwriteNewerRadio.Checked ? (!this.ResumeRadio.Checked ? (!this.IntegrateRadio.Checked ? (!this.DeleteRadio.Checked ? (!this.ChangeNameRadio.Checked ? ConflictAction.Skip : ConflictAction.ChangeName) : ConflictAction.DeleteTarget) : ConflictAction.Integrate) : ConflictAction.Resume) : ConflictAction.OverwriteNewer) : ConflictAction.Overwrite;
|
|
this.DialogResult = DialogResult.OK;
|
|
}
|
|
|
|
private void m_CancelButton_Click(object sender, EventArgs e)
|
|
{
|
|
this.pSolution = ConflictAction.CancelAll;
|
|
}
|
|
|
|
public static ConflictPromptFormResult ShowDialog(IWin32Window owner, SimpleResourceInfo source, SimpleResourceInfo destination, ConflictType type, bool supportresume, FsAbility destability, int retryminutes)
|
|
{
|
|
ConflictPromptFormResult promptFormResult = new ConflictPromptFormResult();
|
|
using (ConflictPromptForm conflictPromptForm = new ConflictPromptForm())
|
|
{
|
|
conflictPromptForm.SourceTextBox.Text = source.Name;
|
|
conflictPromptForm.SourceInfoTextBox.Text = source.Size.ToString() + " Byte\r\n" + source.LastModifiedTime.ToString();
|
|
conflictPromptForm.DestinationTextBox.Text = destination.Name;
|
|
conflictPromptForm.DestInfoTextBox.Text = destination.Size.ToString() + " Byte\r\n" + destination.LastModifiedTime.ToString();
|
|
conflictPromptForm.Conflict = type;
|
|
conflictPromptForm.pEnableResume = source.Size > destination.Size && type == ConflictType.FileToFile && (supportresume && source.Size >= 0L) && destination.Size >= 0L;
|
|
conflictPromptForm.pDestinationAbility = destability;
|
|
conflictPromptForm.pRetryMinutes = retryminutes;
|
|
conflictPromptForm.pIdleStartTime = DateTime.Now;
|
|
int num = (int) conflictPromptForm.ShowDialog(owner);
|
|
promptFormResult.Type = type;
|
|
promptFormResult.Action = conflictPromptForm.Solution;
|
|
promptFormResult.ToAll = conflictPromptForm.ToAll;
|
|
}
|
|
return promptFormResult;
|
|
}
|
|
|
|
private void Timer1_Tick(object sender, EventArgs e)
|
|
{
|
|
if (this.pRetryMinutes < 0)
|
|
return;
|
|
if ((long) Misc.GetIdleTime() > 600000L)
|
|
{
|
|
if (DateTime.Compare(this.pIdleStartTime, DateTime.MaxValue) == 0)
|
|
this.pIdleStartTime = DateTime.Now;
|
|
}
|
|
else
|
|
{
|
|
if (Form.ActiveForm == this)
|
|
{
|
|
if (DateTime.Compare(this.pIdleStartTime, DateTime.MaxValue) == 0)
|
|
return;
|
|
this.pIdleStartTime = DateTime.MaxValue;
|
|
this.RetryButton.Text = "Retry";
|
|
return;
|
|
}
|
|
if (DateTime.Compare(this.pIdleStartTime, DateTime.MaxValue) == 0)
|
|
this.pIdleStartTime = DateTime.Now;
|
|
}
|
|
if (DateTime.Compare(this.pIdleStartTime, DateTime.MaxValue) == 0)
|
|
return;
|
|
TimeSpan timeSpan = TimeSpan.FromMinutes((double) this.pRetryMinutes).Subtract(DateTime.Now.Subtract(this.pIdleStartTime));
|
|
if (timeSpan.TotalSeconds < 0.0)
|
|
{
|
|
this.pSolution = ConflictAction.AutoRetry;
|
|
this.DialogResult = DialogResult.Retry;
|
|
this.Close();
|
|
}
|
|
else if (timeSpan.TotalSeconds <= 60.0)
|
|
this.RetryButton.Text = string.Format("Retry {0:f0}[s]", (object) timeSpan.TotalSeconds);
|
|
else if (timeSpan.TotalMinutes <= 60.0)
|
|
this.RetryButton.Text = string.Format("Retry {0:f0}[min]", (object) timeSpan.TotalMinutes);
|
|
else if (timeSpan.TotalHours <= 24.0)
|
|
this.RetryButton.Text = string.Format("Retry {0:f0}[h]", (object) timeSpan.TotalHours);
|
|
else
|
|
this.RetryButton.Text = "Retry";
|
|
}
|
|
}
|
|
}
|