Browse Source

Turned off overflow checks,Component Inspector error dialog now sends the user to the SharpDevelop bug reporting forum, and removed unused files.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1416 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 19 years ago
parent
commit
04212c8420
  1. 2
      src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/ComponentInspector.Core.csproj
  2. 43
      src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/Src/Controls/ErrorDialog.cs
  3. 62
      src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/HookJunk.cs.save
  4. 187
      src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/TestDriver.cs.nobuild
  5. 11
      src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/Version.template

2
src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/ComponentInspector.Core.csproj

@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>

43
src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/Src/Controls/ErrorDialog.cs

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
// <version>$Revision$</version>
// </file>
using ICSharpCode.Core;
using System;
using System.Collections;
using System.ComponentModel;
@ -275,28 +276,12 @@ namespace NoGoop.Controls @@ -275,28 +276,12 @@ namespace NoGoop.Controls
SetText();
}
protected const int MAX_URI_TEXT_SIZE = 1500;
protected void BugClickedHandler(object sender, EventArgs e)
{
try {
String body = "Please enter what you were doing or any other descriptive information here: \n\n\n"
+ _title + "\n\n";
if (_exception != null)
body += _exception;
else
body += _summary;
String uriText = "mailto:support@oaklandsoftware.com?"
+ "subject=BR - "
/*+ ObjectBrowser.License.ProductName */
+ " - " + ObjectBrowser.CODEBASE_VERSION
+ "&body=" + body;
// Make sure its not too big for the email client
if (uriText.Length > MAX_URI_TEXT_SIZE)
uriText = uriText.Substring(0, MAX_URI_TEXT_SIZE);
CopyInfoToClipboard();
string uriText = "http://www.icsharpcode.net/OpenSource/SD/BugReporting.aspx";
Uri uri = new Uri(uriText);
// Send using local email client so the user
// has control over the content
Utils.InvokeBrowser(uri, !Utils.SHOW_WINDOW);
} catch (Exception ex) {
TraceUtil.WriteLineWarning(this, "Error sending bug report: " + ex);
@ -307,5 +292,27 @@ namespace NoGoop.Controls @@ -307,5 +292,27 @@ namespace NoGoop.Controls
{
Utils.InvokeBrowser(e.LinkText);
}
void CopyInfoToClipboard()
{
ClipboardWrapper.SetText(GetClipboardString());
}
string GetClipboardString()
{
string str = String.Empty;
str += ".NET Version : " + Environment.Version.ToString() + Environment.NewLine;
str += "OS Version : " + Environment.OSVersion.ToString() + Environment.NewLine;
System.Version v = Assembly.GetEntryAssembly().GetName().Version;
str += "Component Inspector Version : " + v.Major + "." + v.Minor + "." + v.Build + "." + v.Revision + Environment.NewLine;
str += Environment.NewLine;
if (_exception != null) {
str += _exception + Environment.NewLine;
} else {
str += _summary + Environment.NewLine;
}
return str;
}
}
}

62
src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/HookJunk.cs.save

@ -1,62 +0,0 @@ @@ -1,62 +0,0 @@
// Button for adding a hook to the selected form
Button b1 = new Button();
b1.Location = new Point(400, 200);
b1.Text = "Add Hook";
b1.Click += new System.EventHandler(this.AddHookButton_Click);
this.Controls.Add(b1);
// CallWndProc callback = new CallWndProc(HookProc);
// GetMsgProc callback = new GetMsgProc(HookProc);
MessageProc callback = new MessageProc(HookProc);
int modHandle = Windows.GetModuleHandle(null);
DebugMessage("Module handle: " + modHandle);
// int ret = Windows.SetWindowsHookEx(Windows.WH_CALLWNDPROC, callback,
// int ret = Windows.SetWindowsHookEx(Windows.WH_GETMESSAGE, callback,
int ret = Windows.SetWindowsHookEx(Windows.WH_MSGFILTER, callback,
modHandle, 0);
if (ret == 0)
DebugMessage("Error adding hook: " + Windows.GetLastErrorText());
else
DebugMessage("Added hook " + ret);
}
// public int HookProc(int nCode, int wParam, Windows.CWPSTRUCT lParam)
public int HookProc(int nCode, int wParam, int lParam)
{
// for (int i = 0; i < HookedWindows.Count; i++)
{
// if ((int)HookedWindows[i] == lParam.hWnd)
{
//HookedMessages.Enqueue(lParam);
// DebugMessage("Hook Called: hWnd: " + lParam.hWnd
DebugMessage("Hook Called: hWnd: "
+ " code: " + nCode
+ " wParam: " + wParam
+ " lParam: " + lParam);
}
}
if (nCode < 0)
return Windows.CallNextHookEx(0, nCode, wParam, lParam);
return 0;
}
protected void AddHookButton_Click (object sender, System.EventArgs e)
{
MainTreeNode node = (MainTreeNode)this.MainTree.SelectedNode;
DebugMessage("add hook " + node);
HookedMessages = new Queue();
if (node.WindowInfo != null)
{
HookedWindows.Add(node.WindowInfo.hWnd);
}
}

