Browse Source

Use LoggingService instead of Console.WriteLine.

Fixed a little bug in attribute completion.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@343 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
040a8b7582
  1. 4
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/CodeDOMGenerator.cs
  2. 2
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/XmlDesignerGenerator.cs
  3. 3
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerLoader/NRefactoryDesignerLoader.cs
  4. 1
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerLoader/XmlDesignerLoader.cs
  5. 4
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormDesignerViewContent.cs
  6. 2
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormKeyHandler.cs
  7. 4
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Gui/ComponentLibraryLoader.cs
  8. 8
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Gui/CustomComponentsSideTab.cs
  9. 4
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Gui/SideTabDesigner.cs
  10. 6
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/DefaultServiceContainer.cs
  11. 27
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/ToolboxService.cs
  12. 2
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/TypeResolutionService.cs
  13. 2
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/ToolboxProvider.cs
  14. 3
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/CodeCompletionWindow.cs
  15. 8
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlSchemaManager.cs
  16. 6
      src/AddIns/Misc/NUnitPad/Project/Src/Gui/NUnitPadContent.cs
  17. 15
      src/AddIns/Misc/NUnitPad/Project/Src/Gui/TestTreeView.cs
  18. 13
      src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs
  19. 10
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewDisplayBinding.cs
  20. 3
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs
  21. 6
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/OverlayIconManager.cs
  22. 1
      src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClient.cs
  23. 2
      src/Libraries/ICSharpCode.TextEditor/Project/ICSharpCode.TextEditor.csproj
  24. 1
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/LineManager/DefaultLineManager.cs
  25. 60
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Caret.cs
  26. 2
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs
  27. 28
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs
  28. 16
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaClipboardHandler.cs
  29. 3
      src/Libraries/NRefactory/Project/Src/Output/SpecialNodesInserter.cs
  30. 2
      src/Main/Base/Project/Src/Dom/ExpressionContext.cs
  31. 2
      src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryASTConvertVisitor.cs
  32. 7
      src/Main/Base/Project/Src/Dom/ResolveResult.cs
  33. 14
      src/Main/Base/Project/Src/Dom/XmlDoc.cs
  34. 2
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
  35. 2
      src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs
  36. 2
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/SolutionFolderNode.cs
  37. 3
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/Util/ProjectBrowserTreeNodeVisitor.cs
  38. 4
      src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs
  39. 2
      src/Main/Base/Project/Src/Internal/Templates/CodeTemplateLoader.cs
  40. 4
      src/Main/Base/Project/Src/Project/MSBuildEngine.cs
  41. 1
      src/Main/Base/Project/Src/Project/MSBuildProject.cs
  42. 2
      src/Main/Base/Project/Src/Project/Solution/Solution.cs
  43. 8
      src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs
  44. 33
      src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs
  45. 4
      src/Main/Base/Project/Src/Services/ProjectService/ParseableFileContentEnumerator.cs
  46. 4
      src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/CodeGenerator.cs
  47. 3
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs
  48. 6
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionDataProvider.cs
  49. 10
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionDataUsageCache.cs
  50. 13
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/InsightWindow/MethodInsightDataProvider.cs
  51. 2
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/QuickClassBrowserPanel.cs
  52. 2
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs
  53. 8
      src/Main/Core/Project/ICSharpCode.Core.csproj
  54. 2
      src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs
  55. 4
      src/Main/Core/Project/Src/AddInTree/AddIn/Codon.cs
  56. 4
      src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs
  57. 4
      src/Main/Core/Project/Src/AddInTree/AddInTreeNode.cs
  58. 120
      src/Main/Core/Project/Src/Services/LoggingService/LoggingService.cs
  59. 23
      src/Main/Core/Project/Src/Services/MessageService/MessageService.cs
  60. 35
      src/Main/StartUp/Project/SharpDevelop.exe.config
  61. 125
      src/Main/StartUp/Project/SharpDevelopMain.cs

4
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/CodeDOMGenerator.cs

@ -47,6 +47,7 @@ namespace ICSharpCode.FormDesigner @@ -47,6 +47,7 @@ namespace ICSharpCode.FormDesigner
public void ConvertContentDefinition(TextWriter writer)
{
LoggingService.Info("Start CodeCOMGenerator.ConvertContentDefinition");
DesignerSerializationManager serializationManager = (DesignerSerializationManager)host.GetService(typeof(IDesignerSerializationManager));
IDisposable session = serializationManager.CreateSession();
DesignerResourceService designerResourceService = (DesignerResourceService)host.GetService(typeof(System.ComponentModel.Design.IResourceService));
@ -67,7 +68,6 @@ namespace ICSharpCode.FormDesigner @@ -67,7 +68,6 @@ namespace ICSharpCode.FormDesigner
options.IndentString = "\t\t\t";
// ICSharpCode.NRefactory.Parser.CodeDOMVerboseOutputGenerator outputGenerator = new ICSharpCode.NRefactory.Parser.CodeDOMVerboseOutputGenerator();
// Console.WriteLine("<<<<START.");
foreach (CodeStatement statement in statements) {
if (!(statement is CodeVariableDeclarationStatement)) {
@ -86,7 +86,7 @@ namespace ICSharpCode.FormDesigner @@ -86,7 +86,7 @@ namespace ICSharpCode.FormDesigner
}
designerResourceService.SerializationEnded(true);
session.Dispose();
// Console.WriteLine("<<<<END.");
LoggingService.Info("End CodeCOMGenerator.ConvertContentDefinition");
}
}
}

2
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerGenerator/XmlDesignerGenerator.cs

@ -126,7 +126,7 @@ namespace ICSharpCode.FormDesigner @@ -126,7 +126,7 @@ namespace ICSharpCode.FormDesigner
try {
propertyValue = pd.GetValue(o);
} catch (Exception e) {
Console.WriteLine(e);
ICSharpCode.Core.LoggingService.Warn(e);
continue;
}

3
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerLoader/NRefactoryDesignerLoader.cs

@ -78,7 +78,6 @@ namespace ICSharpCode.FormDesigner @@ -78,7 +78,6 @@ namespace ICSharpCode.FormDesigner
protected override ITypeResolutionService TypeResolutionService {
get {
Console.WriteLine("type resolution service");
return typeResolutionService;
}
}
@ -109,7 +108,7 @@ namespace ICSharpCode.FormDesigner @@ -109,7 +108,7 @@ namespace ICSharpCode.FormDesigner
protected override CodeCompileUnit Parse()
{
Console.Write("ParseCompileUnit");
LoggingService.Debug("NRefactoryDesignerLoader.Parse()");
isReloadNeeded = false;
ICSharpCode.NRefactory.Parser.IParser p = ICSharpCode.NRefactory.Parser.ParserFactory.CreateParser(language, new StringReader(TextContent));
p.Parse();

1
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/DesignerLoader/XmlDesignerLoader.cs

@ -79,7 +79,6 @@ namespace ICSharpCode.FormDesigner @@ -79,7 +79,6 @@ namespace ICSharpCode.FormDesigner
object IObjectCreator.CreateObject(string name, XmlElement el)
{
Console.WriteLine("Name:" + name);
string componentName = null;
if (el != null) {

4
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormDesignerViewContent.cs

@ -133,6 +133,8 @@ namespace ICSharpCode.FormDesigner @@ -133,6 +133,8 @@ namespace ICSharpCode.FormDesigner
{
if (isInitialized) return;
isInitialized = true;
LoggingService.Info("Form Designer: BEGIN INITIALIZE");
DefaultServiceContainer serviceContainer = new DefaultServiceContainer();
serviceContainer.AddService(typeof(System.Windows.Forms.Design.IUIService), new UIService());
serviceContainer.AddService(typeof(System.Drawing.Design.IToolboxService), ToolboxProvider.ToolboxService);
@ -166,7 +168,7 @@ namespace ICSharpCode.FormDesigner @@ -166,7 +168,7 @@ namespace ICSharpCode.FormDesigner
designSurface.Flush();
generator.Attach(this);
Console.WriteLine("!!!!!! END LOAD");
LoggingService.Info("Form Designer: END INITIALIZE");
}
PropertyContainer propertyContainer = new PropertyContainer();

2
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/FormKeyHandler.cs

@ -118,7 +118,7 @@ namespace ICSharpCode.FormDesigner @@ -118,7 +118,7 @@ namespace ICSharpCode.FormDesigner
// formDesigner.SetNextTabIndex(c.PointToScreen(p));
// }
// } catch (Exception e) {
// Console.WriteLine(e);
// MessageService.ShowError(e);
// }
// }
// return false;

4
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Gui/ComponentLibraryLoader.cs

@ -274,7 +274,7 @@ namespace ICSharpCode.FormDesigner.Gui @@ -274,7 +274,7 @@ namespace ICSharpCode.FormDesigner.Gui
}
}
} catch (Exception e) {
Console.WriteLine(e);
ICSharpCode.Core.LoggingService.Warn("ComponentLibraryLoader.LoadToolComponentLibrary: " + e.Message);
return false;
}
return true;
@ -304,7 +304,7 @@ namespace ICSharpCode.FormDesigner.Gui @@ -304,7 +304,7 @@ namespace ICSharpCode.FormDesigner.Gui
b.MakeTransparent();
}
} catch (Exception e) {
Console.WriteLine(e);
ICSharpCode.Core.LoggingService.Warn("ComponentLibraryLoader.GetIcon: " + e.Message);
}
}

8
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Gui/CustomComponentsSideTab.cs

