code clean up

Fix - CA2214: Do not call overridable methods in constructors

Relates to #249
This commit is contained in:
Sean Kaim
2017-03-13 17:11:21 -04:00
parent 9b27200793
commit 282ddb85c7
3 changed files with 10 additions and 65 deletions

View File

@@ -5,15 +5,9 @@ namespace mRemoteNG.Connection.Protocol.Http
public ProtocolHTTP(RenderingEngine RenderingEngine) : base(RenderingEngine)
{
}
public override void NewExtended()
{
base.NewExtended();
httpOrS = "http";
defaultPort = (int)Defaults.Port;
}
httpOrS = "http";
defaultPort = (int)Defaults.Port;
}
public enum Defaults
{

View File

@@ -13,13 +13,14 @@ namespace mRemoteNG.Connection.Protocol.Http
{
#region Private Properties
private Control wBrowser;
public string httpOrS;
public int defaultPort;
protected string httpOrS;
protected int defaultPort;
private string tabTitle;
#endregion
#region Public Methods
public HTTPBase(RenderingEngine RenderingEngine)
protected HTTPBase(RenderingEngine RenderingEngine)
{
try
{
@@ -34,18 +35,12 @@ namespace mRemoteNG.Connection.Protocol.Http
{
Control = new WebBrowser();
}
NewExtended();
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionStackTrace(Language.strHttpConnectionFailed, ex);
}
}
public virtual void NewExtended()
{
}
public override bool Initialize()
{
@@ -178,24 +173,6 @@ namespace mRemoteNG.Connection.Protocol.Http
objWebBrowser.Navigated -= wBrowser_Navigated;
}
#if false
private void wBrowser_NewWindow3(ref object ppDisp, ref bool Cancel, uint dwFlags, string bstrUrlContext, string bstrUrl)
{
if ((dwFlags & (long)NWMF.NWMF_OVERRIDEKEY) > 0)
{
Cancel = false;
}
else
{
Cancel = true;
}
}
private void wBrowser_LastTabRemoved(object sender)
{
Close();
}
#endif
private void wBrowser_DocumentTitleChanged(object sender, EventArgs e)
{
try
@@ -301,27 +278,6 @@ namespace mRemoteNG.Connection.Protocol.Http
Gecko = 2
}
#if false
private enum NWMF
{
// ReSharper disable InconsistentNaming
NWMF_UNLOADING = 0x1,
NWMF_USERINITED = 0x2,
NWMF_FIRST = 0x4,
NWMF_OVERRIDEKEY = 0x8,
NWMF_SHOWHELP = 0x10,
NWMF_HTMLDIALOG = 0x20,
NWMF_FROMDIALOGCHILD = 0x40,
NWMF_USERREQUESTED = 0x80,
NWMF_USERALLOWED = 0x100,
NWMF_FORCEWINDOW = 0x10000,
NWMF_FORCETAB = 0x20000,
NWMF_SUGGESTWINDOW = 0x40000,
NWMF_SUGGESTTAB = 0x80000,
NWMF_INACTIVETAB = 0x100000
// ReSharper restore InconsistentNaming
}
#endif
#endregion
}
}

View File

@@ -5,14 +5,9 @@ namespace mRemoteNG.Connection.Protocol.Http
public ProtocolHTTPS(RenderingEngine RenderingEngine) : base(RenderingEngine)
{
}
public override void NewExtended()
{
base.NewExtended();
httpOrS = "https";
defaultPort = (int)Defaults.Port;
}
httpOrS = "https";
defaultPort = (int)Defaults.Port;
}
public enum Defaults
{