187
src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/TestDriver.cs.nobuild

@ -1,187 +0,0 @@ @@ -1,187 +0,0 @@
using System;
using System.Collections;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using NoGoop.win32;
using Access;
namespace NoGoop.objb
{
public class FormInfo
{
public Access.Form Form;
public int WindowHandle;
public string WindowName;
public override String ToString()
{
return Form.Name + " win: 0x"
+ WindowHandle.ToString("X") + ":" + WindowName;
}
}
public class TestDriver
{
private Access.Application AccessApp;
private static ArrayList WindowList;
// For locking at the class level
private static Object Lock;
static TestDriver()
{
Lock = new Object();
}
public TestDriver()
{
}
public IList GetForms()
{
ArrayList forms = new ArrayList();
IEnumerator en = AccessApp.Forms.GetEnumerator();
while (en.MoveNext())
{
forms.Add(System.Runtime.InteropServices.Marshal.
CreateWrapperOfType(en.Current, typeof(Access.Form)));
// forms.Add(en.Current);
}
return forms;
}
public IList GetFormInfoList()
{
ArrayList forms = new ArrayList();
IEnumerator en = GetForms().GetEnumerator();
while (en.MoveNext())
{
FormInfo fi = new FormInfo();
fi.Form = (Access.Form)en.Current;
fi.WindowHandle = fi.Form.Hwnd;
fi.WindowName = Windows.GetWindowText(fi.WindowHandle);
forms.Add(fi);
}
return forms;
}
public int GetTopWindow()
{
return AccessApp.hWndAccessApp();
}
public Object GetTopObject()
{
return AccessApp;
}
public IList GetChildWindows()
{
return GetChildWindows(GetTopWindow());
}
public IList GetChildWindows(int hWnd)
{
ArrayList winList = new ArrayList();
GetChildWindows(hWnd, winList);
return winList;
}
public void GetChildWindows(int hWnd, ArrayList winList)
{
ArrayList SaveList = WindowList;
// Since WindowList is an class variable, required because
// its updated with a callback
lock (Lock)
{
WindowList = winList;
EnumChildProc callback = new EnumChildProc(TestDriver.ChildWindow);
Windows.EnumChildWindows(hWnd, callback, 0);
WindowList.Sort(null);
// Now get all of the children
foreach (Windows.WindowInfo wi in winList)
{
wi.Children = new ArrayList();
GetChildWindows(wi.hWnd, wi.Children);
}
WindowList = SaveList;
}
}
// This is the callback function, called by windows for each child
private static bool ChildWindow(int hwnd, int lParam)
{
WindowList.Add(Windows.GetWindowInfo(hwnd));
return true;
}
public bool CheckIfRunning()
{
try
{
// This is the same as a VB GetObject, more or less
/***
Object o =
System.Runtime.InteropServices.Marshal.GetActiveObject("Access.Application.9");
AccessApp = (Access.Application)
System.Runtime.InteropServices.Marshal.
CreateWrapperOfType(o, typeof(Access.Application));
Console.WriteLine("Found current access: " + AccessApp);
****/
return true;
}
catch (Exception)
{
Console.WriteLine("No current access running");
AccessApp = null;
return false;
}
}
public void CreateNewAccess(string fileName)
{
AccessApp = new Access.Application();
AccessApp.OpenCurrentDatabase(fileName, false);
AccessApp.Visible = true;
AccessApp.DoCmd.OpenForm("People",
Access.AcFormView.acNormal,
null,
null,
Access.AcFormOpenDataMode.acFormEdit,
Access.AcWindowMode.acWindowNormal, "");
}
[STAThread]
public static void Main(string[] args)
{
TestDriver td = new TestDriver();
td.CheckIfRunning();
}
}
}

11
src/AddIns/Misc/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/Version.template

@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
using System;
namespace NoGoop.ObjBrowser
{
internal class Version
{
internal const String VERSION =
"@CompInspVersion@";
}
}
Loading…
Cancel
Save