@ -67,6 +67,7 @@ namespace ICSharpCode.FormDesigner.Gui @@ -67,6 +67,7 @@ namespace ICSharpCode.FormDesigner.Gui
Assembly MyResolveEventHandler(object sender, ResolveEventArgs args)
{
LoggingService.Debug("Form Designer: MyResolve: " + args.Name);
string file = args.Name;
int idx = file.IndexOf(',');
if (idx >= 0) {
@ -74,13 +75,16 @@ namespace ICSharpCode.FormDesigner.Gui @@ -74,13 +75,16 @@ namespace ICSharpCode.FormDesigner.Gui
}
try {
if (File.Exists(loadingPath + file + ".exe")) {
LoggingService.Debug("Form Designer: MyResolve: Load bytes from exe");
return Assembly.Load(GetBytes(loadingPath + file + ".exe"));
}
if (File.Exists(loadingPath + file + ".dll")) {
LoggingService.Debug("Form Designer: MyResolve: Load bytes from dll");
return Assembly.Load(GetBytes(loadingPath + file + ".dll"));
}
LoggingService.Info("Form Designer: MyResolve: did not find " + args.Name);
} catch (Exception ex) {
Console.WriteLine("Can't load assembly : " + ex.ToString());
LoggingService.Warn("Form Designer: MyResolve: Can't load assembly", ex);
}
return null;
}
@ -173,7 +177,7 @@ namespace ICSharpCode.FormDesigner.Gui @@ -173,7 +177,7 @@ namespace ICSharpCode.FormDesigner.Gui
}
}
} catch (Exception e) {
Console.WriteLine("Exception : " + e);
LoggingService.Warn("Form Designer: ScanProjectAssemblies", e);
} finally {
AppDomain.CurrentDomain.AssemblyResolve -= new ResolveEventHandler(MyResolveEventHandler);
}

4
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Gui/SideTabDesigner.cs

@ -136,7 +136,7 @@ namespace ICSharpCode.FormDesigner.Gui @@ -136,7 +136,7 @@ namespace ICSharpCode.FormDesigner.Gui
stream.Close();
}
} catch (Exception e) {
Console.WriteLine(e);
LoggingService.Warn("Form Designer: GetToolboxItemsFromAssembly", e);
}
}
Module[] ms = assembly.GetModules(false);
@ -176,7 +176,7 @@ namespace ICSharpCode.FormDesigner.Gui @@ -176,7 +176,7 @@ namespace ICSharpCode.FormDesigner.Gui
try {
item.Bitmap = (Bitmap)images[imageName];
} catch (Exception ex) {
Console.WriteLine("Exception converting bitmap : " + images[imageName] + " : " + ex.ToString());
MessageService.ShowError(ex, "Exception converting bitmap : " + images[imageName] + " : ");
}
}
toolBoxItems.Add(item);

6
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/DefaultServiceContainer.cs

