[niftyplugins commit] r67 - - Some minor cleanup

0 views
Skip to first unread message

codesite...@google.com

unread,
Apr 24, 2009, 3:42:07 AM4/24/09
to niftyplug...@googlegroups.com
Author: jim.tilander
Date: Fri Apr 24 00:40:16 2009
New Revision: 67

Added:
trunk/NiftyPerforce/EventHandlers/FindEvents.cs
trunk/NiftyPerforce/EventHandlers/PreCommandEvent.cs
Modified:
trunk/NiftyPerforce/Commands/ItemCommandBase.cs
trunk/NiftyPerforce/Commands/NiftyConfigure.cs
trunk/NiftyPerforce/Commands/P4DiffItem.cs
trunk/NiftyPerforce/Commands/P4DiffSolution.cs
trunk/NiftyPerforce/Commands/P4EditItem.cs
trunk/NiftyPerforce/Commands/P4EditModified.cs
trunk/NiftyPerforce/Commands/P4EditSolution.cs
trunk/NiftyPerforce/Commands/P4RenameItem.cs
trunk/NiftyPerforce/Commands/P4RevertItem.cs
trunk/NiftyPerforce/Commands/P4RevisionHistoryItem.cs
trunk/NiftyPerforce/Commands/P4RevisionHistorySolution.cs
trunk/NiftyPerforce/Commands/P4TimeLapseItem.cs
trunk/NiftyPerforce/Config.cs
trunk/NiftyPerforce/ConfigDialog.cs
trunk/NiftyPerforce/Connect.cs
trunk/NiftyPerforce/EventHandlers/AutoAddDelete.cs
trunk/NiftyPerforce/EventHandlers/AutoCheckout.cs
trunk/NiftyPerforce/NiftyPerforce.csproj
trunk/NiftyPerforce/P4Operations.cs
trunk/NiftyPerforce/RegistrySettingsProvider.cs
trunk/NiftySolution/Commands/CloseToolWindows.cs
trunk/NiftySolution/Commands/Configure.cs
trunk/NiftySolution/Commands/QuickOpen.cs
trunk/NiftySolution/Commands/ToggleFile.cs
trunk/NiftySolution/Connect.cs
trunk/NiftySolution/EventHandlers/SolutionBuildTimings.cs
trunk/NiftySolution/SearchEntry.cs
trunk/NiftySolution/SolutionFiles.cs
trunk/NiftySolution/UI/ConfigDialog.cs
trunk/NiftySolution/UI/QuickOpenDialog.cs
trunk/NiftySolution/UI/SearchResultControl.cs
trunk/Shared/CommandBase.cs
trunk/Shared/CommandRegistry.cs
trunk/Shared/DebugLogHandler.cs
trunk/Shared/EventRegistry.cs
trunk/Shared/Log.cs
trunk/Shared/Plugin.cs
trunk/Shared/Process.cs
trunk/Shared/Singleton.cs
trunk/Shared/VisualStudioLogHandler.cs

Log:
- Some minor cleanup
- Added auto project checkout.


