[Monodevelop-patches-list] r2307 - in trunk/MonoDevelop/Core/src/MonoDevelop.Base: . Commands Gui/Pads Gui/Workbench/Layouts Internal/ProgressMonitoring Internal/Project/Combine Internal/Project/Project Internal/Project/Project/Collections Services/MenuService Services/ParserService Services/Project Services/Tasks
Lluis Sanchez <lluis@ximian.com>
lluis at mono-cvs.ximian.com
Mon Mar 7 15:00:43 EST 2005
Author: lluis
Date: 2005-03-07 15:00:42 -0500 (Mon, 07 Mar 2005)
New Revision: 2307
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/MenuItemBuilders.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/DefaultMonitorPad.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/Combine.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/CombineEntry.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Collections/ProjectFileCollection.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Collections/ProjectReferenceCollection.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Project.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectFile.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectFileEventArgs.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MenuService/MenuService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/ClassInformationEventHandler.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/IParserService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/ProjectCodeCompletionDatabase.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/IProjectService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/ProjectService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/OutputProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/TaskService.cs
Log:
2005-03-07 Lluis Sanchez Gual <lluis at novell.com>
* Commands/MenuItemBuilders.cs: Added null check.
* Services/MenuService/MenuService.cs: Added new ShowContextMenu
method.
* Services/Tasks/OutputProgressMonitor.cs: Fixed namespace.
* Services/Tasks/TaskService.cs: The id of output pads are now
like "OutputPad1".
* Services/Project/IProjectService.cs,
* Services/Project/ProjectService.cs: Added FileRenamedInProject event.
* Services/ParserService/ClassInformationEventHandler.cs: Added a
Project property to ClassInformationEventArgs.
* Services/ParserService/ProjectCodeCompletionDatabase.cs: Handle the
new FileRenamedInProject event.
* Services/ParserService/DefaultParserService.cs,
* Services/ParserService/CodeCompletionDatabase.cs,
* Services/ParserService/IParserService.cs: Added GetClassList method
and added a new includeReferences parameter to GetNamespaceList.
* Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Avoid memory leaks.
* Gui/Pads/DefaultMonitorPad.cs: Set the correct namespace.
* Internal/Project/Project/ProjectFileEventArgs.cs: Added new
handler for file rename events.
* Internal/Project/Project/ProjectFile.cs: Use the new file renamed
event. Fixed RelativePath property.
* Internal/Project/Project/Project.cs: Use the new file renamed event.
Moved find code to ProjectFileCollection.
* Internal/Project/Project/Collections/ProjectReferenceCollection.cs:
improved handling of events.
* Internal/Project/Project/Collections/ProjectFileCollection.cs:
Added file find method.
* Internal/Project/Combine/Combine.cs: Use the new file renamed event.
Other minor fixes.
* Internal/Project/Combine/CombineEntry.cs: Notify the combine when
an entry is removed.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-03-07 20:00:42 UTC (rev 2307)
@@ -1,3 +1,44 @@
+2005-03-07 Lluis Sanchez Gual <lluis at novell.com>
+
+ * Commands/MenuItemBuilders.cs: Added null check.
+
+ * Services/MenuService/MenuService.cs: Added new ShowContextMenu
+ method.
+ * Services/Tasks/OutputProgressMonitor.cs: Fixed namespace.
+ * Services/Tasks/TaskService.cs: The id of output pads are now
+ like "OutputPad1".
+
+ * Services/Project/IProjectService.cs,
+ * Services/Project/ProjectService.cs: Added FileRenamedInProject event.
+
+ * Services/ParserService/ClassInformationEventHandler.cs: Added a
+ Project property to ClassInformationEventArgs.
+
+ * Services/ParserService/ProjectCodeCompletionDatabase.cs: Handle the
+ new FileRenamedInProject event.
+
+ * Services/ParserService/DefaultParserService.cs,
+ * Services/ParserService/CodeCompletionDatabase.cs,
+ * Services/ParserService/IParserService.cs: Added GetClassList method
+ and added a new includeReferences parameter to GetNamespaceList.
+
+ * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Avoid memory leaks.
+ * Gui/Pads/DefaultMonitorPad.cs: Set the correct namespace.
+ * Internal/Project/Project/ProjectFileEventArgs.cs: Added new
+ handler for file rename events.
+ * Internal/Project/Project/ProjectFile.cs: Use the new file renamed
+ event. Fixed RelativePath property.
+ * Internal/Project/Project/Project.cs: Use the new file renamed event.
+ Moved find code to ProjectFileCollection.
+ * Internal/Project/Project/Collections/ProjectReferenceCollection.cs:
+ improved handling of events.
+ * Internal/Project/Project/Collections/ProjectFileCollection.cs:
+ Added file find method.
+ * Internal/Project/Combine/Combine.cs: Use the new file renamed event.
+ Other minor fixes.
+ * Internal/Project/Combine/CombineEntry.cs: Notify the combine when
+ an entry is removed.
+
2005-03-04 Christian Hergert <christian.hergert at gmail.com>
* Gui/Pads/FileScout/FileScout.cs: Fix race condition when adding files
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/MenuItemBuilders.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/MenuItemBuilders.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Commands/MenuItemBuilders.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -227,7 +227,7 @@
public Gtk.MenuItem[] BuildSubmenu(ConditionCollection conditionCollection, object owner)
{
int contentCount = WorkbenchSingleton.Workbench.ViewContentCollection.Count;
- if (contentCount == 0) {
+ if (contentCount == 0 || contentCount != 0) {
return new Gtk.MenuItem[] {};
}
Gtk.MenuItem[] items = new Gtk.MenuItem[contentCount];
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/DefaultMonitorPad.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/DefaultMonitorPad.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Pads/DefaultMonitorPad.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -20,7 +20,7 @@
using Gtk;
using Pango;
-namespace MonoDevelop.EditorBindings.Gui.Pads
+namespace MonoDevelop.Gui.Pads
{
public class DefaultMonitorPad : IPadContent
{
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -251,8 +251,10 @@
WorkbenchSingleton.Workbench.WorkbenchLayout.RemoveTab (pageNum);
}
OnWindowDeselected(EventArgs.Empty);
+ mainItem.Remove (content.Control);
content.Dispose ();
OnCloseEvent(null);
+ content = null;
}
public void AttachSecondaryViewContent(ISecondaryViewContent subViewContent)
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -112,6 +112,7 @@
else if (message != null && ex != null)
message += ". " + ex.Message;
errorsMessages.Add (message);
+ Console.WriteLine (ex);
}
[FreeDispatch]
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/Combine.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/Combine.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/Combine.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -58,6 +58,7 @@
ProjectFileEventHandler fileAddedToProjectHandler;
ProjectFileEventHandler fileRemovedFromProjectHandler;
ProjectFileEventHandler fileChangedInProjectHandler;
+ ProjectFileRenamedEventHandler fileRenamedInProjectHandler;
ProjectReferenceEventHandler referenceAddedToProjectHandler;
ProjectReferenceEventHandler referenceRemovedFromProjectHandler;
@@ -149,6 +150,7 @@
fileAddedToProjectHandler = new ProjectFileEventHandler (NotifyFileAddedToProject);
fileChangedInProjectHandler = new ProjectFileEventHandler (NotifyFileChangedInProject);
fileRemovedFromProjectHandler = new ProjectFileEventHandler (NotifyFileRemovedFromProject);
+ fileRenamedInProjectHandler = new ProjectFileRenamedEventHandler (NotifyFileRenamedInProject);
referenceAddedToProjectHandler = new ProjectReferenceEventHandler (NotifyReferenceAddedToProject);
referenceRemovedFromProjectHandler = new ProjectReferenceEventHandler (NotifyReferenceRemovedFromProject);
}
@@ -180,18 +182,20 @@
if (entry is Project)
{
Project project = entry as Project;
- project.FileRemovedFromProject += fileAddedToProjectHandler;
- project.FileAddedToProject += fileRemovedFromProjectHandler;
+ project.FileRemovedFromProject += fileRemovedFromProjectHandler;
+ project.FileAddedToProject += fileAddedToProjectHandler;
project.FileChangedInProject += fileChangedInProjectHandler;
+ project.FileRenamedInProject += fileRenamedInProjectHandler;
project.ReferenceRemovedFromProject += referenceAddedToProjectHandler;
project.ReferenceAddedToProject += referenceRemovedFromProjectHandler;
}
else if (entry is Combine)
{
Combine combine = entry as Combine;
- combine.FileRemovedFromProject += fileAddedToProjectHandler;
- combine.FileAddedToProject += fileRemovedFromProjectHandler;
+ combine.FileRemovedFromProject += fileRemovedFromProjectHandler;
+ combine.FileAddedToProject += fileAddedToProjectHandler;
combine.FileChangedInProject += fileChangedInProjectHandler;
+ combine.FileRenamedInProject += fileRenamedInProjectHandler;
combine.ReferenceRemovedFromProject += referenceAddedToProjectHandler;
combine.ReferenceAddedToProject += referenceRemovedFromProjectHandler;
}
@@ -227,13 +231,14 @@
return entry;
}
- public void RemoveEntry (CombineEntry entry)
+ internal void NotifyEntryRemoved (CombineEntry entry)
{
Project pce = entry as Project;
if (pce != null) {
pce.FileRemovedFromProject -= fileAddedToProjectHandler;
pce.FileAddedToProject -= fileRemovedFromProjectHandler;
pce.FileChangedInProject -= fileChangedInProjectHandler;
+ pce.FileRenamedInProject -= fileRenamedInProjectHandler;
pce.ReferenceRemovedFromProject -= referenceAddedToProjectHandler;
pce.ReferenceAddedToProject -= referenceRemovedFromProjectHandler;
}
@@ -243,11 +248,29 @@
cce.FileRemovedFromProject -= fileAddedToProjectHandler;
cce.FileAddedToProject -= fileRemovedFromProjectHandler;
cce.FileChangedInProject -= fileChangedInProjectHandler;
+ cce.FileRenamedInProject -= fileRenamedInProjectHandler;
cce.ReferenceRemovedFromProject -= referenceAddedToProjectHandler;
cce.ReferenceAddedToProject -= referenceRemovedFromProjectHandler;
}
}
-
+
+ // remove execute definition
+ CombineExecuteDefinition removeExDef = null;
+ foreach (CombineExecuteDefinition exDef in CombineExecuteDefinitions) {
+ if (exDef.Entry == entry) {
+ removeExDef = exDef;
+ break;
+ }
+ }
+ CombineExecuteDefinitions.Remove (removeExDef);
+
+ // remove configuration
+ foreach (CombineConfiguration dentry in Configurations)
+ dentry.RemoveEntry (entry);
+ }
+
+ public void RemoveEntry (CombineEntry entry)
+ {
Entries.Remove (entry);
OnEntryRemoved (new CombineEntryEventArgs (entry));
}
@@ -508,6 +531,11 @@
OnFileChangedInProject (e);
}
+ internal void NotifyFileRenamedInProject (object sender, ProjectFileRenamedEventArgs e)
+ {
+ OnFileRenamedInProject (e);
+ }
+
internal void NotifyReferenceRemovedFromProject (object sender, ProjectReferenceEventArgs e)
{
OnReferenceRemovedFromProject (e);
@@ -560,6 +588,13 @@
}
}
+ protected virtual void OnFileRenamedInProject (ProjectFileRenamedEventArgs e)
+ {
+ if (FileRenamedInProject != null) {
+ FileRenamedInProject (this, e);
+ }
+ }
+
protected virtual void OnReferenceRemovedFromProject (ProjectReferenceEventArgs e)
{
if (ReferenceRemovedFromProject != null) {
@@ -580,6 +615,7 @@
public event ProjectFileEventHandler FileAddedToProject;
public event ProjectFileEventHandler FileRemovedFromProject;
public event ProjectFileEventHandler FileChangedInProject;
+ public event ProjectFileRenamedEventHandler FileRenamedInProject;
public event ProjectReferenceEventHandler ReferenceAddedToProject;
public event ProjectReferenceEventHandler ReferenceRemovedFromProject;
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/CombineEntry.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/CombineEntry.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Combine/CombineEntry.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -256,6 +256,10 @@
public void Remove (CombineEntry entry)
{
list.Remove (entry);
+ if (parentCombine != null) {
+ entry.SetParentCombine (null);
+ parentCombine.NotifyEntryRemoved (entry);
+ }
}
public int IndexOf (CombineEntry entry)
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Collections/ProjectFileCollection.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Collections/ProjectFileCollection.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Collections/ProjectFileCollection.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -34,6 +34,16 @@
this.project = project;
}
+ public ProjectFile GetFile (string fileName)
+ {
+ if (fileName == null) return null;
+ foreach (ProjectFile file in this) {
+ if (file.Name == fileName)
+ return file;
+ }
+ return null;
+ }
+
/// <summary>
/// <para>Represents the entry at the specified index of the <see cref='.ProjectFile'/>.</para>
/// </summary>
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Collections/ProjectReferenceCollection.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Collections/ProjectReferenceCollection.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Collections/ProjectReferenceCollection.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -46,9 +46,7 @@
return ((ProjectReference)(List[index]));
}
set {
- if (project != null) project.NotifyReferenceRemovedFromProject ((ProjectReference)List[index]);
List[index] = value;
- if (project != null) project.NotifyReferenceAddedToProject (value);
}
}
@@ -62,9 +60,7 @@
/// </returns>
/// <seealso cref='.ProjectReferenceCollection.AddRange'/>
public int Add(ProjectReference value) {
- int i = List.Add(value);
- if (project != null) project.NotifyReferenceAddedToProject (value);
- return i;
+ return List.Add(value);
}
/// <summary>
@@ -155,7 +151,6 @@
/// <seealso cref='.ProjectReferenceCollection.Add'/>
public void Insert(int index, ProjectReference value) {
List.Insert(index, value);
- if (project != null) project.NotifyReferenceAddedToProject (value);
}
/// <summary>
@@ -175,11 +170,41 @@
/// <param name='value'>The <see cref='.ProjectReference'/> to remove from the <see cref='.ProjectReferenceCollection'/> .</param>
/// <returns><para>None.</para></returns>
/// <exception cref='System.ArgumentException'><paramref name='value'/> is not found in the Collection. </exception>
- public void Remove(ProjectReference value) {
+ public void Remove (ProjectReference value) {
List.Remove(value);
- if (project != null) project.NotifyReferenceRemovedFromProject (value);
}
+
+ protected override void OnClear()
+ {
+ if (project != null) {
+ ArrayList list = (ArrayList) InnerList.Clone ();
+ InnerList.Clear ();
+ foreach (ProjectReference pref in list)
+ project.NotifyReferenceRemovedFromProject (pref);
+ }
+ }
+
+ protected override void OnInsertComplete(int index, object value)
+ {
+ if (project != null) project.NotifyReferenceAddedToProject ((ProjectReference)value);
+ }
+
+ protected override void OnRemoveComplete(int index, object value)
+ {
+ if (project != null) project.NotifyReferenceRemovedFromProject ((ProjectReference) value);
+ }
+
+ protected override void OnSet (int index, object oldValue, object newValue)
+ {
+ if (project != null) project.NotifyReferenceRemovedFromProject ((ProjectReference) oldValue);
+ }
+
+ protected override void OnSetComplete (int index, object oldValue, object newValue)
+ {
+ if (project != null) project.NotifyReferenceAddedToProject ((ProjectReference) newValue);
+ }
+
public class ProjectReferenceEnumerator : object, IEnumerator {
private IEnumerator baseEnumerator;
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Project.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Project.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/Project.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -146,14 +146,9 @@
public ProjectFile GetProjectFile (string fileName)
{
- if (fileName == null) return null;
- foreach (ProjectFile file in ProjectFiles) {
- if (file.Name == fileName)
- return file;
- }
- return null;
+ return ProjectFiles.GetFile (fileName);
}
-
+
public virtual bool IsCompileable (string fileName)
{
return false;
@@ -507,6 +502,11 @@
OnFileAddedToProject (new ProjectFileEventArgs (this, file));
}
+ internal void NotifyFileRenamedInProject (ProjectFileRenamedEventArgs args)
+ {
+ OnFileRenamedInProject (args);
+ }
+
internal void NotifyReferenceRemovedFromProject (ProjectReference reference)
{
OnReferenceRemovedFromProject (new ProjectReferenceEventArgs (this, reference));
@@ -552,10 +552,17 @@
}
}
+ protected virtual void OnFileRenamedInProject (ProjectFileRenamedEventArgs e)
+ {
+ if (FileRenamedInProject != null) {
+ FileRenamedInProject (this, e);
+ }
+ }
public event ProjectFileEventHandler FileRemovedFromProject;
public event ProjectFileEventHandler FileAddedToProject;
public event ProjectFileEventHandler FileChangedInProject;
+ public event ProjectFileRenamedEventHandler FileRenamedInProject;
public event ProjectReferenceEventHandler ReferenceRemovedFromProject;
public event ProjectReferenceEventHandler ReferenceAddedToProject;
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectFile.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectFile.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectFile.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -88,9 +88,10 @@
}
set {
Debug.Assert (value != null && value.Length > 0, "name == null || name.Length == 0");
- if (project != null) project.NotifyFileRemovedFromProject (this);
+ string oldName = filename;
filename = value;
- if (project != null) project.NotifyFileAddedToProject (this);
+ if (project != null)
+ project.NotifyFileRenamedInProject (new ProjectFileRenamedEventArgs (project, this, oldName));
}
}
@@ -101,9 +102,18 @@
}
public string RelativePath {
- get { return filename; }
+ get {
+ if (project != null)
+ return project.GetRelativeChildPath (filename);
+ else
+ return filename;
+ }
}
+ public Project Project {
+ get { return project; }
+ }
+
[Browsable(false)]
public Subtype Subtype {
get {
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectFileEventArgs.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectFileEventArgs.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/ProjectFileEventArgs.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -35,4 +35,25 @@
this.file = file;
}
}
+
+ public delegate void ProjectFileRenamedEventHandler(object sender, ProjectFileRenamedEventArgs e);
+
+ public class ProjectFileRenamedEventArgs : ProjectFileEventArgs
+ {
+ string oldName;
+
+ public string OldName {
+ get { return oldName; }
+ }
+
+ public string NewName {
+ get { return ProjectFile.Name; }
+ }
+
+ public ProjectFileRenamedEventArgs (Project project, ProjectFile file, string oldName)
+ : base (project, file)
+ {
+ this.oldName = oldName;
+ }
+ }
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MenuService/MenuService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MenuService/MenuService.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MenuService/MenuService.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -62,6 +62,11 @@
CreateContextMenu(owner, addInTreePath).Popup(null, null, null, IntPtr.Zero, 0, Gtk.Global.CurrentEventTime);
}
+ public void ShowContextMenu (Gtk.Menu menu)
+ {
+ menu.Popup (null, null, null, IntPtr.Zero, 0, Gtk.Global.CurrentEventTime);
+ }
+
class QuickInsertMenuHandler
{
Gtk.Editable targetControl;
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/ClassInformationEventHandler.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/ClassInformationEventHandler.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/ClassInformationEventHandler.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -24,6 +24,7 @@
public class ClassInformationEventArgs : EventArgs
{
string fileName;
+ Project project;
ClassUpdateInformation classInformation;
public string FileName {
@@ -38,9 +39,14 @@
}
}
- public ClassInformationEventArgs(string fileName, ClassUpdateInformation classInformation)
+ public Project Project {
+ get { return project; }
+ }
+
+ public ClassInformationEventArgs(string fileName, ClassUpdateInformation classInformation, Project project)
{
- this.fileName = fileName;
+ this.project = project;
+ this.fileName = fileName;
this.classInformation = classInformation;
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -579,6 +579,21 @@
}
}
+ public void GetClassList (ArrayList list, string subNameSpace, bool caseSensitive)
+ {
+ lock (rwlock)
+ {
+ string[] path = subNameSpace.Split ('.');
+ NamespaceEntry tns = GetNamespaceEntry (path, path.Length, false, caseSensitive);
+ if (tns == null) return;
+
+ foreach (DictionaryEntry en in tns.Contents) {
+ if (en.Value is ClassEntry && !list.Contains (en.Key))
+ list.Add (en.Key);
+ }
+ }
+ }
+
public void GetNamespaceList (ArrayList list, string subNameSpace, bool caseSensitive)
{
lock (rwlock)
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -671,7 +671,7 @@
if (viewContent.Project != null) {
ProjectCodeCompletionDatabase db = GetProjectDatabase (viewContent.Project);
ClassUpdateInformation res = db.UpdateFromParseInfo (parseInformation, fileName);
- if (res != null) NotifyParseInfoChange (fileName, res);
+ if (res != null) NotifyParseInfoChange (fileName, res, viewContent.Project);
}
else {
SimpleCodeCompletionDatabase db = GetSingleFileDatabase (fileName);
@@ -780,28 +780,60 @@
return null;
}
+ public string[] GetClassList (Project project, string subNameSpace, bool includeReferences)
+ {
+ return GetClassList (project, subNameSpace, includeReferences, true);
+ }
+
+ public string[] GetClassList (Project project, string subNameSpace, bool includeReferences, bool caseSensitive)
+ {
+ ArrayList contents = new ArrayList ();
+
+ CodeCompletionDatabase db = (project != null) ? GetProjectDatabase (project) : GetActiveFileDatabase ();
+ if (db != null) {
+ db.GetClassList (contents, subNameSpace, caseSensitive);
+ if (includeReferences) {
+ foreach (ReferenceEntry re in db.References) {
+ CodeCompletionDatabase cdb = GetDatabase (re.Uri);
+ if (cdb == null) continue;
+ cdb.GetClassList (contents, subNameSpace, caseSensitive);
+ }
+ }
+ }
+
+ if (includeReferences) {
+ db = GetDatabase (CoreDB);
+ db.GetClassList (contents, subNameSpace, caseSensitive);
+ }
+
+ return (string[]) contents.ToArray (typeof(string));
+ }
+
public string[] GetNamespaceList (Project project, string subNameSpace)
{
- return GetNamespaceList (project, subNameSpace, true);
+ return GetNamespaceList (project, subNameSpace, true, true);
}
- public string[] GetNamespaceList (Project project, string subNameSpace, bool caseSensitive)
+ public string[] GetNamespaceList (Project project, string subNameSpace, bool includeReferences, bool caseSensitive)
{
ArrayList contents = new ArrayList ();
CodeCompletionDatabase db = (project != null) ? GetProjectDatabase (project) : GetActiveFileDatabase ();
if (db != null) {
db.GetNamespaceList (contents, subNameSpace, caseSensitive);
- foreach (ReferenceEntry re in db.References)
- {
- CodeCompletionDatabase cdb = GetDatabase (re.Uri);
- if (cdb == null) continue;
- cdb.GetNamespaceList (contents, subNameSpace, caseSensitive);
+ if (includeReferences) {
+ foreach (ReferenceEntry re in db.References) {
+ CodeCompletionDatabase cdb = GetDatabase (re.Uri);
+ if (cdb == null) continue;
+ cdb.GetNamespaceList (contents, subNameSpace, caseSensitive);
+ }
}
}
- db = GetDatabase (CoreDB);
- db.GetNamespaceList (contents, subNameSpace, caseSensitive);
+ if (includeReferences) {
+ db = GetDatabase (CoreDB);
+ db.GetNamespaceList (contents, subNameSpace, caseSensitive);
+ }
return (string[]) contents.ToArray (typeof(string));
}
@@ -1233,9 +1265,9 @@
}
}
- public void NotifyParseInfoChange (string file, ClassUpdateInformation res)
+ public void NotifyParseInfoChange (string file, ClassUpdateInformation res, Project project)
{
- ClassInformationEventArgs args = new ClassInformationEventArgs (file, res);
+ ClassInformationEventArgs args = new ClassInformationEventArgs (file, res, project);
OnClassInformationChanged (args);
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/IParserService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/IParserService.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/IParserService.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -49,6 +49,7 @@
// Default Parser Layer dependent functions
IClass GetClass(Project project, string typeName);
+ string[] GetClassList (Project project, string subNameSpace, bool includeReferences);
string[] GetNamespaceList(Project project, string subNameSpace);
ArrayList GetNamespaceContents(Project project, string subNameSpace, bool includeReferences);
bool NamespaceExists(Project project, string name);
@@ -56,7 +57,8 @@
IClass SearchType(Project project, IUsing iusing, string partitialTypeName);
IClass GetClass(Project project, string typeName, bool deepSearchReferences, bool caseSensitive);
- string[] GetNamespaceList(Project project, string subNameSpace, bool caseSensitive);
+ string[] GetClassList (Project project, string subNameSpace, bool includeReferences, bool caseSensitive);
+ string[] GetNamespaceList(Project project, string subNameSpace, bool includeReferences, bool caseSensitive);
ArrayList GetNamespaceContents(Project project, string subNameSpace, bool includeReferences, bool caseSensitive);
bool NamespaceExists(Project project, string name, bool caseSensitive);
string SearchNamespace(Project project, IUsing iusing, string partitialNamespaceName, bool caseSensitive);
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/ProjectCodeCompletionDatabase.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/ProjectCodeCompletionDatabase.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/ProjectCodeCompletionDatabase.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -56,6 +56,7 @@
project.FileChangedInProject += new ProjectFileEventHandler (OnFileChanged);
project.FileAddedToProject += new ProjectFileEventHandler (OnFileAdded);
project.FileRemovedFromProject += new ProjectFileEventHandler (OnFileRemoved);
+ project.FileRenamedInProject += new ProjectFileRenamedEventHandler (OnFileRenamed);
}
public override void Dispose ()
@@ -63,6 +64,7 @@
project.FileChangedInProject -= new ProjectFileEventHandler (OnFileChanged);
project.FileAddedToProject -= new ProjectFileEventHandler (OnFileAdded);
project.FileRemovedFromProject -= new ProjectFileEventHandler (OnFileRemoved);
+ project.FileRenamedInProject -= new ProjectFileRenamedEventHandler (OnFileRenamed);
}
public override void CheckModifiedFiles ()
@@ -93,6 +95,14 @@
RemoveFile (args.ProjectFile.Name);
}
+ void OnFileRenamed (object sender, ProjectFileRenamedEventArgs args)
+ {
+ if (args.ProjectFile.BuildAction == BuildAction.Compile) {
+ RemoveFile (args.OldName);
+ AddFile (args.NewName);
+ }
+ }
+
public void UpdateFromProject ()
{
Hashtable fs = new Hashtable ();
@@ -147,7 +157,7 @@
IParseInformation parserInfo = parserService.DoParseFile ((string)fileName, null);
if (parserInfo != null) {
ClassUpdateInformation res = UpdateFromParseInfo (parserInfo, fileName);
- if (res != null) parserService.NotifyParseInfoChange (fileName, res);
+ if (res != null) parserService.NotifyParseInfoChange (fileName, res, project);
}
} finally {
if (monitor != null) monitor.EndTask ();
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/IProjectService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/IProjectService.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/IProjectService.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -156,6 +156,7 @@
/// </remarks>
event ProjectFileEventHandler FileRemovedFromProject;
event ProjectFileEventHandler FileAddedToProject;
+ event ProjectFileRenamedEventHandler FileRenamedInProject;
/// <remarks>
/// Is called, when a file in the project is changed on disk.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/ProjectService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/ProjectService.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/ProjectService.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -262,14 +262,16 @@
openCombine.FileAddedToProject += new ProjectFileEventHandler (NotifyFileAddedToProject);
openCombine.FileRemovedFromProject += new ProjectFileEventHandler (NotifyFileRemovedFromProject);
+ openCombine.FileRenamedInProject += new ProjectFileRenamedEventHandler (NotifyFileRenamedInProject);
openCombine.FileChangedInProject += new ProjectFileEventHandler (NotifyFileChangedInProject);
openCombine.ReferenceAddedToProject += new ProjectReferenceEventHandler (NotifyReferenceAddedToProject);
openCombine.ReferenceRemovedFromProject += new ProjectReferenceEventHandler (NotifyReferenceRemovedFromProject);
+ OnCombineOpened(new CombineEventArgs(openCombine));
+
RestoreCombinePreferences (CurrentOpenCombine);
SaveCombine ();
monitor.ReportSuccess (GettextCatalog.GetString ("Combine loaded."));
- OnCombineOpened(new CombineEventArgs(openCombine));
} catch (Exception ex) {
monitor.ReportError ("Load operation failed.", ex);
} finally {
@@ -860,19 +862,24 @@
OnFileAddedToProject (e);
}
+ internal void NotifyFileRenamedInProject (object sender, ProjectFileRenamedEventArgs e)
+ {
+ OnFileRenamedInProject (e);
+ }
+
internal void NotifyFileChangedInProject (object sender, ProjectFileEventArgs e)
{
- OnFileChangedInProject (e);
+ OnFileChangedInProject (e);
}
internal void NotifyReferenceAddedToProject (object sender, ProjectReferenceEventArgs e)
{
- OnReferenceRemovedFromProject (e);
+ OnReferenceAddedToProject (e);
}
internal void NotifyReferenceRemovedFromProject (object sender, ProjectReferenceEventArgs e)
{
- OnReferenceAddedToProject (e);
+ OnReferenceRemovedFromProject (e);
}
protected virtual void OnFileRemovedFromProject (ProjectFileEventArgs e)
@@ -889,6 +896,13 @@
}
}
+ protected virtual void OnFileRenamedInProject (ProjectFileRenamedEventArgs e)
+ {
+ if (FileRenamedInProject != null) {
+ FileRenamedInProject (this, e);
+ }
+ }
+
protected virtual void OnFileChangedInProject (ProjectFileEventArgs e)
{
if (FileChangedInProject != null) {
@@ -913,6 +927,7 @@
public event ProjectFileEventHandler FileRemovedFromProject;
public event ProjectFileEventHandler FileAddedToProject;
public event ProjectFileEventHandler FileChangedInProject;
+ public event ProjectFileRenamedEventHandler FileRenamedInProject;
public event EventHandler StartBuild;
public event ProjectCompileEventHandler EndBuild;
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/OutputProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/OutputProgressMonitor.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/OutputProgressMonitor.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -16,11 +16,12 @@
using MonoDevelop.Core.Properties;
using MonoDevelop.Core.Services;
using MonoDevelop.Gui;
+using MonoDevelop.Gui.Pads;
using Gtk;
using Pango;
-namespace MonoDevelop.EditorBindings.Gui.Pads
+namespace MonoDevelop.Services
{
public class OutputProgressMonitor : BaseProgressMonitor
{
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/TaskService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/TaskService.cs 2005-03-07 19:56:33 UTC (rev 2306)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/TaskService.cs 2005-03-07 20:00:42 UTC (rev 2307)
@@ -12,7 +12,6 @@
using MonoDevelop.Gui;
using MonoDevelop.Gui.Pads;
using MonoDevelop.Internal.Project;
-using MonoDevelop.EditorBindings.Gui.Pads;
namespace MonoDevelop.Services
{
@@ -86,13 +85,14 @@
}
}
- DefaultMonitorPad defMonitor = new DefaultMonitorPad (title, icon);
- defMonitor.Id = (monitorId++).ToString ();
- Runtime.Gui.Workbench.ShowPad (defMonitor);
- if (bringToFront) defMonitor.BringToFront ();
- return new OutputProgressMonitor (defMonitor, title, icon);
+ DefaultMonitorPad monitorPad = new DefaultMonitorPad (title, icon);
+ monitorPad.Id = "OutputPad" + (monitorId++);
+ Runtime.Gui.Workbench.ShowPad (monitorPad);
+ if (bringToFront) monitorPad.BringToFront ();
+
+ return new OutputProgressMonitor (monitorPad, title, icon);
}
-
+
internal void ReleasePad (DefaultMonitorPad pad)
{
lock (outputMonitors) {
More information about the Monodevelop-patches-list
mailing list