@ -13,6 +13,7 @@ using System.Drawing; @@ -13,6 +13,7 @@ using System.Drawing;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms.Design;
using ICSharpCode.Core;
namespace ICSharpCode.FormDesigner.Services
{
@ -99,10 +100,9 @@ namespace ICSharpCode.FormDesigner.Services @@ -99,10 +100,9 @@ namespace ICSharpCode.FormDesigner.Services
public object GetService(System.Type serviceType)
{
if (IsServiceMissing(serviceType)) {
Console.WriteLine("request missing service : {0} from Assembly {1} is not aviable.", serviceType, serviceType.Assembly.FullName);
// Console.ReadLine();
LoggingService.InfoFormatted("request missing service : {0} from Assembly {1} is not aviable.", serviceType, serviceType.Assembly.FullName);
} else {
// Console.WriteLine("get service : {0} from Assembly {1}.", serviceType, serviceType.Assembly.FullName);
LoggingService.DebugFormatted("get service : {0} from Assembly {1}.", serviceType, serviceType.Assembly.FullName);
}
return serviceContainer.GetService(serviceType);
}

27
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/ToolboxService.cs

@ -11,6 +11,7 @@ using System.Collections; @@ -11,6 +11,7 @@ using System.Collections;
using System.Collections.Specialized;
using System.Drawing.Design;
using System.ComponentModel.Design;
using ICSharpCode.Core;
namespace ICSharpCode.FormDesigner.Services
{
@ -183,8 +184,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -183,8 +184,7 @@ namespace ICSharpCode.FormDesigner.Services
/// </remarks>
public void AddCreator(ToolboxItemCreatorCallback creator, string format, IDesignerHost host)
{
//System.Console.WriteLine("\tDefaultToolboxService:AddCreator({0}, {1}, {2})",
// creator, format, host);
LoggingService.DebugFormatted("\tDefaultToolboxService:AddCreator({0}, {1}, {2})", creator, format, host);
if (host == null) {
creators.Add(format, creator);
} else {
@ -250,7 +250,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -250,7 +250,7 @@ namespace ICSharpCode.FormDesigner.Services
public ToolboxItem DeserializeToolboxItem(object serializedObject)
{
// Console.WriteLine("DeserializeToolboxItem {0}", serializedObject);
LoggingService.DebugFormatted("DeserializeToolboxItem {0}", serializedObject);
if (serializedObject is System.Windows.Forms.IDataObject) {
if (((System.Windows.Forms.IDataObject)serializedObject).GetDataPresent(typeof(ToolboxItem))) {
return (ToolboxItem) ((System.Windows.Forms.IDataObject)serializedObject).GetData(typeof(ToolboxItem));
@ -261,7 +261,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -261,7 +261,7 @@ namespace ICSharpCode.FormDesigner.Services
public ToolboxItem DeserializeToolboxItem(object serializedObject, IDesignerHost host)
{
Console.WriteLine("DeserializeToolboxItem {0} host {1}", serializedObject, host);
LoggingService.DebugFormatted("DeserializeToolboxItem {0} host {1}", serializedObject, host);
if (serializedObject is System.Windows.Forms.IDataObject) {
if (((System.Windows.Forms.IDataObject)serializedObject).GetDataPresent(typeof(ToolboxItem))) {
ToolboxItem item = (ToolboxItem) ((System.Windows.Forms.IDataObject)serializedObject).GetData(typeof(ToolboxItem));
@ -269,30 +269,26 @@ namespace ICSharpCode.FormDesigner.Services @@ -269,30 +269,26 @@ namespace ICSharpCode.FormDesigner.Services
if (host != null) {
ArrayList list = (ArrayList)toolboxByHost[host];
if (list != null && list.Contains(item)) {
Console.WriteLine("Item1>" + item);
return item;
}
list = (ArrayList)toolboxByHost[ALL_HOSTS];
if (list != null && list.Contains(item)) {
Console.WriteLine("Item2>" + item + " type " + item.GetType());
return item;
}
}
}
}
Console.WriteLine("return null");
LoggingService.InfoFormatted("DeserializeToolboxItem {0} host {1} return null", serializedObject, host);
return null;
}
public ToolboxItem GetSelectedToolboxItem()
{
// Console.WriteLine("GetSelectedToolboxItem");
return selectedItem;
}
public ToolboxItem GetSelectedToolboxItem(IDesignerHost host)
{
// Console.WriteLine("GetSelectedToolboxItem host {0}", host);
IList list = (IList)toolboxByHost[host];
if (list != null && list.Contains(selectedItem)) {
return selectedItem;
@ -307,7 +303,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -307,7 +303,7 @@ namespace ICSharpCode.FormDesigner.Services
public ToolboxItemCollection GetToolboxItems()
{
// Console.WriteLine("GetToolboxItems");
LoggingService.Debug("ToolboxService: GetToolboxItems");
ToolboxItem[] items = new ToolboxItem[toolboxItems.Count];
toolboxItems.CopyTo(items);
return new ToolboxItemCollection(items);
@ -315,7 +311,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -315,7 +311,7 @@ namespace ICSharpCode.FormDesigner.Services
public ToolboxItemCollection GetToolboxItems(string category)
{
// Console.WriteLine("GetToolboxItems category {0}", category);
LoggingService.Debug("ToolboxService: GetToolboxItems category " + category);
if (category == null) {
category = ALL_CATEGORIES;
}
@ -329,7 +325,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -329,7 +325,7 @@ namespace ICSharpCode.FormDesigner.Services
public ToolboxItemCollection GetToolboxItems(string category, IDesignerHost host)
{
// Console.WriteLine("GetToolboxItems category {0} host {1}", category, host);
LoggingService.DebugFormatted("ToolboxService: GetToolboxItems category {0} host {1}", category, host);
if (category == null) {
category = ALL_CATEGORIES;
}
@ -374,19 +370,16 @@ namespace ICSharpCode.FormDesigner.Services @@ -374,19 +370,16 @@ namespace ICSharpCode.FormDesigner.Services
public bool IsSupported(object serializedObject, ICollection filterAttributes)
{
// Console.WriteLine("IsSupported serializedObiect {0} filterAttributes {1}", serializedObject, filterAttributes);
return true;
}
public bool IsSupported(object serializedObject, IDesignerHost host)
{
// Console.WriteLine("IsSupported serializedObiect {0} host {1}", serializedObject, host);
return true;
}
public bool IsToolboxItem(object serializedObject)
{
// Console.WriteLine("IsToolboxItem serializedObiect {0}", serializedObject);
if (serializedObject is System.Windows.Forms.IDataObject) {
if (((System.Windows.Forms.IDataObject)serializedObject).GetDataPresent(typeof(ToolboxItem))) {
return true;
@ -397,7 +390,6 @@ namespace ICSharpCode.FormDesigner.Services @@ -397,7 +390,6 @@ namespace ICSharpCode.FormDesigner.Services
public bool IsToolboxItem(object serializedObject, IDesignerHost host)
{
// Console.WriteLine("IsToolboxItem serializedObiect {0} host {1}", serializedObject, host);
// needed for Toolbox drag & drop
if (serializedObject is System.Windows.Forms.IDataObject) {
if (((System.Windows.Forms.IDataObject)serializedObject).GetDataPresent(typeof(ToolboxItem))) {
@ -450,13 +442,11 @@ namespace ICSharpCode.FormDesigner.Services @@ -450,13 +442,11 @@ namespace ICSharpCode.FormDesigner.Services
public void SelectedToolboxItemUsed()
{
// Console.WriteLine("SelectedToolboxItemUsed");
FireSelectedItemUsed();
}
public object SerializeToolboxItem(ToolboxItem toolboxItem)
{
// Console.WriteLine("SerializeToolboxItem");
return null;
}
@ -473,7 +463,6 @@ namespace ICSharpCode.FormDesigner.Services @@ -473,7 +463,6 @@ namespace ICSharpCode.FormDesigner.Services
public void SetSelectedToolboxItem(ToolboxItem toolboxItem)
{
// Console.WriteLine("SetSelectedToolboxItem toolboxItem {0}", toolboxItem);
if (toolboxItem != selectedItem) {
FireSelectedItemChanging();
selectedItem = toolboxItem;

2
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/TypeResolutionService.cs

@ -95,7 +95,7 @@ namespace ICSharpCode.FormDesigner.Services @@ -95,7 +95,7 @@ namespace ICSharpCode.FormDesigner.Services
public void ReferenceAssembly(AssemblyName name)
{
Console.WriteLine("TODO!!! : Add Assembly reference : " + name);
ICSharpCode.Core.LoggingService.Warn("TODO: Add Assembly reference : " + name);
}
}
}

2
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/ToolboxProvider.cs

@ -122,7 +122,7 @@ namespace ICSharpCode.FormDesigner @@ -122,7 +122,7 @@ namespace ICSharpCode.FormDesigner
SideTabDesigner newTab = new SideTabDesigner(SharpDevelopSideBar.SideBar, category, toolboxService);
SideTabs.Add(newTab);
} catch (Exception e) {
Console.WriteLine("Can't add tab : " + e);
ICSharpCode.Core.LoggingService.Warn("Can't add tab : " + e);
}
}
}

3
src/AddIns/DisplayBindings/XmlEditor/Project/Src/CodeCompletionWindow.cs

@ -114,7 +114,6 @@ namespace ICSharpCode.XmlEditor @@ -114,7 +114,6 @@ namespace ICSharpCode.XmlEditor
void SetDeclarationViewLocation()
{
Console.WriteLine("SET DECLARATION VIEW LOCATION.");
// This method uses the side with more free space
int leftSpace = Bounds.Left - workingScreen.Left;
int rightSpace = workingScreen.Right - Bounds.Right;
@ -162,7 +161,6 @@ namespace ICSharpCode.XmlEditor @@ -162,7 +161,6 @@ namespace ICSharpCode.XmlEditor
protected override void CaretOffsetChanged(object sender, EventArgs e)
{
int offset = control.ActiveTextAreaControl.Caret.Offset;
//Console.WriteLine("StartOffset {0} endOffset {1} - Offset {2}", startOffset, endOffset, offset);
if (offset < startOffset || offset > endOffset) {
Close();
} else {
@ -253,7 +251,6 @@ namespace ICSharpCode.XmlEditor @@ -253,7 +251,6 @@ namespace ICSharpCode.XmlEditor
control.BeginUpdate();
if (endOffset - startOffset > 0) {
//Console.WriteLine("start {0} length {1}", startOffset, endOffset - startOffset);
control.Document.Remove(startOffset, endOffset - startOffset);
control.ActiveTextAreaControl.Caret.Position = control.Document.OffsetToPosition(startOffset);
}

8
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlSchemaManager.cs

@ -112,7 +112,7 @@ namespace ICSharpCode.XmlEditor @@ -112,7 +112,7 @@ namespace ICSharpCode.XmlEditor
SchemaCompletionDataItems.Add(schemaData);
OnUserSchemaAdded();
} else {
Console.WriteLine(String.Concat("Trying to add a schema that already exists. Namespace=", schemaData.NamespaceUri));
LoggingService.Warn("Trying to add a schema that already exists. Namespace=" + schemaData.NamespaceUri);
}
}
@ -155,14 +155,14 @@ namespace ICSharpCode.XmlEditor @@ -155,14 +155,14 @@ namespace ICSharpCode.XmlEditor
schemas.Add(data);
} else {
// Namespace already exists.
Console.WriteLine(String.Concat("Ignoring duplicate schema namespace ", data.NamespaceUri));
LoggingService.Warn("Ignoring duplicate schema namespace " + data.NamespaceUri);
}
} else {
// Namespace is null.
Console.WriteLine(String.Concat("Ignoring schema with no namespace ", data.FileName));
LoggingService.Warn("Ignoring schema with no namespace " + data.FileName);
}
} catch (Exception ex) {
Console.WriteLine(String.Concat("Unable to read schema '", fileName, "'. ", ex.Message));
LoggingService.Warn("Unable to read schema '" + fileName + "'. ", ex);
}
}

6
src/AddIns/Misc/NUnitPad/Project/Src/Gui/NUnitPadContent.cs

@ -213,16 +213,14 @@ namespace ICSharpCode.NUnitPad @@ -213,16 +213,14 @@ namespace ICSharpCode.NUnitPad
}
if (referenceFound) {
string outputAssembly = project.OutputAssemblyFullPath;
LoggingService.Debug("NUnitPad: Load " + outputAssembly);
try {
TestDomain testDomain = new TestDomain();
// NUnitProject prj = NUnitProject.LoadProject(outputAssembly);
Test test = testDomain.Load(outputAssembly);
// TestSuiteBuilder builder = new TestSuiteBuilder();
// Console.WriteLine("Try to load '" + outputAssembly +"'");
// Test testDomain = builder.Build(outputAssembly);
testTreeView.PrintTests(outputAssembly, test, project);
} catch (Exception e) {
LoggingService.Warn("NUnitPad load error", e);
testTreeView.PrintTestErrors(outputAssembly, e);
}
}

15
src/AddIns/Misc/NUnitPad/Project/Src/Gui/TestTreeView.cs

@ -163,7 +163,6 @@ namespace ICSharpCode.NUnitPad @@ -163,7 +163,6 @@ namespace ICSharpCode.NUnitPad
public void PrintTests(string assembly, Test test, IProject project)
{
Console.WriteLine(assembly);
TreeNode assemblyNode = new TreeNode(Path.GetFileName(assembly));
assemblyNode.Tag = new TestItemTag(test, project);
treeView.Nodes.Add(assemblyNode);
@ -341,16 +340,9 @@ namespace ICSharpCode.NUnitPad @@ -341,16 +340,9 @@ namespace ICSharpCode.NUnitPad
testRunnerCategory.AppendText(outputMessage + Environment.NewLine);
testRunnerCategory.AppendText(result.Description + Environment.NewLine);
testRunnerCategory.AppendText(result.StackTrace + Environment.NewLine);
// if (result.StackTrace != null ) {
// Console.WriteLine("result.StackTrace=" + result.StackTrace);
// }
// else {
// Console.WriteLine("result.StackTrace=null");
// }
FileLineReference LineRef = OutputTextLineParser.GetNUnitOutputFileLineReference(result.StackTrace, true);
if (LineRef != null) {
// Console.WriteLine("Adding NUnit error task.");
Task Task = new Task(Path.GetFullPath(LineRef.FileName),
outputMessage,
LineRef.Column,
@ -370,17 +362,10 @@ namespace ICSharpCode.NUnitPad @@ -370,17 +362,10 @@ namespace ICSharpCode.NUnitPad
testRunnerCategory.AppendText(result.Message + Environment.NewLine);
testRunnerCategory.AppendText(result.Description + Environment.NewLine);
testRunnerCategory.AppendText(result.StackTrace + Environment.NewLine);
// if (result.StackTrace != null ) {
// Console.WriteLine("result.StackTrace=" + result.StackTrace);
// }
// else {
// Console.WriteLine("result.StackTrace=null");
// }
FileLineReference LineRef = OutputTextLineParser.GetNUnitOutputFileLineReference(result.StackTrace, true);
if (LineRef != null) {
// Console.WriteLine("Adding NUnit warning task.");
Task Task = new Task(Path.GetFullPath(LineRef.FileName),
outputMessage,
LineRef.Column,

13
src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs

@ -51,11 +51,19 @@ namespace ICSharpCode.Svn.Commands @@ -51,11 +51,19 @@ namespace ICSharpCode.Svn.Commands
node.AcceptVisitor(visitor, null);
}
bool CanBeVersionControlled(string fileName)
{
string svnDir = Path.Combine(Path.GetDirectoryName(fileName), ".svn");
return Directory.Exists(svnDir);
}
void FileSaved(object sender, FileNameEventArgs e)
{
ProjectBrowserPad pad = ProjectBrowserPad.Instance;
if (pad == null) return;
FileNode node = pad.ProjectBrowserControl.FindFileNode(e.FileName);
string fileName = e.FileName;
if (!CanBeVersionControlled(fileName)) return;
FileNode node = pad.ProjectBrowserControl.FindFileNode(fileName);
if (node == null) return;
OverlayIconManager.Enqueue(node);
}
@ -64,6 +72,7 @@ namespace ICSharpCode.Svn.Commands @@ -64,6 +72,7 @@ namespace ICSharpCode.Svn.Commands
{
try {
if (AddInOptions.AutomaticallyAddFiles) {
if (!CanBeVersionControlled(e.FileName)) return;
SvnClient.Instance.Client.Add(Path.GetFullPath(e.FileName), false);
}
} catch (Exception ex) {
@ -77,6 +86,7 @@ namespace ICSharpCode.Svn.Commands @@ -77,6 +86,7 @@ namespace ICSharpCode.Svn.Commands
if (e.IsDirectory) return;
if (!AddInOptions.AutomaticallyDeleteFiles) return;
string fullName = Path.GetFullPath(e.FileName);
if (!CanBeVersionControlled(fullName)) return;
try {
Status status = SvnClient.Instance.Client.SingleStatus(fullName);
switch (status.TextStatus) {
@ -114,6 +124,7 @@ namespace ICSharpCode.Svn.Commands @@ -114,6 +124,7 @@ namespace ICSharpCode.Svn.Commands
void FileRenaming(object sender, FileRenamingEventArgs e)
{
string fullSource = Path.GetFullPath(e.SourceFile);
if (!CanBeVersionControlled(fullSource)) return;
try {
Status status = SvnClient.Instance.Client.SingleStatus(fullSource);
switch (status.TextStatus) {

10
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewDisplayBinding.cs

@ -46,12 +46,20 @@ namespace ICSharpCode.Svn @@ -46,12 +46,20 @@ namespace ICSharpCode.Svn
return new ICSharpCode.SharpDevelop.Gui.ISecondaryViewContent[] { new HistoryView(viewContent) };
}
static Client client;
public bool CanAttachTo(ICSharpCode.SharpDevelop.Gui.IViewContent content)
{
if (content.IsUntitled || content.FileName == null || !File.Exists(content.FileName)) {
return false;
}
Client client = new Client();
string svnDir = Path.Combine(Path.GetDirectoryName(content.FileName), ".svn");
if (!Directory.Exists(svnDir))
return false;
if (client == null) {
LoggingService.Info("SVN: HistoryViewDisplayBinding initializes client");
client = new Client();
}
Status status = client.SingleStatus(Path.GetFullPath(content.FileName));
return status != null && status.Entry != null;
}

3
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs

@ -9,6 +9,7 @@ using System; @@ -9,6 +9,7 @@ using System;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
using NSvn.Common;
using NSvn.Core;
@ -74,7 +75,7 @@ namespace ICSharpCode.Svn @@ -74,7 +75,7 @@ namespace ICSharpCode.Svn
void GetLogMessages()
{
string fileName = Path.GetFullPath(viewContent.FileName);
Console.WriteLine("Get log of " + fileName);
LoggingService.Info("SVN: Get log of " + fileName);
if (File.Exists(fileName)) {
Client client = SvnClient.Instance.Client;
client.Log(new string[] { fileName},

6
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/OverlayIconManager.cs

@ -126,10 +126,14 @@ namespace ICSharpCode.Svn @@ -126,10 +126,14 @@ namespace ICSharpCode.Svn
static void Run()
{
LoggingService.Debug("SVN: OverlayIconManager Thread started");
while (true) {
AbstractProjectBrowserTreeNode node;
lock (queue) {
if (queue.Count == 0) return;
if (queue.Count == 0) {
LoggingService.Debug("SVN: OverlayIconManager Thread finished");
return;
}
node = queue.Dequeue();
}
try {

1
src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClient.cs

@ -221,6 +221,7 @@ namespace ICSharpCode.Svn @@ -221,6 +221,7 @@ namespace ICSharpCode.Svn
SvnClient()
{
LoggingService.Info("SVN: SvnClient initialized");
client = new Client();
client.LogMessage += new LogMessageDelegate(SetLogMessage);
client.Notification += new NotificationDelegate(ReceiveNotification);

2
src/Libraries/ICSharpCode.TextEditor/Project/ICSharpCode.TextEditor.csproj

@ -181,4 +181,4 @@ @@ -181,4 +181,4 @@
<Compile Include="Src\Document\TextBufferStrategy\PieceTableTextBufferStrategy.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project>
</Project>

1
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/LineManager/DefaultLineManager.cs

@ -170,7 +170,6 @@ namespace ICSharpCode.TextEditor.Document @@ -170,7 +170,6 @@ namespace ICSharpCode.TextEditor.Document
LineSegment line = (LineSegment)lineCollection[lineNumber];
if ((lineNumber == lineCollection.Count - 1) && removedLineEnds > 0) {
line.TotalLength -= length;
// Console.WriteLine("3:Line length of line {0} set to {1}", lineNumber, line.TotalLength - line.DelimiterLength);
line.DelimiterLength = 0;
} else {
++lineNumber;

60
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Caret.cs

@ -36,7 +36,7 @@ namespace ICSharpCode.TextEditor @@ -36,7 +36,7 @@ namespace ICSharpCode.TextEditor
InsertMode,
/// <summary>
/// If the caret is in overwirte mode typed characters will
/// If the caret is in overwirte mode typed characters will
/// overwrite the character at the caret position
/// </summary>
OverwriteMode
@ -212,7 +212,7 @@ namespace ICSharpCode.TextEditor @@ -212,7 +212,7 @@ namespace ICSharpCode.TextEditor
get {
int xpos = textArea.TextView.GetDrawingXPos(this.line, this.column);
return new Point(textArea.TextView.DrawingPosition.X + xpos,
textArea.TextView.DrawingPosition.Y + (textArea.Document.GetVisibleLine(this.line)) * textArea.TextView.FontHeight - textArea.TextView.TextArea.VirtualTop.Y);
textArea.TextView.DrawingPosition.Y + (textArea.Document.GetVisibleLine(this.line)) * textArea.TextView.FontHeight - textArea.TextView.TextArea.VirtualTop.Y);
}
}
int oldLine = -1;
@ -228,39 +228,34 @@ namespace ICSharpCode.TextEditor @@ -228,39 +228,34 @@ namespace ICSharpCode.TextEditor
if (hidden || textArea.MotherTextEditorControl.IsUpdating) {
return;
}
try {
if (!caretCreated) {
CreateCaret();
}
if (caretCreated) {
ValidateCaretPos();
int lineNr = this.line;
int xpos = textArea.TextView.GetDrawingXPos(lineNr, this.column);
//LineSegment lineSegment = textArea.Document.GetLineSegment(lineNr);
Point pos = ScreenPosition;
if (xpos >= 0) {
bool success = SetCaretPos(pos.X, pos.Y);
if (!success) {
DestroyCaret();
caretCreated = false;
UpdateCaretPosition();
}
}
// set the input method editor location
if (ime == null) {
ime = new Ime(textArea.Handle, textArea.Document.TextEditorProperties.Font);
} else {
ime.Font = textArea.Document.TextEditorProperties.Font;
if (!caretCreated) {
CreateCaret();
}
if (caretCreated) {
ValidateCaretPos();
int lineNr = this.line;
int xpos = textArea.TextView.GetDrawingXPos(lineNr, this.column);
//LineSegment lineSegment = textArea.Document.GetLineSegment(lineNr);
Point pos = ScreenPosition;
if (xpos >= 0) {
bool success = SetCaretPos(pos.X, pos.Y);
if (!success) {
DestroyCaret();
caretCreated = false;
UpdateCaretPosition();
}
ime.SetIMEWindowLocation(pos.X + 2,
pos.Y);
currentPos = pos;
}
} catch (Exception e) {
Console.WriteLine("Got exception while update caret position : " + e);
// set the input method editor location
if (ime == null) {
ime = new Ime(textArea.Handle, textArea.Document.TextEditorProperties.Font);
} else {
ime.Font = textArea.Document.TextEditorProperties.Font;
}
ime.SetIMEWindowLocation(pos.X + 2,
pos.Y);
currentPos = pos;
}
}
public void Dispose()
@ -291,7 +286,6 @@ namespace ICSharpCode.TextEditor @@ -291,7 +286,6 @@ namespace ICSharpCode.TextEditor
List<FoldMarker> foldings = textArea.Document.FoldingManager.GetFoldingsFromPosition(line, column);
bool shouldUpdate = false;
foreach (FoldMarker foldMarker in foldings) {
//Console.WriteLine(foldMarker);
shouldUpdate |= foldMarker.IsFolded;
foldMarker.IsFolded = false;
}

2
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs

@ -159,7 +159,6 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow @@ -159,7 +159,6 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
protected override void CaretOffsetChanged(object sender, EventArgs e)
{
int offset = control.ActiveTextAreaControl.Caret.Offset;
//Console.WriteLine("StartOffset {0} endOffset {1} - Offset {2}", startOffset, endOffset, offset);
if (offset < startOffset || offset > endOffset) {
Close();
} else {
@ -251,7 +250,6 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow @@ -251,7 +250,6 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
control.BeginUpdate();
if (endOffset - startOffset > 0) {
//Console.WriteLine("start {0} length {1}", startOffset, endOffset - startOffset);
control.Document.Remove(startOffset, endOffset - startOffset);
control.ActiveTextAreaControl.Caret.Position = control.Document.OffsetToPosition(startOffset);
}

28
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs

@ -375,11 +375,7 @@ namespace ICSharpCode.TextEditor @@ -375,11 +375,7 @@ namespace ICSharpCode.TextEditor
if (updateMargin != null) {
try {
updateMargin.Paint(g, updateMargin.DrawingPosition);
} catch (Exception ex) {
Console.WriteLine("Got exception : " + ex);
}
updateMargin.Paint(g, updateMargin.DrawingPosition);
// clipRectangle.Intersect(updateMargin.DrawingPosition);
}
@ -404,11 +400,7 @@ namespace ICSharpCode.TextEditor @@ -404,11 +400,7 @@ namespace ICSharpCode.TextEditor
if (clipRectangle.IntersectsWith(marginRectangle)) {
marginRectangle.Intersect(clipRectangle);
if (!marginRectangle.IsEmpty) {
try {
margin.Paint(g, marginRectangle);
} catch (Exception ex) {
Console.WriteLine("Got exception : " + ex);
}
margin.Paint(g, marginRectangle);
}
}
}
@ -422,23 +414,15 @@ namespace ICSharpCode.TextEditor @@ -422,23 +414,15 @@ namespace ICSharpCode.TextEditor
if (clipRectangle.IntersectsWith(textViewArea)) {
textViewArea.Intersect(clipRectangle);
if (!textViewArea.IsEmpty) {
try {
textView.Paint(g, textViewArea);
} catch (Exception ex) {
Console.WriteLine("Got exception : " + ex);
}
textView.Paint(g, textViewArea);
}
}
if (adjustScrollBars) {
try {
this.motherTextAreaControl.AdjustScrollBars(null, null);
} catch (Exception) {}
this.motherTextAreaControl.AdjustScrollBars(null, null);
}
try {
Caret.UpdateCaretPosition();
} catch (Exception) {}
Caret.UpdateCaretPosition();
base.OnPaint(e);
}
@ -537,8 +521,6 @@ namespace ICSharpCode.TextEditor @@ -537,8 +521,6 @@ namespace ICSharpCode.TextEditor
}
}
}
} catch (Exception e) {
Console.WriteLine("Got Exception while executing action " + action + " : " + e.ToString());
} finally {
motherTextEditorControl.EndUpdate();
Caret.UpdateCaretPosition();

16
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaClipboardHandler.cs

@ -44,14 +44,7 @@ namespace ICSharpCode.TextEditor @@ -44,14 +44,7 @@ namespace ICSharpCode.TextEditor
public bool EnablePaste {
get {
// Clipboard.GetDataObject may throw an exception...
try {
IDataObject data = Clipboard.GetDataObject();
return data != null && data.GetDataPresent(DataFormats.Text);
} catch (Exception e) {
Console.WriteLine("Got exception while enablepaste : " + e);
return false;
}
return Clipboard.ContainsText();
}
}
@ -96,8 +89,8 @@ namespace ICSharpCode.TextEditor @@ -96,8 +89,8 @@ namespace ICSharpCode.TextEditor
OnCopyText(new CopyTextEventArgs(str));
Clipboard.SetDataObject(dataObject, true);
return true;
} catch (Exception e) {
Console.WriteLine("Got exception while Copy text to clipboard : " + e);
} catch (ExternalException) {
}
Thread.Sleep(100);
}
@ -139,8 +132,7 @@ namespace ICSharpCode.TextEditor @@ -139,8 +132,7 @@ namespace ICSharpCode.TextEditor
textArea.Document.UndoStack.UndoLast(redocounter + 1); // redo the whole operation
} }
}
} catch (Exception ex) {
Console.WriteLine("Got exception while Paste : " + ex);
} catch (ExternalException) {
}
}

3
src/Libraries/NRefactory/Project/Src/Output/SpecialNodesInserter.cs

@ -76,7 +76,6 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -76,7 +76,6 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
/// </summary>
public void AcceptNodeStart(INode node)
{
Console.Write("Start node " + node.GetType().Name + ": ");
AcceptPoint(node.StartLocation);
}
@ -85,7 +84,6 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -85,7 +84,6 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
/// </summary>
public void AcceptNodeEnd(INode node)
{
Console.Write("End node " + node.GetType().Name + ": ");
AcceptPoint(node.EndLocation);
}
@ -94,7 +92,6 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -94,7 +92,6 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
/// </summary>
public void AcceptPoint(Point a)
{
Console.WriteLine(a.Y + ", " + a.X);
while (available) {
Point b = enumerator.Current.StartPosition;
if (b.Y < a.Y || (b.Y == a.Y && b.X <= a.X)) {

2
src/Main/Base/Project/Src/Dom/ExpressionContext.cs

@ -79,7 +79,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -79,7 +79,7 @@ namespace ICSharpCode.SharpDevelop.Dom
/// <remarks>When using this context, a resolver should try resolving typenames with an
/// appended "Attribute" suffix and treat "invocations" of the attribute type as
/// object creation.</remarks>
public static ExpressionContext Attribute = new TypeExpressionContext(ProjectContentRegistry.Mscorlib.GetClass("System.Attribute"), true, true);
public static ExpressionContext Attribute = new TypeExpressionContext(ProjectContentRegistry.Mscorlib.GetClass("System.Attribute"), false, true);
/// <summary>Context expects a type name which has special base type</summary>
/// <param name="baseClass">The class the expression must derive from.</param>

2
src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryASTConvertVisitor.cs

@ -528,7 +528,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -528,7 +528,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
if (e != null) {
e.Documentation = GetDocumentation(region.BeginLine);
} else {
Console.WriteLine("Warning: " + eventDeclaration + " has no events!");
LoggingService.Warn("NRefactoryASTConvertVisitor: " + eventDeclaration + " has no events!");
}
return null;
}

7
src/Main/Base/Project/Src/Dom/ResolveResult.cs

@ -202,18 +202,16 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -202,18 +202,16 @@ namespace ICSharpCode.SharpDevelop.Dom
{
ICompilationUnit cu = this.CallingClass.CompilationUnit;
if (cu == null) {
Console.WriteLine("callingClass.CompilationUnit is null");
return null;
}
if (cu.FileName == null || cu.FileName.Length == 0) {
Console.WriteLine("callingClass.CompilationUnit.FileName is empty");
return null;
}
IRegion reg = field.Region;
if (reg != null) {
return new FilePosition(cu.FileName, new Point(reg.BeginLine, reg.BeginColumn));
} else {
Console.WriteLine("Fieldregion not set!");
LoggingService.Warn("GetDefinitionPosition: field.Region is null");
return new FilePosition(cu.FileName, Point.Empty);
}
}
@ -376,16 +374,13 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -376,16 +374,13 @@ namespace ICSharpCode.SharpDevelop.Dom
{
IClass declaringType = resolvedMember.DeclaringType;
if (declaringType == null) {
Console.WriteLine("declaringType is null");
return null;
}
ICompilationUnit cu = declaringType.CompilationUnit;
if (cu == null) {
Console.WriteLine("declaringType.CompilationUnit is null");
return null;
}
if (cu.FileName == null || cu.FileName.Length == 0) {
Console.WriteLine("declaringType.CompilationUnit.FileName is empty");
return null;
}
IRegion reg = resolvedMember.Region;

14
src/Main/Base/Project/Src/Dom/XmlDoc.cs

@ -9,11 +9,13 @@ using System; @@ -9,11 +9,13 @@ using System;
using System.IO;
using System.Collections.Generic;
using System.Xml;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Dom
{
/// <summary>
/// Description of XmlDoc.
/// Class capable of loading xml documentation files. XmlDoc automatically creates a
/// binary cache for big xml files to reduce memory usage.
/// </summary>
public class XmlDoc : IDisposable
{
@ -116,15 +118,15 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -116,15 +118,15 @@ namespace ICSharpCode.SharpDevelop.Dom
int len = (int)fs.Length;
loader = new BinaryReader(fs);
if (loader.ReadInt64() != magic) {
Console.WriteLine("Wrong magic");
LoggingService.Warn("Cannot load XmlDoc: wrong magic");
return false;
}
if (loader.ReadInt16() != version) {
Console.WriteLine("Wrong version");
LoggingService.Warn("Cannot load XmlDoc: wrong version");
return false;
}
if (loader.ReadInt64() != fileDate.Ticks) {
Console.WriteLine("Wrong date");
LoggingService.Info("Not loading XmlDoc: file changed since cache was created");
return false;
}
fs.Position = loader.ReadInt32(); // go to start of index
@ -151,6 +153,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -151,6 +153,7 @@ namespace ICSharpCode.SharpDevelop.Dom
public void Dispose()
{
LoggingService.Debug("Disposing XmlDoc object");
if (loader != null) {
loader.Close();
fs.Close();
@ -190,12 +193,14 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -190,12 +193,14 @@ namespace ICSharpCode.SharpDevelop.Dom
public static XmlDoc Load(string fileName)
{
LoggingService.Debug("Loading XmlDoc for " + fileName);
string cacheName = MakeTempPath() + "/" + Path.GetFileNameWithoutExtension(fileName)
+ "." + fileName.GetHashCode().ToString("x") + ".dat";
XmlDoc doc;
if (File.Exists(cacheName)) {
doc = new XmlDoc();
if (doc.LoadFromBinary(cacheName, File.GetLastWriteTimeUtc(fileName))) {
LoggingService.Debug("XmlDoc: Load from cache successful");
return doc;
} else {
doc.Dispose();
@ -210,6 +215,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -210,6 +215,7 @@ namespace ICSharpCode.SharpDevelop.Dom
}
if (doc.xmlDescription.Count > cacheLength * 2) {
LoggingService.Debug("XmlDoc: Creating cache");
DateTime date = File.GetLastWriteTimeUtc(fileName);
doc.Save(cacheName, date);
doc.Dispose();

2
src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs

@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop.Gui
imglist.Images.Add(bitmap);
tmp[entry.Key] = ++i;
} else {
Console.WriteLine("can't load bitmap " + entry.Key.ToString() + " using default");
LoggingService.Warn("NewFileDialog: can't load bitmap " + entry.Key.ToString() + " using default");
}
}

2
src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs

@ -77,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -77,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
imglist.Images.Add(bitmap);
tmp[entry.Key] = ++i;
} else {
Console.WriteLine("can't load bitmap " + entry.Key.ToString() + " using default");
LoggingService.Warn("NewProjectDialog: can't load bitmap " + entry.Key.ToString() + " using default");
}
}

2
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/SolutionFolderNode.cs

@ -103,7 +103,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -103,7 +103,7 @@ namespace ICSharpCode.SharpDevelop.Project
SolutionFolderNode folderNode = new SolutionFolderNode(solution, (SolutionFolder)treeObject);
folderNode.AddTo(this);
} else {
Console.WriteLine("unknown tree object : " + treeObject);
LoggingService.Warn("SolutionFolderNode.Initialize(): unknown tree object : " + treeObject);
}
}

3
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/Util/ProjectBrowserTreeNodeVisitor.cs

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
// </file>
using System;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Project
{
@ -13,7 +14,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -13,7 +14,7 @@ namespace ICSharpCode.SharpDevelop.Project
{
public object Visit(AbstractProjectBrowserTreeNode abstractProjectBrowserTreeNode, object data)
{
Console.WriteLine("Warning visited default Visit() for : " + abstractProjectBrowserTreeNode);
LoggingService.Warn("Warning visited default Visit() for : " + abstractProjectBrowserTreeNode);
abstractProjectBrowserTreeNode.AcceptChildren(this, data);
return data;
}

4
src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs

@ -159,9 +159,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -159,9 +159,7 @@ namespace ICSharpCode.SharpDevelop.Gui
}
MessageService.ShowError(ex, "Exception got.");
#if DEBUG
Console.WriteLine("Stacktrace of source thread:");
Console.WriteLine(callerStack);
Console.WriteLine();
LoggingService.Info("Stacktrace of source thread:\n" + callerStack);
#endif
}
}

2
src/Main/Base/Project/Src/Internal/Templates/CodeTemplateLoader.cs

@ -96,7 +96,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -96,7 +96,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
static CodeTemplateLoader()
{
if (!LoadTemplatesFromStream(Path.Combine(PropertyService.ConfigDirectory, TemplateFileName))) {
Console.WriteLine("Templates: can't load user defaults, reading system defaults");
LoggingService.Info("Templates: can't load user defaults, reading system defaults");
if (!LoadTemplatesFromStream(FileUtility.Combine(PropertyService.DataDirectory, "options", TemplateFileName))) {
MessageService.ShowWarning("${res:Internal.Templates.CodeTemplateLoader.CantLoadTemplatesWarning}");
}

4
src/Main/Base/Project/Src/Project/MSBuildEngine.cs

@ -52,6 +52,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -52,6 +52,8 @@ namespace ICSharpCode.SharpDevelop.Project
public CompilerResults Run(string buildFile, string[] targets)
{
LoggingService.Debug("Run MSBuild on " + buildFile);
// HACK: Workaround for MSBuild bug:
// "unknown" MSBuild projects (projects with unknown type id, e.g. IL-projects)
// are looked up by MSBuild if the project files are MSBuild-compatible.
@ -69,6 +71,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -69,6 +71,8 @@ namespace ICSharpCode.SharpDevelop.Project
engine.RegisterLogger(logger);
engine.BuildProjectFile(buildFile, targets, properties, null);
logger.FlushText();
LoggingService.Debug("MSBuild finished");
return results;
}

1
src/Main/Base/Project/Src/Project/MSBuildProject.cs

@ -295,7 +295,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -295,7 +295,6 @@ namespace ICSharpCode.SharpDevelop.Project
public static CompilerResults RunMSBuild(string fileName, string target)
{
Console.WriteLine("Run : " + fileName);
WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).BringPadToFront();
// BeforeBuild();
MSBuildEngine engine = new MSBuildEngine();

2
src/Main/Base/Project/Src/Project/Solution/Solution.cs

@ -309,7 +309,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -309,7 +309,7 @@ namespace ICSharpCode.SharpDevelop.Project
nestedProjectsSection.Append(Environment.NewLine);
}
} else {
Console.WriteLine("unknown folder : "+ currentFolder);
LoggingService.Warn("Solution.Load(): unknown folder : " + currentFolder);
}
projectSection.Append("EndProject");
projectSection.Append(Environment.NewLine);

8
src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs

@ -198,7 +198,7 @@ namespace ICSharpCode.Core @@ -198,7 +198,7 @@ namespace ICSharpCode.Core
protected void AddClassToNamespaceListInternal(IClass addClass)
{
if (addClass.IsPartial) {
Console.WriteLine("Adding partial class " + addClass.Name + " from " + Path.GetFileName(addClass.CompilationUnit.FileName));
LoggingService.Debug("Adding partial class " + addClass.Name + " from " + Path.GetFileName(addClass.CompilationUnit.FileName));
Dictionary<string, IClass> classes = GetClasses(language);
CompoundClass compound = null;
if (classes.ContainsKey(addClass.FullyQualifiedName))
@ -209,17 +209,17 @@ namespace ICSharpCode.Core @@ -209,17 +209,17 @@ namespace ICSharpCode.Core
if (compound.Parts[i].CompilationUnit.FileName == addClass.CompilationUnit.FileName) {
compound.Parts[i] = addClass;
compound.UpdateInformationFromParts();
Console.WriteLine("\tReplaced old part!");
LoggingService.Debug("Replaced old part!");
return;
}
}
compound.Parts.Add(addClass);
compound.UpdateInformationFromParts();
Console.WriteLine("\tAdded new part!");
LoggingService.Debug("Added new part!");
return;
} else {
addClass = new CompoundClass(addClass);
Console.WriteLine("\tCompound created!");
LoggingService.Debug("Compound created!");
}
}

33
src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs

@ -35,17 +35,10 @@ namespace ICSharpCode.Core @@ -35,17 +35,10 @@ namespace ICSharpCode.Core
mscorlibContent = contents["mscorlib"];
return contents["mscorlib"];
}
#if DEBUG
Console.WriteLine("Loading mscorlib...");
int time = Environment.TickCount;
#endif
LoggingService.Debug("Loading PC for mscorlib...");
mscorlibContent = new ReflectionProjectContent(typeof(object).Assembly);
contents["mscorlib"] = mscorlibContent;
#if DEBUG
Console.WriteLine("mscorlib loaded in {0} ms", Environment.TickCount - time);
#endif
LoggingService.Debug("Finished loading mscorlib");
return mscorlibContent;
}
}
@ -95,10 +88,12 @@ namespace ICSharpCode.Core @@ -95,10 +88,12 @@ namespace ICSharpCode.Core
}
string shortName = item.Include;
LoggingService.Debug("Loading PC for " + shortName);
int pos = shortName.IndexOf(',');
if (pos > 0)
shortName = shortName.Substring(0, pos);
StatusBarService.ProgressMonitor.BeginTask("Loading " + shortName + "...", 100);
#if DEBUG
int time = Environment.TickCount;
@ -139,13 +134,13 @@ namespace ICSharpCode.Core @@ -139,13 +134,13 @@ namespace ICSharpCode.Core
return contents[item.Include];
}
} catch (Exception e) {
Console.WriteLine("Can't load assembly '{0}' : " + e.Message, item.Include);
LoggingService.Debug("Can't load assembly '" + item.Include + "' : " + e.Message);
}
} catch (BadImageFormatException) {
Console.WriteLine("BadImageFormat: " + shortName);
LoggingService.Warn("BadImageFormat: " + shortName);
} finally {
#if DEBUG
Console.WriteLine("Loaded {0} with {2} in {1}ms", item.Include, Environment.TickCount - time, how);
LoggingService.DebugFormatted("Loaded {0} with {2} in {1}ms", item.Include, Environment.TickCount - time, how);
#endif
StatusBarService.ProgressMonitor.Done();
}
@ -188,28 +183,28 @@ namespace ICSharpCode.Core @@ -188,28 +183,28 @@ namespace ICSharpCode.Core
static Assembly AssemblyResolve(object sender, ResolveEventArgs e)
{
string shortName = e.Name;
Console.Write("AssemblyResolve: " + e.Name);
LoggingService.Debug("ProjectContentRegistry.AssemblyResolve" + e.Name);
int pos = shortName.IndexOf(',');
if (pos > 0)
shortName = shortName.Substring(0, pos);
string path = Path.Combine(lookupDirectory, shortName);
if (File.Exists(path + ".dll")) {
Console.WriteLine(" - found .dll file");
LoggingService.Debug("AssemblyResolve ReflectionOnlyLoadFrom .dll file");
return Assembly.ReflectionOnlyLoadFrom(path + ".dll");
}
if (File.Exists(path + ".exe")) {
Console.WriteLine(" - found .exe file");
LoggingService.Debug("AssemblyResolve ReflectionOnlyLoadFrom .exe file");
return Assembly.ReflectionOnlyLoadFrom(path + ".exe");
}
if (File.Exists(path)) {
Console.WriteLine(" - found file");
LoggingService.Debug("AssemblyResolve ReflectionOnlyLoadFrom file");
return Assembly.ReflectionOnlyLoadFrom(path);
}
try {
Console.WriteLine(" - try ReflectionOnlyLoad");
LoggingService.Debug("AssemblyResolve trying ReflectionOnlyLoad");
return Assembly.ReflectionOnlyLoad(e.Name);
} catch (FileNotFoundException ex) {
Console.WriteLine("AssemblyResolve: " + ex.Message);
LoggingService.Warn("AssemblyResolve failed: " + ex.Message);
return null;
}
}

4
src/Main/Base/Project/Src/Services/ProjectService/ParseableFileContentEnumerator.cs

@ -130,11 +130,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -130,11 +130,11 @@ namespace ICSharpCode.SharpDevelop.Project
}
} catch (FileNotFoundException ex) {
res = null;
Console.WriteLine("ParseableFileContentEnumerator: " + ex.Message);
LoggingService.Warn("ParseableFileContentEnumerator: " + ex.Message);
return MoveNext(); // skip files that were not found
} catch (IOException ex) {
res = null;
Console.WriteLine("ParseableFileContentEnumerator: " + ex.Message);
LoggingService.Warn("ParseableFileContentEnumerator: " + ex.Message);
return MoveNext(); // skip invalid files
}
if (nextItem != null && nextItem.ItemType == ItemType.Compile && CanReadAsync(nextItem))

4
src/Main/Base/Project/Src/TextEditor/Commands/CodeGenerators/CodeGenerator.cs

@ -35,14 +35,14 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -35,14 +35,14 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
csa = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("C#", this);
csa.ConversionFlags = ConversionFlags.ShowAccessibility | ConversionFlags.ShowModifiers | ConversionFlags.QualifiedNamesOnlyForReturnTypes | ConversionFlags.ShowReturnType | ConversionFlags.ShowParameterNames;
} catch (Exception) {
Console.WriteLine("CSharpAmbience not found -- is the C# backend binding loaded???");
LoggingService.Warn("CSharpAmbience not found -- is the C# backend binding loaded???");
}
try {
vba = (IAmbience)AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem("VBNET", this);
vba.ConversionFlags = ConversionFlags.ShowAccessibility | ConversionFlags.ShowModifiers | ConversionFlags.QualifiedNamesOnlyForReturnTypes | ConversionFlags.ShowReturnType | ConversionFlags.ShowParameterNames;
} catch (Exception) {
Console.WriteLine("VBNet ambience not found -- is the VB.NET backend binding loaded???");
LoggingService.Warn("VBNet ambience not found -- is the VB.NET backend binding loaded???");
}
}

3
src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionData.cs

@ -121,7 +121,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -121,7 +121,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
ambience.ConversionFlags = ConversionFlags.None;
text = ambience.Convert(c);
ambience.ConversionFlags = ConversionFlags.UseFullyQualifiedNames | ConversionFlags.ShowReturnType | ConversionFlags.ShowModifiers;
// Console.WriteLine("Convert : " + c);
description = ambience.Convert(c);
documentation = c.Documentation;
GetPriority(c.DotNetName);
@ -277,7 +276,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -277,7 +276,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
}
} while(xml.Read());
} catch (Exception ex) {
Console.WriteLine("Invalid XML documentation: " + ex.Message);
LoggingService.Debug("Invalid XML documentation: " + ex.Message);
return doc;
}
return ret.ToString();

6
src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionDataProvider.cs

@ -36,6 +36,12 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -36,6 +36,12 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
if (expressionResult.Expression == null || expressionResult.Expression.Length == 0) {
return;
}
if (LoggingService.IsDebugEnabled) {
if (expressionResult.Context == ExpressionContext.Default)
LoggingService.DebugFormatted("GenerateCompletionData for >>{0}<<", expressionResult.Expression);
else
LoggingService.DebugFormatted("GenerateCompletionData for >>{0}<<, context={1}", expressionResult.Expression, expressionResult.Context);
}
#if DEBUG
if (DebugMode) {
Debugger.Break();

10
src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionDataUsageCache.cs

@ -64,11 +64,11 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -64,11 +64,11 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
using (FileStream fs = new FileStream(CacheFilename, FileMode.Open, FileAccess.Read)) {
using (BinaryReader reader = new BinaryReader(fs)) {
if (reader.ReadInt64() != magic) {
Console.WriteLine("CodeCompletionDataUsageCache: wrong file magic");
LoggingService.Warn("CodeCompletionDataUsageCache: wrong file magic");
return;
}
if (reader.ReadInt16() != version) {
Console.WriteLine("CodeCompletionDataUsageCache: unknown file version");
LoggingService.Warn("CodeCompletionDataUsageCache: unknown file version");
return;
}
int itemCount = reader.ReadInt32();
@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
}
}
}
Console.WriteLine("Loaded CodeCompletionDataUsageCache (" + dict.Count + " items)");
LoggingService.Info("Loaded CodeCompletionDataUsageCache (" + dict.Count + " items)");
}
public static void SaveCache()
@ -100,7 +100,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -100,7 +100,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
count = SaveCache(writer);
}
}
Console.WriteLine("Saved CodeCompletionDataUsageCache (" + count + " of " + dict.Count + " items)");
LoggingService.Info("Saved CodeCompletionDataUsageCache (" + count + " of " + dict.Count + " items)");
}
static int SaveCache(BinaryWriter writer)
@ -155,7 +155,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -155,7 +155,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
File.Delete(CacheFilename);
}
} catch (Exception ex) {
Console.WriteLine("CodeCompletionDataUsageCache.ResetCache(): " + ex.Message);
LoggingService.Warn("CodeCompletionDataUsageCache.ResetCache(): " + ex.Message);
}
}