Modified: trunk/NiftyPerforce/Commands/ItemCommandBase.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/ItemCommandBase.cs (original)
+++ trunk/NiftyPerforce/Commands/ItemCommandBase.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Commands/NiftyConfigure.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/NiftyConfigure.cs (original)
+++ trunk/NiftyPerforce/Commands/NiftyConfigure.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Commands/P4DiffItem.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4DiffItem.cs (original)
+++ trunk/NiftyPerforce/Commands/P4DiffItem.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Commands/P4DiffSolution.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4DiffSolution.cs (original)
+++ trunk/NiftyPerforce/Commands/P4DiffSolution.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Commands/P4EditItem.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4EditItem.cs (original)
+++ trunk/NiftyPerforce/Commands/P4EditItem.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Commands/P4EditModified.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4EditModified.cs (original)
+++ trunk/NiftyPerforce/Commands/P4EditModified.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;
@@ -13,8 +13,6 @@
: base("EditModified", plugin, "Opens all the currently modifed files
for edit")
{
}
-
- //override public int IconIndex { get { return 5; } }

public override bool OnCommand()
{

Modified: trunk/NiftyPerforce/Commands/P4EditSolution.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4EditSolution.cs (original)
+++ trunk/NiftyPerforce/Commands/P4EditSolution.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Commands/P4RenameItem.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4RenameItem.cs (original)
+++ trunk/NiftyPerforce/Commands/P4RenameItem.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Commands/P4RevertItem.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4RevertItem.cs (original)
+++ trunk/NiftyPerforce/Commands/P4RevertItem.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Windows.Forms;
using EnvDTE;

Modified: trunk/NiftyPerforce/Commands/P4RevisionHistoryItem.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4RevisionHistoryItem.cs (original)
+++ trunk/NiftyPerforce/Commands/P4RevisionHistoryItem.cs Fri Apr 24
00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Commands/P4RevisionHistorySolution.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4RevisionHistorySolution.cs (original)
+++ trunk/NiftyPerforce/Commands/P4RevisionHistorySolution.cs Fri Apr 24
00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Commands/P4TimeLapseItem.cs
==============================================================================
--- trunk/NiftyPerforce/Commands/P4TimeLapseItem.cs (original)
+++ trunk/NiftyPerforce/Commands/P4TimeLapseItem.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftyPerforce/Config.cs
==============================================================================
--- trunk/NiftyPerforce/Config.cs (original)
+++ trunk/NiftyPerforce/Config.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.Text;
@@ -15,6 +15,7 @@
private bool mDirty = false;
private bool mEnableBindings = false;
private bool m_autoCheckout = false;
+ private bool m_autoCheckoutProject = false;
private bool m_autoCheckoutOnSave = false;
private bool m_autoAdd = true;
private bool m_autoDelete = false;
@@ -58,6 +59,13 @@
set { m_autoCheckout = value; mDirty = true; }
}

+ [Category("Operation"), Description("Automatically check out projects
on edit properties")]
+ public bool autoCheckoutProject
+ {
+ get { return m_autoCheckoutProject; }
+ set { m_autoCheckoutProject = value; mDirty = true; }
+ }
+
[Category("Operation"), Description("Controls if we automagically check
out files from perforce before saving")]
public bool autoCheckoutOnSave
{
@@ -107,39 +115,6 @@
set { m_username = value; mDirty = true; }
}

- public Config()
- {
- /*m_autoCheckout =
bool.Parse(RegistrySettingsProvider.GetPropertyValue("autoCheckout",
m_autoCheckout.ToString()));
- m_autoCheckoutOnSave =
bool.Parse(RegistrySettingsProvider.GetPropertyValue("autoCheckoutOnSave",
m_autoCheckoutOnSave.ToString()));
- m_autoAdd =
bool.Parse(RegistrySettingsProvider.GetPropertyValue("autoAdd",
m_autoAdd.ToString()));
- m_autoDelete =
bool.Parse(RegistrySettingsProvider.GetPropertyValue("autoDelete",
m_autoDelete.ToString()));
- m_useSystemConnection =
bool.Parse(RegistrySettingsProvider.GetPropertyValue("useSystemConnection",
m_useSystemConnection.ToString()));
- m_port = RegistrySettingsProvider.GetPropertyValue("port", "");
- m_client = RegistrySettingsProvider.GetPropertyValue("client", "");
- m_username = RegistrySettingsProvider.GetPropertyValue("username", "");
- * */
- }
-
- public void ShowDialog()
- {
- /*ConfigDialog dlg = new ConfigDialog();
- dlg.propertyGrid1.SelectedObject = this;
- dlg.ShowDialog();
-
- if (dlg.wasCancelled)
- return;
-
- RegistrySettingsProvider.SetPropertyValue("autoCheckout",
m_autoCheckout.ToString());
- RegistrySettingsProvider.SetPropertyValue("autoCheckoutOnSave",
m_autoCheckoutOnSave.ToString());
- RegistrySettingsProvider.SetPropertyValue("autoAdd",
m_autoAdd.ToString());
- RegistrySettingsProvider.SetPropertyValue("autoDelete",
m_autoDelete.ToString());
- RegistrySettingsProvider.SetPropertyValue("useSystemConnection",
m_useSystemConnection.ToString());
- RegistrySettingsProvider.SetPropertyValue("port", m_port);
- RegistrySettingsProvider.SetPropertyValue("client", m_client);
- RegistrySettingsProvider.SetPropertyValue("username", m_username);
- * */
- }
-
public static Config Load(string filename)
{
Config o;
@@ -152,6 +127,7 @@
o = new Config();
}
o.mFileName = filename;
+ Singleton<Config>.Instance = o;
return o;
}

@@ -161,6 +137,7 @@
{
File.SaveXML<Config>(mFileName, this);
mDirty = false;
+ Singleton<Config>.Instance = this;
}
}
}

Modified: trunk/NiftyPerforce/ConfigDialog.cs
==============================================================================
--- trunk/NiftyPerforce/ConfigDialog.cs (original)
+++ trunk/NiftyPerforce/ConfigDialog.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.ComponentModel;

Modified: trunk/NiftyPerforce/Connect.cs
==============================================================================
Binary files. No diff available.

Modified: trunk/NiftyPerforce/EventHandlers/AutoAddDelete.cs
==============================================================================
--- trunk/NiftyPerforce/EventHandlers/AutoAddDelete.cs (original)
+++ trunk/NiftyPerforce/EventHandlers/AutoAddDelete.cs Fri Apr 24 00:40:16
2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.IO;
using EnvDTE;

Modified: trunk/NiftyPerforce/EventHandlers/AutoCheckout.cs
==============================================================================
--- trunk/NiftyPerforce/EventHandlers/AutoCheckout.cs (original)
+++ trunk/NiftyPerforce/EventHandlers/AutoCheckout.cs Fri Apr 24 00:40:16
2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.IO;
using Extensibility;
@@ -19,14 +19,18 @@
// File.SaveAll
const string saveAllGuid = "{5EFC7975-14BC-11CF-9B2B-00AA00573819}";
const int saveAllID = 0xe0;
+
private OutputWindowPane m_outputPane;
private DTE2 m_application;
private EnvDTE.CommandEvents m_saveSelected;
private EnvDTE.CommandEvents m_saveAll;
+
private EnvDTE80.TextDocumentKeyPressEvents m_events;
private EnvDTE.TextEditorEvents m_editorEvents;
private Plugin m_plugin;

+ private CommandEvents mEditSelectedProjectsEvent;
+
public AutoCheckout(DTE2 application, OutputWindowPane outputPane,
Plugin plugin)
{
m_plugin = plugin;
@@ -44,6 +48,15 @@

m_editorEvents =
((EnvDTE80.Events2)m_application.Events).get_TextEditorEvents(null);
m_editorEvents.LineChanged += new
_dispTextEditorEvents_LineChangedEventHandler(OnLineChanged);
+
+
+ if(Singleton<Config>.Instance.autoCheckoutProject)
+ {
+ mEditSelectedProjectsEvent =
m_plugin.FindCommandEvents("ClassViewContextMenus.ClassViewProject.Properties");
+
+ if(null != mEditSelectedProjectsEvent)
+ mEditSelectedProjectsEvent.BeforeExecute +=
OnEditSelectedProjectProperties;
+ }
}

void OnSaveSelected(string Guid, int ID, object CustomIn, object
CustomOut, ref bool CancelDefault)
@@ -75,6 +88,24 @@

foreach (Project p in m_application.Solution.Projects)
tryEditProjectRecursive(p);
+ }
+
+ void OnBuildSolution(string Guid, int ID, object CustomIn, object
CustomOut, ref bool CancelDefault)
+ {
+ foreach(Document doc in m_application.Documents)
+ {
+ if(!doc.Saved && doc.ReadOnly)
+ P4Operations.EditFile(m_plugin.OutputPane, doc.FullName);
+ }
+ }
+
+ void OnEditSelectedProjectProperties(string Guid, int ID, object
CustomIn, object CustomOut, ref bool CancelDefault)
+ {
+ foreach(Project project in (Array)m_application.ActiveSolutionProjects)
+ {
+ string path = project.FullName;
+ tryEditFile(path);
+ }
}

void tryEditFile(string sFileName)

Added: trunk/NiftyPerforce/EventHandlers/FindEvents.cs
==============================================================================
--- (empty file)
+++ trunk/NiftyPerforce/EventHandlers/FindEvents.cs Fri Apr 24 00:40:16 2009
@@ -0,0 +1,41 @@
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
+using System;
+using System.IO;
+using EnvDTE;
+using EnvDTE80;
+
+namespace Aurora
+{
+ namespace NiftyPerforce
+ {
+ class FindEvents
+ {
+ private Plugin mPlugin;
+ private CommandEvents mCommandEvents;
+
+ public FindEvents(Plugin plugin)
+ {
+ mPlugin = plugin;
+ mCommandEvents = mPlugin.App.DTE.Events.get_CommandEvents(null, 0);
+ mCommandEvents.BeforeExecute += BeforeCommandExecute;
+ }
+
+ void BeforeCommandExecute(string Guid, int ID, object CustomIn, object
CustomOut, ref bool CancelDefault)
+ {
+ try
+ {
+ Command command = mPlugin.App.DTE.Commands.Item(Guid, ID);
+ if(command == null)
+ return;
+
+ string commandName = command.Name.Length > 0 ?
command.Name : "<unnamed>";
+
+ Log.Info("Command: {0} (GUID: {1}, ID: {2})", commandName, Guid, ID);
+ }
+ catch
+ {
+ }
+ }
+ }
+ }
+}

Added: trunk/NiftyPerforce/EventHandlers/PreCommandEvent.cs
==============================================================================
--- (empty file)
+++ trunk/NiftyPerforce/EventHandlers/PreCommandEvent.cs Fri Apr 24
00:40:16 2009
@@ -0,0 +1,56 @@
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
+using System;
+using System.IO;
+using EnvDTE;
+using EnvDTE80;
+using System.Collections.Generic;
+
+namespace Aurora
+{
+ namespace NiftyPerforce
+ {
+ public class Dispatcher
+ {
+ CommandBase mCommand;
+
+ public Dispatcher(CommandBase command)
+ {
+ mCommand = command;
+ }
+
+ public void BeforeCommandExecute(string Guid, int ID, object CustomIn,
object CustomOut, ref bool CancelDefault)
+ {
+ mCommand.OnCommand();
+ }
+ };
+
+ public class PreCommandEvent
+ {
+ private Plugin mPlugin;
+ private List<CommandEvents> mCommandHandlers = new
List<CommandEvents>();
+ private List<Dispatcher> mDispatchers = new List<Dispatcher>();
+
+ public PreCommandEvent(Plugin plugin)
+ {
+ mPlugin = plugin;
+ }
+
+ public bool RegisterHandler(string commandName, CommandBase command)
+ {
+ CommandEvents events = mPlugin.FindCommandEvents(commandName);
+ if(null == events)
+ return false;
+
+ Dispatcher dispatcher = new Dispatcher(command);
+ events.BeforeExecute += dispatcher.BeforeCommandExecute;
+
+ if(mCommandHandlers.Contains(events))
+ return false;
+
+ mCommandHandlers.Add(events);
+ mDispatchers.Add(dispatcher);
+ return true;
+ }
+ }
+ }
+}

Modified: trunk/NiftyPerforce/NiftyPerforce.csproj
==============================================================================
--- trunk/NiftyPerforce/NiftyPerforce.csproj (original)
+++ trunk/NiftyPerforce/NiftyPerforce.csproj Fri Apr 24 00:40:16 2009
@@ -53,7 +53,6 @@
<Compile Include="EventHandlers\AutoAddDelete.cs" />
<Compile Include="EventHandlers\AutoCheckout.cs" />
<Compile Include="Commands\NiftyConfigure.cs" />
- <Compile Include="Commands\ToolbarCommand.cs" />
<Compile Include="Commands\P4EditItem.cs" />
<Compile Include="Commands\P4EditModified.cs" />
<Compile Include="Commands\P4EditSolution.cs" />
@@ -68,6 +67,8 @@
<Compile Include="Connect.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="EventHandlers\FindEvents.cs" />
+ <Compile Include="EventHandlers\PreCommandEvent.cs" />
<Compile Include="P4Operations.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>

Modified: trunk/NiftyPerforce/P4Operations.cs
==============================================================================
--- trunk/NiftyPerforce/P4Operations.cs (original)
+++ trunk/NiftyPerforce/P4Operations.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using System.Threading;

Modified: trunk/NiftyPerforce/RegistrySettingsProvider.cs
==============================================================================
--- trunk/NiftyPerforce/RegistrySettingsProvider.cs (original)
+++ trunk/NiftyPerforce/RegistrySettingsProvider.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using Microsoft.Win32;


Modified: trunk/NiftySolution/Commands/CloseToolWindows.cs
==============================================================================
--- trunk/NiftySolution/Commands/CloseToolWindows.cs (original)
+++ trunk/NiftySolution/Commands/CloseToolWindows.cs Fri Apr 24 00:40:16
2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.IO;

Modified: trunk/NiftySolution/Commands/Configure.cs
==============================================================================
--- trunk/NiftySolution/Commands/Configure.cs (original)
+++ trunk/NiftySolution/Commands/Configure.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.IO;

Modified: trunk/NiftySolution/Commands/QuickOpen.cs
==============================================================================
--- trunk/NiftySolution/Commands/QuickOpen.cs (original)
+++ trunk/NiftySolution/Commands/QuickOpen.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftySolution/Commands/ToggleFile.cs
==============================================================================
--- trunk/NiftySolution/Commands/ToggleFile.cs (original)
+++ trunk/NiftySolution/Commands/ToggleFile.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.IO;

Modified: trunk/NiftySolution/Connect.cs
==============================================================================
Binary files. No diff available.

Modified: trunk/NiftySolution/EventHandlers/SolutionBuildTimings.cs
==============================================================================
--- trunk/NiftySolution/EventHandlers/SolutionBuildTimings.cs (original)
+++ trunk/NiftySolution/EventHandlers/SolutionBuildTimings.cs Fri Apr 24
00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/NiftySolution/SearchEntry.cs
==============================================================================
--- trunk/NiftySolution/SearchEntry.cs (original)
+++ trunk/NiftySolution/SearchEntry.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.Text;

Modified: trunk/NiftySolution/SolutionFiles.cs
==============================================================================
--- trunk/NiftySolution/SolutionFiles.cs (original)
+++ trunk/NiftySolution/SolutionFiles.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.Text;

Modified: trunk/NiftySolution/UI/ConfigDialog.cs
==============================================================================
--- trunk/NiftySolution/UI/ConfigDialog.cs (original)
+++ trunk/NiftySolution/UI/ConfigDialog.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.ComponentModel;

Modified: trunk/NiftySolution/UI/QuickOpenDialog.cs
==============================================================================
--- trunk/NiftySolution/UI/QuickOpenDialog.cs (original)
+++ trunk/NiftySolution/UI/QuickOpenDialog.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.ComponentModel;

Modified: trunk/NiftySolution/UI/SearchResultControl.cs
==============================================================================
--- trunk/NiftySolution/UI/SearchResultControl.cs (original)
+++ trunk/NiftySolution/UI/SearchResultControl.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.ComponentModel;

Modified: trunk/Shared/CommandBase.cs
==============================================================================
--- trunk/Shared/CommandBase.cs (original)
+++ trunk/Shared/CommandBase.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;
@@ -27,8 +27,6 @@
public virtual bool RegisterGUI(Command vsCommand, CommandBar
vsCommandbar, bool toolBarOnly)
{
// The default command is registered in the toolbar.
- // pluginCommandbar;
-
if(IconIndex >= 0 && toolBarOnly)
vsCommand.AddControl(vsCommandbar, vsCommandbar.Controls.Count + 1);


Modified: trunk/Shared/CommandRegistry.cs
==============================================================================
--- trunk/Shared/CommandRegistry.cs (original)
+++ trunk/Shared/CommandRegistry.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/Shared/DebugLogHandler.cs
==============================================================================
--- trunk/Shared/DebugLogHandler.cs (original)
+++ trunk/Shared/DebugLogHandler.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.Text;

Modified: trunk/Shared/EventRegistry.cs
==============================================================================
--- trunk/Shared/EventRegistry.cs (original)
+++ trunk/Shared/EventRegistry.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Modified: trunk/Shared/Log.cs
==============================================================================
--- trunk/Shared/Log.cs (original)
+++ trunk/Shared/Log.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using System.Collections.Generic;
using System.Text;

Modified: trunk/Shared/Plugin.cs
==============================================================================
--- trunk/Shared/Plugin.cs (original)
+++ trunk/Shared/Plugin.cs Fri Apr 24 00:40:16 2009
@@ -80,6 +80,21 @@
return false;
}

+ public CommandEvents FindCommandEvents(string commandName)
+ {
+ CommandEvents events = null;
+ try
+ {
+ Command command = App.DTE.Commands.Item(commandName, -1);
+ if(command != null)
+ events = App.DTE.Events.get_CommandEvents(command.Guid, command.ID);
+ }
+ catch
+ {
+ }
+ return events;
+ }
+
private Command GetCommand(string commandName)
{
Commands2 commands = (Commands2)m_application.Commands;
@@ -136,439 +151,6 @@
}

return bar;
- }
-
- public void AddPopupCommand(CommandBarPopup popup, string commandName,
string caption,
- string tooltip, int iconIndex, int insertIndex)
- {
- // Do not try to add commands to a null menu
- if(popup == null)
- return;
-
- // Get commands collection
- Commands2 commands = (Commands2)m_application.Commands;
- object[] contextGUIDS = new object[] { };
-
- // Add command
- Command command = GetCommand(commandName);
- if(command == null)
- {
- command = commands.AddNamedCommand2(m_addIn,
- commandName, caption, tooltip, false, iconIndex, ref contextGUIDS,
- (int)vsCommandStatus.vsCommandStatusSupported +
- (int)vsCommandStatus.vsCommandStatusEnabled,
- (int)vsCommandStyle.vsCommandStylePictAndText,
- vsCommandControlType.vsCommandControlTypeButton);
- }
- if(command != null && popup != null)
- {
- if(!HasCommand(popup.CommandBar, caption))
- command.AddControl(popup.CommandBar, insertIndex);
- }
- //AddKeyboardBinding(command, binding);
- }
-
- public void AddConsoleOnlyCommand(string commandName, string itemName,
string description)
- {
- object[] contextGuids = new object[] { };
- Commands2 commands = (Commands2)m_application.Commands;
- try
- {
- int commandStatus = (int)vsCommandStatus.vsCommandStatusSupported +
- (int)vsCommandStatus.vsCommandStatusEnabled;
-
- int commandStyle = (int)vsCommandStyle.vsCommandStyleText;
- vsCommandControlType controlType =
vsCommandControlType.vsCommandControlTypeButton;
-
- // TODO: [jt] I think the context guids here are the key to enable
commands on just a menu and not through the command line interface.
- Command command = commands.AddNamedCommand2(m_addIn,
- commandName,
- itemName,
- description,
- true,
- 59,
- ref contextGuids,
- commandStatus,
- commandStyle,
- controlType);
- //AddKeyboardBinding(command, binding);
- }
- catch(System.ArgumentException)
- {
- Log.Debug("Tried to register the command \"{0}\" twice!", commandName);
- }
- }
-
- public void AddToolbarCommand(CommandBar bar, string commandName, string
caption, string tooltip, int iconIndex, int insertIndex)
- {
- AddToolbarOrMenuCommand(bar, commandName, caption, tooltip, iconIndex,
insertIndex,
- vsCommandStyle.vsCommandStylePict);
- }
-
- public void AddMenuCommand(CommandBar bar, string commandName, string
caption,
- string tooltip, int iconIndex, int insertIndex)
- {
- AddToolbarOrMenuCommand(bar, commandName, caption, tooltip, iconIndex,
insertIndex,
- vsCommandStyle.vsCommandStylePictAndText);
- }
-
- private void AddToolbarOrMenuCommand(CommandBar bar, string commandName,
string caption,
- string tooltip, int iconIndex, int insertIndex, vsCommandStyle
commandStyle)
- {
- // Do not try to add commands to a null bar
- if(bar == null)
- return;
-
- // Get commands collection
- Commands2 commands = (Commands2)m_application.Commands;
- object[] contextGUIDS = new object[] { };
-
- // Add command
- Command command = GetCommand(commandName);
- if(command == null)
- {
- command = commands.AddNamedCommand2(m_addIn, commandName,
- caption, tooltip, false, iconIndex, ref contextGUIDS,
- (int)vsCommandStatus.vsCommandStatusSupported +
- (int)vsCommandStatus.vsCommandStatusEnabled,
- (int)commandStyle,
- vsCommandControlType.vsCommandControlTypeButton);
- }
- if(command != null && bar != null)
- {
- if(!HasCommand(bar, caption))
- command.AddControl(bar, insertIndex);
- }
- //AddKeyboardBinding(command, binding);
- }
-
- /*
- The toolbar name should be one of the following:
- MenuBar
- Standard
- Build
- XML Data
- XML Schema
- Context Menus
- Dialog Editor
- Image Editor
- Text Editor
- Source Control
- Formatting
- HTML Source Editing
- Style Sheet
- Device
- Layout
- Microsoft XML Editor
- Class Designer Toolbar
- Help
- Debug Location
- Debug
- Recorder
- Report Formatting
- Report Borders
- Data Design
- Query Designer
- View Designer
- Database Diagram
- Table Designer
- Project Node
- A&dd
- Cab Project Node
- A&dd
- File nodes
- Dep. file nodes
- Assembly nodes
- Dep. assembly nodes
- MSM nodes
- Dep. MSM nodes
- Output nodes
- Simple file nodes
- Simple output nodes
- Dependency node
- Multiple selections
- Dep. Multiple selections
- View
- Editor
- Error List
- Docked Window
- Menu Designer
- Properties Window
- Toolbox
- Task List
- Results List
- Stub Project
- No Commands Available
- Command Window
- AutoHidden Windows
- Expansion Manager
- Find Regular Expression Builder
- Replace Regular Expression Builder
- Wild Card Expression Builder
- Wild Card Expression Builder
- External Tools Arguments
- External Tools Directories
- Easy MDI Tool Window
- Easy MDI Document Window
- Easy MDI Dragging
- Open Drop Down
- Object Browser Objects Pane
- Object Browser Members Pane
- Object Browser Description Pane
- Find Symbol
- Drag and Drop
- Bookmark Window
- Error Correction
- EzMDI Files
- Ca&ll Browser
- Preview Changes
- Smart Tag
- Smart Tag
- Editor Context Menus
- Class View Context Menus
- Debugger Context Menus
- Project and Solution Context Menus
- Other Context Menus
- Sort By
- Show Columns
- Implement Interface
- Resolve
- Resolve
- Refactor
- Organize File
- Class View Project
- Class View Item
- Class View Folder
- Class View Grouping Folder
- Class View Multi-select
- Class View Multi-select members
- Class View Member
- Class View Grouping Members
- Class View Project References Folder
- Class View Project Reference
- Project
- Solution Folder
- Cross Project Solution Project
- Cross Project Solution Item
- Cross Project Project Item
- Cross Project Multi Project
- Cross Project Multi Item
- Cross Project Multi Solution Folder
- Cross Project Multi Project/Folder
- Item
- Folder
- Reference Root
- Reference Item
- Web Reference Folder
- App Designer Folder
- Web Project Folder
- Web Folder
- Web Item
- Web SubWeb
- Misc Files Project
- Solution
- Code Window
- Registry
- File System
- File System
- File Types
- User Interface
- Launch Conditions
- Custom Actions
- New
- Add
- Add Special Folder
- View
- Resource View
- Resource Editors
- Binary Editor
- Propertysheet
- Configuration
- Project
- Multi-Select
- System Propertysheet
- Checkin Dialog Context Menu
- Pending Checkin Window Context Menu
- Standard TreeGrid context menu
- GetVersion Dialog Context Menu
- Check Out Dialog Context Menu
- Context
- Basic Context
- Context
- Context
- Context
- Context
- Context
- Context
- HTML Context
- Script Context
- Context
- ASPX Context
- ASPX Code Context
- ASPX VB Code Context
- ASMX Code Context
- ASMX VB Code Context
- ASMX Context
- CSSDocOutline
- CSSSource
- Project Node
- A&dd
- Cab Project Node
- A&dd
- File nodes
- Dep. file nodes
- Assembly nodes
- Dep. assembly nodes
- MSM nodes
- Dep. MSM nodes
- Output nodes
- Dependency node
- Multiple selections
- Dep. Multiple selections
- View
- Registry
- File System
- File System
- New
- Add
- Add Special Folder
- View
- Selection
- Container
- TraySelection
- Document Outline
- Component Tray
- Exe Project
- Debug
- OTBObjCtxtMenu
- Class Designer Context Menu
- Class Diagram Context Menu
- TocContext
- ResListContext
- Editor
- Script Outline
- DefaultContext
- ImageContext
- SelectionContext
- AnchorContext
- Autos Window
- Breakpoint
- Breakpoints Window
- Call Stack Window
- Data Tip Window
- Disassembly Window
- Locals Window
- Memory Window
- Modules Window
- Output Window
- Processes Window
- Registers Window
- Threads Window
- Watch Window
- Server Explorer
- PropertyBrowser
- Macro
- Module
- Project
- Root
- Control
- Report
- Row/Column
- Cell
- Field Chooser
- Row/Column
- Chart
- Database Project
- DB Project Connection
- DB Project Folder
- Database References Folder
- Folders
- DB Project File
- Query
- Script
- Database Reference Node
- Files
- Multi-select
- Database Connection
- Folder Multi-Selection
- All Diagrams
- All Tables
- All Views
- All Stored Procedures
- All Package Specifications
- All Package Bodies
- All Synonyms
- All Databases
- All Users
- All Roles
- Node Multi-Selection
- Diagram
- Table
- View
- Stored Procedure
- Function
- Synonym
- Package Spec
- Package Body
- Trigger
- Column
- SQL Editor
- All Functions
- Oracle Function
- Oracle Procedure
- Change &View
- Single objet
- Single static
- Homogeneous objects
- Mixed objects
- Multiple static nodes
- Mixed nodes
- Add &New
- Add &New
- Surface
- DataSourceContext
- DbTableContext
- DataTableContext
- RelationContext
- FunctionContext
- ColumnContext
- QueryContext
- DataAccessorContext
- Query Diagram Pane
- Query Diagram Table
- Query Diagram Table Column
- Query Diagram Join Line
- Query Diagram Multi-select
- Query Grid Pane
- Query SQL Pane
- Query Results Pane
- Database Designer
- Database Designer Table
- Database Designer Relationship
- Text Annotation
- Class Details Context Menu
- TopicMenu
- TopicMenu
- Favorites Window Context Menu
- Data Sources
- Managed Resources Editor Context Menu
- Settings Designer
- System
- */
- public void AddToolbarCommand(string toolbarName, string commandName,
string caption,
- string tooltip, int iconIndex, int insertIndex)
- {
- CommandBar commandBar =
((CommandBars)m_application.CommandBars)[toolbarName];
- if(commandBar != null)
- AddToolbarCommand(commandBar, commandName, caption, tooltip,
iconIndex, insertIndex);
- }
-
- public void AddMenuCommand(string toolbarName, string commandName,
string caption,
- string tooltip, int iconIndex, int insertIndex)
- {
- CommandBar commandBar =
((CommandBars)m_application.CommandBars)[toolbarName];
- if(commandBar != null)
- AddMenuCommand(commandBar, commandName, caption, tooltip, iconIndex,
insertIndex);
}

private static OutputWindowPane AquireOutputPane(DTE2 app, string name)

Modified: trunk/Shared/Process.cs
==============================================================================
--- trunk/Shared/Process.cs (original)
+++ trunk/Shared/Process.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;

namespace Aurora

Modified: trunk/Shared/Singleton.cs
==============================================================================
--- trunk/Shared/Singleton.cs (original)
+++ trunk/Shared/Singleton.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;

namespace Aurora
@@ -6,6 +6,6 @@
public sealed class Singleton<T> where T : class, new()
{
private Singleton() {}
- public static readonly T Instance = new T();
+ public static T Instance = new T();
}
}

Modified: trunk/Shared/VisualStudioLogHandler.cs
==============================================================================
--- trunk/Shared/VisualStudioLogHandler.cs (original)
+++ trunk/Shared/VisualStudioLogHandler.cs Fri Apr 24 00:40:16 2009
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2008 Jim Tilander. See COPYING for and README for
more details.
+// Copyright (C) 2006-2009 Jim Tilander. See COPYING for and README for
more details.
using System;
using EnvDTE;
using EnvDTE80;

Reply all
Reply to author
Forward
0 new messages