mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
@@ -13,19 +13,19 @@ namespace mRemoteNG.UI.Window
|
||||
public class AboutWindow : BaseWindow
|
||||
{
|
||||
#region Form Init
|
||||
private Label lblCopyright;
|
||||
private Label lblTitle;
|
||||
private Label lblVersion;
|
||||
private Label lblLicense;
|
||||
private TextBox txtChangeLog;
|
||||
private Label lblChangeLog;
|
||||
private Panel pnlBottom;
|
||||
private PictureBox pbLogo;
|
||||
private Label lblEdition;
|
||||
private Label lblCredits;
|
||||
private TextBox txtCredits;
|
||||
internal Label lblCopyright;
|
||||
internal Label lblTitle;
|
||||
internal Label lblVersion;
|
||||
internal Label lblLicense;
|
||||
internal TextBox txtChangeLog;
|
||||
internal Label lblChangeLog;
|
||||
internal Panel pnlBottom;
|
||||
internal PictureBox pbLogo;
|
||||
internal Label lblEdition;
|
||||
internal Label lblCredits;
|
||||
internal TextBox txtCredits;
|
||||
private TextBox verText;
|
||||
private Panel pnlTop;
|
||||
internal Panel pnlTop;
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using mRemoteNG.UI.Forms;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
|
||||
|
||||
namespace mRemoteNG.UI.Window
|
||||
@@ -7,40 +7,49 @@ namespace mRemoteNG.UI.Window
|
||||
public class BaseWindow : DockContent
|
||||
{
|
||||
#region Private Variables
|
||||
|
||||
private WindowType _WindowType;
|
||||
private DockContent _DockPnl;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public BaseWindow()
|
||||
{
|
||||
//InitializeComponent();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
|
||||
protected WindowType WindowType { get; set; }
|
||||
|
||||
protected DockContent DockPnl { get; set; }
|
||||
|
||||
public WindowType WindowType
|
||||
{
|
||||
get { return this._WindowType; }
|
||||
set { this._WindowType = value; }
|
||||
}
|
||||
|
||||
public DockContent DockPnl
|
||||
{
|
||||
get { return this._DockPnl; }
|
||||
set { this._DockPnl = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
public void SetFormText(string t)
|
||||
public void SetFormText(string Text)
|
||||
{
|
||||
this.Text = t;
|
||||
this.TabText = t;
|
||||
this.Text = Text;
|
||||
this.TabText = Text;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Private Methods
|
||||
/*
|
||||
private void Base_Load(object sender, EventArgs e)
|
||||
private void Base_Load(System.Object sender, System.EventArgs e)
|
||||
{
|
||||
FrmMain.Default.ShowHidePanelTabs();
|
||||
}
|
||||
|
||||
private void Base_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e)
|
||||
|
||||
private void Base_FormClosed(System.Object sender, System.Windows.Forms.FormClosedEventArgs e)
|
||||
{
|
||||
FrmMain.Default.ShowHidePanelTabs(this);
|
||||
}
|
||||
*/
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,6 @@ using mRemoteNG.Tools;
|
||||
using mRemoteNG.UI.Forms;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
using TextBox = System.Windows.Forms.TextBox;
|
||||
// ReSharper disable RedundantCast
|
||||
|
||||
namespace mRemoteNG.UI.Window
|
||||
{
|
||||
@@ -276,8 +275,8 @@ namespace mRemoteNG.UI.Window
|
||||
this.Controls.Add(this.grpFiles);
|
||||
this.Controls.Add(this.grpConnection);
|
||||
this.Controls.Add(this.pbStatus);
|
||||
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, (byte)0);
|
||||
this.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
|
||||
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "SSHTransferWindow";
|
||||
this.TabText = "SSH File Transfer";
|
||||
this.Text = "SSH File Transfer";
|
||||
@@ -298,26 +297,50 @@ namespace mRemoteNG.UI.Window
|
||||
#region Public Properties
|
||||
public string Hostname
|
||||
{
|
||||
get => txtHost.Text;
|
||||
set => txtHost.Text = value;
|
||||
get
|
||||
{
|
||||
return txtHost.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtHost.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Port
|
||||
{
|
||||
get => txtPort.Text;
|
||||
set => txtPort.Text = value;
|
||||
get
|
||||
{
|
||||
return txtPort.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtPort.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Username
|
||||
{
|
||||
get => txtUser.Text;
|
||||
set => txtUser.Text = value;
|
||||
get
|
||||
{
|
||||
return txtUser.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtUser.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get => txtPassword.Text;
|
||||
set => txtPassword.Text = value;
|
||||
get
|
||||
{
|
||||
return txtPassword.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtPassword.Text = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -471,7 +494,7 @@ namespace mRemoteNG.UI.Window
|
||||
private int maxVal;
|
||||
private int curVal;
|
||||
|
||||
private delegate void SetStatusCB();
|
||||
delegate void SetStatusCB();
|
||||
private void SetStatus()
|
||||
{
|
||||
if (pbStatus.InvokeRequired)
|
||||
@@ -486,7 +509,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private delegate void EnableButtonsCB();
|
||||
delegate void EnableButtonsCB();
|
||||
private void EnableButtons()
|
||||
{
|
||||
if (btnTransfer.InvokeRequired)
|
||||
@@ -500,7 +523,7 @@ namespace mRemoteNG.UI.Window
|
||||
}
|
||||
}
|
||||
|
||||
private delegate void DisableButtonsCB();
|
||||
delegate void DisableButtonsCB();
|
||||
private void DisableButtons()
|
||||
{
|
||||
if (btnTransfer.InvokeRequired)
|
||||
@@ -542,10 +565,12 @@ namespace mRemoteNG.UI.Window
|
||||
#region Form Stuff
|
||||
private void btnBrowse_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (oDlg.ShowDialog() != DialogResult.OK) return;
|
||||
if (oDlg.FileName != "")
|
||||
if (oDlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
txtLocalFile.Text = oDlg.FileName;
|
||||
if (oDlg.FileName != "")
|
||||
{
|
||||
txtLocalFile.Text = oDlg.FileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,16 +13,16 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
#region Form Init
|
||||
internal MenuStrip msMain;
|
||||
private ToolStripMenuItem mMenFile;
|
||||
private ToolStripMenuItem mMenFileSaveAll;
|
||||
private ToolStripMenuItem mMenFileRemoveAll;
|
||||
internal ToolStripMenuItem mMenFile;
|
||||
internal ToolStripMenuItem mMenFileSaveAll;
|
||||
internal ToolStripMenuItem mMenFileRemoveAll;
|
||||
internal ContextMenuStrip cMenScreenshot;
|
||||
private System.ComponentModel.Container components;
|
||||
private ToolStripMenuItem cMenScreenshotCopy;
|
||||
private ToolStripMenuItem cMenScreenshotSave;
|
||||
private System.ComponentModel.Container components = null;
|
||||
internal ToolStripMenuItem cMenScreenshotCopy;
|
||||
internal ToolStripMenuItem cMenScreenshotSave;
|
||||
internal SaveFileDialog dlgSaveSingleImage;
|
||||
internal FolderBrowserDialog dlgSaveAllImages;
|
||||
private FlowLayoutPanel flpScreenshots;
|
||||
internal FlowLayoutPanel flpScreenshots;
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
@@ -163,7 +163,7 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
}
|
||||
|
||||
private ScreenshotManagerWindow(DockContent panel)
|
||||
public ScreenshotManagerWindow(DockContent panel)
|
||||
{
|
||||
WindowType = WindowType.ScreenshotManager;
|
||||
DockPnl = panel;
|
||||
@@ -174,7 +174,7 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
var nPB = new PictureBox();
|
||||
PictureBox nPB = new PictureBox();
|
||||
nPB.MouseDown += pbScreenshot_MouseDown;
|
||||
|
||||
nPB.Parent = flpScreenshots;
|
||||
@@ -185,7 +185,7 @@ namespace mRemoteNG.UI.Window
|
||||
nPB.Size = new Size(100, 100); //New Size((Screenshot.Width / 100) * 20, (Screenshot.Height / 100) * 20)
|
||||
nPB.Show();
|
||||
|
||||
var nBtn = new Button();
|
||||
Button nBtn = new Button();
|
||||
nBtn.Click += btnCloseScreenshot_Click;
|
||||
|
||||
nBtn.Parent = nPB;
|
||||
@@ -232,31 +232,27 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
var mImage = sender.Image;
|
||||
|
||||
var nForm = new Form
|
||||
{
|
||||
StartPosition = FormStartPosition.CenterParent,
|
||||
ShowInTaskbar = false,
|
||||
ShowIcon = false,
|
||||
MaximizeBox = false,
|
||||
MinimizeBox = false,
|
||||
Width = mImage.Width + 2,
|
||||
Height = mImage.Height + 2,
|
||||
FormBorderStyle = FormBorderStyle.None
|
||||
};
|
||||
|
||||
var nPB = new PictureBox
|
||||
{
|
||||
Parent = nForm,
|
||||
BorderStyle = BorderStyle.FixedSingle,
|
||||
Location = new Point(0, 0),
|
||||
SizeMode = PictureBoxSizeMode.AutoSize,
|
||||
Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top,
|
||||
Image = mImage,
|
||||
ContextMenuStrip = cMenScreenshot
|
||||
};
|
||||
nPB.Show();
|
||||
Image mImage = sender.Image;
|
||||
|
||||
Form nForm = new Form();
|
||||
nForm.StartPosition = FormStartPosition.CenterParent;
|
||||
nForm.ShowInTaskbar = false;
|
||||
nForm.ShowIcon = false;
|
||||
nForm.MaximizeBox = false;
|
||||
nForm.MinimizeBox = false;
|
||||
nForm.Width = mImage.Width + 2;
|
||||
nForm.Height = mImage.Height + 2;
|
||||
nForm.FormBorderStyle = FormBorderStyle.None;
|
||||
|
||||
PictureBox nPB = new PictureBox();
|
||||
nPB.Parent = nForm;
|
||||
nPB.BorderStyle = BorderStyle.FixedSingle;
|
||||
nPB.Location = new Point(0, 0);
|
||||
nPB.SizeMode = PictureBoxSizeMode.AutoSize;
|
||||
nPB.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top;
|
||||
nPB.Image = mImage;
|
||||
nPB.ContextMenuStrip = cMenScreenshot;
|
||||
nPB.Show();
|
||||
|
||||
nPB.MouseDown += pbScreenshotOpen_MouseDown;
|
||||
|
||||
@@ -299,26 +295,30 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
var pCount = 1;
|
||||
|
||||
if (dlgSaveAllImages.ShowDialog() != DialogResult.OK) return;
|
||||
foreach (var fPath in Directory.GetFiles(dlgSaveAllImages.SelectedPath, "Screenshot_*", SearchOption.TopDirectoryOnly))
|
||||
{
|
||||
var f = new FileInfo(fPath);
|
||||
int pCount = 1;
|
||||
|
||||
if (dlgSaveAllImages.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
foreach (string fPath in Directory.GetFiles(dlgSaveAllImages.SelectedPath, "Screenshot_*", SearchOption.TopDirectoryOnly))
|
||||
{
|
||||
FileInfo f = new FileInfo(fPath);
|
||||
|
||||
var fCount = f.Name;
|
||||
fCount = fCount.Replace(f.Extension, "");
|
||||
fCount = fCount.Replace("Screenshot_", "");
|
||||
string fCount = f.Name;
|
||||
fCount = fCount.Replace(f.Extension, "");
|
||||
fCount = fCount.Replace("Screenshot_", "");
|
||||
|
||||
pCount = (int) (double.Parse(fCount) + 1);
|
||||
}
|
||||
pCount = (int) (double.Parse(fCount) + 1);
|
||||
}
|
||||
|
||||
foreach (Control ctrl in flpScreenshots.Controls)
|
||||
{
|
||||
if (!(ctrl is PictureBox)) continue;
|
||||
(ctrl as PictureBox).Image.Save(dlgSaveAllImages.SelectedPath + "\\Screenshot_" + Tools.MiscTools.LeadingZero(Convert.ToString(pCount)) +".png", System.Drawing.Imaging.ImageFormat.Png);
|
||||
pCount++;
|
||||
}
|
||||
foreach (Control ctrl in flpScreenshots.Controls)
|
||||
{
|
||||
if (ctrl is PictureBox)
|
||||
{
|
||||
(ctrl as PictureBox).Image.Save(dlgSaveAllImages.SelectedPath + "\\Screenshot_" + Tools.MiscTools.LeadingZero(Convert.ToString(pCount)) +".png", System.Drawing.Imaging.ImageFormat.Png);
|
||||
pCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -352,23 +352,24 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
try
|
||||
{
|
||||
if (dlgSaveSingleImage.ShowDialog() != DialogResult.OK) return;
|
||||
// ReSharper disable once SwitchStatementMissingSomeCases
|
||||
switch (dlgSaveSingleImage.FileName.Substring(dlgSaveSingleImage.FileName.LastIndexOf(".", StringComparison.Ordinal) + 1).ToLower())
|
||||
{
|
||||
case "gif":
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Gif);
|
||||
break;
|
||||
case "jpeg":
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
break;
|
||||
case "jpg":
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
break;
|
||||
case "png":
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Png);
|
||||
break;
|
||||
}
|
||||
if (dlgSaveSingleImage.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
switch (dlgSaveSingleImage.FileName.Substring(dlgSaveSingleImage.FileName.LastIndexOf(".", StringComparison.Ordinal) + 1).ToLower())
|
||||
{
|
||||
case "gif":
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Gif);
|
||||
break;
|
||||
case "jpeg":
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
break;
|
||||
case "jpg":
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
break;
|
||||
case "png":
|
||||
((PictureBox) cMenScreenshot.Tag).Image.Save(dlgSaveSingleImage.FileName, System.Drawing.Imaging.ImageFormat.Png);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user