13
src/Main/Base/Project/Src/TextEditor/Gui/Editor/InsightWindow/MethodInsightDataProvider.cs

@ -110,6 +110,13 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -110,6 +110,13 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
return;
expressionResult.Expression = expressionResult.Expression.Trim();
if (LoggingService.IsDebugEnabled) {
if (expressionResult.Context == ExpressionContext.Default)
LoggingService.DebugFormatted("ShowInsight for >>{0}<<", expressionResult.Expression);
else
LoggingService.DebugFormatted("ShowInsight for >>{0}<<, context={1}", expressionResult.Expression, expressionResult.Context);
}
// the parser works with 1 based coordinates
int caretLineNumber = document.GetLineNumberForOffset(useOffset) + 1;
int caretColumn = useOffset - document.GetLineSegment(caretLineNumber).Offset + 1;
@ -119,11 +126,11 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -119,11 +126,11 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
protected virtual void SetupDataProvider(string fileName, IDocument document, ExpressionResult expressionResult, int caretLineNumber, int caretColumn)
{
bool constructorInsight = false;
if (expressionResult.Context.IsObjectCreation) {
if (expressionResult.Context == ExpressionContext.Attribute) {
constructorInsight = true;
expressionResult.Context = ExpressionContext.Type;
} else if (expressionResult.Context == ExpressionContext.Attribute) {
} else if (expressionResult.Context.IsObjectCreation) {
constructorInsight = true;
expressionResult.Context = ExpressionContext.Type;
}
ResolveResult results = ParserService.Resolve(expressionResult, caretLineNumber, caretColumn, fileName, document.TextContent);
if (constructorInsight) {

2
src/Main/Base/Project/Src/TextEditor/Gui/Editor/QuickClassBrowserPanel.cs

@ -500,11 +500,9 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -500,11 +500,9 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
// font - has to be static - don't create on each draw
static Font font = font = new Font("Arial", 8.25f);
static StringFormat drawStringFormat = new StringFormat(StringFormatFlags.NoWrap);
// static int drawingCount = 0;
void ComboBoxDrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
// Console.WriteLine("Draw " + (drawingCount++));
ComboBox comboBox = (ComboBox)sender;
e.DrawBackground();

2
src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs

@ -163,7 +163,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -163,7 +163,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
}
}
} catch (TreePathNotFoundException) {
Console.WriteLine(editActionsPath + " doesn't exists in the AddInTree");
LoggingService.Warn("EditAction " + editActionsPath + " doesn't exists in the AddInTree");
}
}

