|
|
@ -12,6 +12,7 @@ using System.IO; |
|
|
|
using System.Windows.Forms; |
|
|
|
using System.Windows.Forms; |
|
|
|
|
|
|
|
|
|
|
|
using ICSharpCode.Core; |
|
|
|
using ICSharpCode.Core; |
|
|
|
|
|
|
|
using NoGoop.Controls; |
|
|
|
using NoGoop.Obj; |
|
|
|
using NoGoop.Obj; |
|
|
|
using NoGoop.ObjBrowser.GuiDesigner; |
|
|
|
using NoGoop.ObjBrowser.GuiDesigner; |
|
|
|
using NoGoop.ObjBrowser.Panels; |
|
|
|
using NoGoop.ObjBrowser.Panels; |
|
|
@ -185,27 +186,32 @@ namespace NoGoop.ObjBrowser |
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Tries to open the specified file into the object browser.
|
|
|
|
/// Tries to open the specified file into the object browser.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public void OpenFile(string fileName) |
|
|
|
public bool OpenFile(string fileName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Exception savedException = null; |
|
|
|
Exception savedException = null; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
AssemblySupport.OpenFile(fileName); |
|
|
|
AssemblySupport.OpenFile(fileName); |
|
|
|
return; |
|
|
|
return true; |
|
|
|
} catch (Exception ex) { |
|
|
|
} catch (Exception ex) { |
|
|
|
savedException = ex; |
|
|
|
savedException = ex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
ComSupport.OpenFile(fileName); |
|
|
|
ComSupport.OpenFile(fileName); |
|
|
|
return; |
|
|
|
return true; |
|
|
|
} catch (Exception ex) { |
|
|
|
} catch (Exception ex) { |
|
|
|
if (savedException == null) |
|
|
|
if (savedException == null) |
|
|
|
savedException = ex; |
|
|
|
savedException = ex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TraceUtil.WriteLineWarning(null, String.Concat("Error opening file ", fileName, ": " + savedException)); |
|
|
|
TraceUtil.WriteLineWarning(null, String.Concat("Error opening file ", fileName, ": " + savedException)); |
|
|
|
throw savedException; |
|
|
|
ErrorDialog.Show(savedException, |
|
|
|
|
|
|
|
"Error opening file " + fileName + "\n\n" + |
|
|
|
|
|
|
|
"The Inspector can only open .NET assemblies, ActiveX controls or ActiveX type libraries.", |
|
|
|
|
|
|
|
"Error opening file " + fileName, |
|
|
|
|
|
|
|
MessageBoxIcon.Error); |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void CloseSelectedFile() |
|
|
|
public void CloseSelectedFile() |
|
|
|