8
src/Main/Core/Project/ICSharpCode.Core.csproj

@ -35,6 +35,10 @@ @@ -35,6 +35,10 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="log4net">
<HintPath>..\..\..\Libraries\log4net\bin\net\1.1\release\log4net.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\ICSharpCode.Core.doc" />
@ -128,6 +132,10 @@ @@ -128,6 +132,10 @@
</Compile>
<Compile Include="Src\AddInTree\AddIn\IBuildItemsModifier.cs" />
<Compile Include="Src\AddInTree\AddIn\DefaultDoozers\IncludeDoozer.cs" />
<Compile Include="Src\Services\LoggingService\LoggingService.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Src\Services\LoggingService" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project>

2
src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs

@ -32,7 +32,7 @@ namespace ICSharpCode.Core @@ -32,7 +32,7 @@ namespace ICSharpCode.Core
return o;
}
}
Console.WriteLine("Cannot create object: " + className);
LoggingService.Error("Cannot create object: " + className);
if (!hasShownErrorMessage) {
hasShownErrorMessage = true;
MessageService.ShowError("Cannot create object: " + className + "\nFuture missing objects will not cause an error message.");

4
src/Main/Core/Project/Src/AddInTree/AddIn/Codon.cs

@ -102,8 +102,8 @@ namespace ICSharpCode.Core @@ -102,8 +102,8 @@ namespace ICSharpCode.Core
return action = ConditionFailedAction.Exclude;
}
}
} catch (Exception) {
Console.WriteLine("Exception in AddIn : " + addIn.FileName);
} catch {
LoggingService.Error("Exception while getting failed action from " + addIn.FileName);
throw;
}
}

4
src/Main/Core/Project/Src/AddInTree/AddIn/Runtime.cs

@ -38,9 +38,7 @@ namespace ICSharpCode.Core @@ -38,9 +38,7 @@ namespace ICSharpCode.Core
public Assembly LoadedAssembly {
get {
if (!isAssemblyLoaded) {
#if DEBUG
Console.WriteLine("Loading addin " + assembly + "...");
#endif
LoggingService.Info("Loading addin " + assembly);
isAssemblyLoaded = true;

4
src/Main/Core/Project/Src/AddInTree/AddInTreeNode.cs

@ -89,7 +89,7 @@ namespace ICSharpCode.Core @@ -89,7 +89,7 @@ namespace ICSharpCode.Core
codons[indexOfName[before]].InsertAfter = after + ',' + codons[i].Id;
}
} else {
Console.WriteLine("Codon ({0}) specified in the insertbefore of the {1} codon does not exist!", before, codons[i]);
LoggingService.WarnFormatted("Codon ({0}) specified in the insertbefore of the {1} codon does not exist!", before, codons[i]);
}
}
}
@ -119,7 +119,7 @@ namespace ICSharpCode.Core @@ -119,7 +119,7 @@ namespace ICSharpCode.Core
if (indexOfName.ContainsKey(s)) {
Visit(indexOfName[s]);
} else {
Console.WriteLine("Codon ({0}) specified in the insertafter of the {1} codon does not exist!", codons[codonIndex].InsertAfter, codons[codonIndex]);
LoggingService.WarnFormatted("Codon ({0}) specified in the insertafter of the {1} codon does not exist!", codons[codonIndex].InsertAfter, codons[codonIndex]);
}
}
sortedCodons.Add(codons[codonIndex]);

120
src/Main/Core/Project/Src/Services/LoggingService/LoggingService.cs

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using log4net;
using log4net.Core;
using log4net.Config;
namespace ICSharpCode.Core
{
public static class LoggingService
{
static readonly ILog log = LogManager.GetLogger(typeof(LoggingService));
static LoggingService()
{
XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile));
}
public static void Debug(object message)
{
log.Debug(message);
}
public static void DebugFormatted(string format, params object[] args)
{
log.DebugFormat(format, args);
}
public static void Info(object message)
{
log.Info(message);
}
public static void InfoFormatted(string format, params object[] args)
{
log.InfoFormat(format, args);
}
public static void Warn(object message)
{
log.Warn(message);
}
public static void Warn(object message, Exception exception)
{
log.Warn(message, exception);
}
public static void WarnFormatted(string format, params object[] args)
{
log.WarnFormat(format, args);
}
public static void Error(object message)
{
log.Error(message);
}
public static void Error(object message, Exception exception)
{
log.Error(message, exception);
}
public static void ErrorFormatted(string format, params object[] args)
{
log.ErrorFormat(format, args);
}
public static void Fatal(object message)
{
log.Fatal(message);
}
public static void Fatal(object message, Exception exception)
{
log.Fatal(message, exception);
}
public static void FatalFormatted(string format, params object[] args)
{
log.FatalFormat(format, args);
}
public static bool IsDebugEnabled {
get {
return log.IsDebugEnabled;
}
}
public static bool IsInfoEnabled {
get {
return log.IsInfoEnabled;
}
}
public static bool IsWarnEnabled {
get {
return log.IsWarnEnabled;
}
}
public static bool IsErrorEnabled {
get {
return log.IsErrorEnabled;
}
}
public static bool IsFatalEnabled {
get {
return log.IsFatalEnabled;
}
}
}
}

23
src/Main/Core/Project/Src/Services/MessageService/MessageService.cs

@ -62,17 +62,18 @@ namespace ICSharpCode.Core @@ -62,17 +62,18 @@ namespace ICSharpCode.Core
public static void ShowError(Exception ex, string message)
{
if (customErrorReporter != null && ex != null) {
customErrorReporter(ex, message);
return;
if (ex != null) {
LoggingService.Error(message, ex);
if (customErrorReporter != null) {
customErrorReporter(ex, message);
return;
}
} else {
LoggingService.Error(message);
}
#if DEBUG
Console.WriteLine();
if (message != null)
Console.WriteLine(message);
if (ex != null) {
Console.WriteLine(ex);
Console.Beep();
return;
}
@ -96,7 +97,9 @@ namespace ICSharpCode.Core @@ -96,7 +97,9 @@ namespace ICSharpCode.Core
public static void ShowWarning(string message)
{
MessageBox.Show(MessageService.MainForm, StringParser.Parse(message), StringParser.Parse("${res:Global.WarningText}"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
message = StringParser.Parse(message);
LoggingService.Warn(message);
MessageBox.Show(MessageService.MainForm, message, StringParser.Parse("${res:Global.WarningText}"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
public static void ShowWarningFormatted(string formatstring, params string[] formatitems)
@ -162,7 +165,9 @@ namespace ICSharpCode.Core @@ -162,7 +165,9 @@ namespace ICSharpCode.Core
public static void ShowMessage(string message, string caption)
{
MessageBox.Show(mainForm, StringParser.Parse(message), StringParser.Parse(caption), MessageBoxButtons.OK, MessageBoxIcon.Information);
message = StringParser.Parse(message);
LoggingService.Info(message);
MessageBox.Show(mainForm, message, StringParser.Parse(caption), MessageBoxButtons.OK, MessageBoxIcon.Information);
}
static string Format(string formatstring, string[] formatitems)

35
src/Main/StartUp/Project/SharpDevelop.exe.config

@ -1,4 +1,7 @@ @@ -1,4 +1,7 @@
<configuration>
<configSections>
<section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
@ -19,4 +22,36 @@ @@ -19,4 +22,36 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<log4net>
<appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
<mapping>
<level value="FATAL" />
<foreColor value="Red, HighIntensity" />
</mapping>
<mapping>
<level value="ERROR" />
<foreColor value="Red" />
</mapping>
<mapping>
<level value="WARN" />
<foreColor value="Yellow" />
</mapping>
<mapping>
<level value="INFO" />
<foreColor value="White" />
</mapping>
<mapping>
<level value="DEBUG" />
<foreColor value="Green" />
</mapping>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level- %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="ColoredConsoleAppender" />
</root>
</log4net>
</configuration>

125
src/Main/StartUp/Project/SharpDevelopMain.cs

@ -41,6 +41,7 @@ namespace ICSharpCode.SharpDevelop @@ -41,6 +41,7 @@ namespace ICSharpCode.SharpDevelop
static void ShowErrorBox(object sender, ThreadExceptionEventArgs eargs)
{
LoggingService.Error("ThreadException caught", eargs.Exception);
ShowErrorBox(eargs.Exception, null);
}
@ -55,54 +56,45 @@ namespace ICSharpCode.SharpDevelop @@ -55,54 +56,45 @@ namespace ICSharpCode.SharpDevelop
}
}
readonly static string[] assemblyList = {
"Microsoft.VisualBasic.dll",
"Microsoft.JScript.dll",
"mscorlib.dll",
"System.Data.dll",
"System.Design.dll",
"System.DirectoryServices.dll",
"System.Drawing.Design.dll",
"System.Drawing.dll",
"System.EnterpriseServices.dll",
"System.Management.dll",
"System.Messaging.dll",
"System.Runtime.Remoting.dll",
"System.Runtime.Serialization.Formatters.Soap.dll",
"System.Security.dll",
"System.ServiceProcess.dll",
"System.Web.Services.dll",
"System.Web.dll",
"System.Windows.Forms.dll",
"System.dll",
"System.XML.dll"
};
/// <summary>
/// Starts the core of SharpDevelop.
/// </summary>
[STAThread()]
public static void Main(string[] args)
{
#if DEBUG
if (Debugger.IsAttached) {
Run(args);
} else {
try {
Run(args);
} catch (Exception ex) {
Console.WriteLine(ex);
try {
Application.Run(new ExceptionBox(ex, "Unhandled exception terminated SharpDevelop"));
} catch {
MessageBox.Show(ex.ToString(), "Critical error (cannot use ExceptionBox)");
}
}
return;
}
#endif
// Do not use LoggingService here (see comment in Run(string[]))
try {
Run(args);
} catch (Exception ex) {
HandleMainException(ex);
}
}
static void HandleMainException(Exception ex)
{
LoggingService.Fatal(ex);
try {
Application.Run(new ExceptionBox(ex, "Unhandled exception terminated SharpDevelop"));
} catch {
MessageBox.Show(ex.ToString(), "Critical error (cannot use ExceptionBox)");
}
}
static void Run(string[] args)
{
// DO NOT USE LoggingService HERE!
// LoggingService requires ICSharpCode.Core.dll and log4net.dll
// When a method containing a call to LoggingService is JITted, the
// libraries are loaded.
// We want to show the SplashScreen while those libraries are loaded, so
// don't call LoggingService.
#if DEBUG
Control.CheckForIllegalCrossThreadCalls = true;
#endif
@ -133,18 +125,36 @@ namespace ICSharpCode.SharpDevelop @@ -133,18 +125,36 @@ namespace ICSharpCode.SharpDevelop
static void RunApplication()
{
if (!Debugger.IsAttached) {
Application.ThreadException += ShowErrorBox;
LoggingService.Info("Starting SharpDevelop...");
try {
if (!Debugger.IsAttached) {
Application.ThreadException += ShowErrorBox;
}
#if !DEBUG
MessageService.CustomErrorReporter = ShowErrorBox;
#endif
RegisterDoozers();
InitializeCore();
// finally start the workbench.
try {
LoggingService.Info("Starting workbench...");
new StartWorkbenchCommand().Run(SplashScreenForm.GetRequestedFileList());
} finally {
LoggingService.Info("Unloading services...");
ProjectService.CloseSolution();
FileService.Unload();
PropertyService.Save();
}
} finally {
LoggingService.Info("Leaving RunApplication()");
}
#if !DEBUG
MessageService.CustomErrorReporter = ShowErrorBox;
#endif
// TODO:
// bool ignoreDefaultPath = false;
// string [] addInDirs = ICSharpCode.SharpDevelop.AddInSettingsHandler.GetAddInDirectories(out ignoreDefaultPath);
// SetAddInDirectories(addInDirs, ignoreDefaultPath);
}
static void RegisterDoozers()
{
AddInTree.ConditionEvaluators.Add("ActiveContentExtension", new ActiveContentExtensionConditionEvaluator());
AddInTree.ConditionEvaluators.Add("ActiveViewContentUntitled", new ActiveViewContentUntitledConditionEvaluator());
AddInTree.ConditionEvaluators.Add("ActiveWindowState", new ActiveWindowStateConditionEvaluator());
@ -171,43 +181,38 @@ namespace ICSharpCode.SharpDevelop @@ -171,43 +181,38 @@ namespace ICSharpCode.SharpDevelop
AddInTree.Doozers.Add("Debugger", new DebuggerDoozer());
MenuCommand.LinkCommandCreator = delegate(string link) { return new LinkCommand(link); };
}
static void InitializeCore()
{
LoggingService.Info("Loading properties...");
PropertyService.Load();
StringParser.RegisterStringTagProvider(new SharpDevelopStringTagProvider());
LoggingService.Info("Loading AddInTree...");
AddInTree.Load();
LoggingService.Info("Initializing workbench...");
// .NET base autostarts
// taken out of the add-in tree for performance reasons (every tick in startup counts)
new InitializeWorkbenchCommand().Run();
// run workspace autostart commands
try {
LoggingService.Info("Running autostart commands...");
foreach (ICommand command in AddInTree.BuildItems("/Workspace/Autostart", null, false)) {
command.Run();
}
} catch (XmlException e) {
LoggingService.Error("Could not load XML", e);
MessageBox.Show("Could not load XML :" + Environment.NewLine + e.Message);
return;
} catch (Exception e) {
MessageBox.Show("Loading error, please reinstall :" + Environment.NewLine + e.ToString());
return;
} finally {
if (SplashScreenForm.SplashScreen != null) {
SplashScreenForm.SplashScreen.Dispose();
}
}
// finally start the workbench.
try {
new StartWorkbenchCommand().Run(SplashScreenForm.GetRequestedFileList());
} finally {
// unloading
ProjectService.CloseSolution();
FileService.Unload();
PropertyService.Save();
}
}
}
}

Loading…
Cancel
Save