[译]源代码控制切换器
By robot-v1.0
本文链接 https://www.kyfws.com/applications/sourcecode-control-switcher-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 4 分钟阅读 - 1778 个词 阅读量 0[译]源代码控制切换器
原文地址:https://www.codeproject.com/Articles/2264/Sourcecode-Control-Switcher
原文作者:Soenke Schau
译文由本站 robot-v1.0 翻译
前言
A tool to switch the Sourcecode Control Provider which is used in a development environment.
在开发环境中切换源代码控制提供程序的工具.
介绍(Introduction)
该工具提供了一个界面来选择所有已安装的SCC提供程序,而不仅仅是在SCC集成中使用默认提供程序.(This tool offers an interface to choose all installed SCC providers instead of just using the default provider in SCC integration.)
问题(Problem)
MS已为要与这些系统进行交互的应用程序定义了SCC系统之间的接口.该接口通过SCC提供程序提供的DLL公开.一个站点上可以安装多个SCC,但应将其中之一指定为默认SCC提供程序.大多数工具-例如VCx-仅支持此默认提供程序.其他诸如Kawa或VS.NET的应用程序可供您选择.如您所见,在人们经常在SCC提供程序之间切换的环境中,有些工具使用起来不舒服.您必须手动在注册表中切换SCC系统.(MS has defined an interface between SCC systems, for applications that want to interact with these systems. The interface is exposed through a DLL supplied by the SCC provider. More than one SCC can be installed at one site, but one of them should be specified as the default SCC provider. Most tools - e.g. VCx - support only this default provider. Others like Kawa or VS.NET let you choose the one to use. As you can see, some tools in environments where people frequently switch between SCC providers are uncomfortable to use. You have to switch the SCC systems in the registry by hand.)
解(Solution)
参加这个小程序!它具有三个目的:(Take this little program! It has three purposes:)
- 提供当前哪个SCC提供者处于活动状态的视觉线索(Give a visual clue to which SCC provider is currently active)
- 提供一个在SCC提供程序之间进行更改的接口(Provide an interface to change between SCC providers)
- 启动当前提供者的UI(Start the UI of the current provider)
部署方式(Deployment)
-
将程序复制到您喜欢的位置.(Copy the program to a location you like.)
-
启动它,它将自身添加到任务栏.(Start it, and it will add itself to the taskbar.)
-
用鼠标右键单击以显示菜单.(Click with the right mouse button to display the menu.)
-
选择您要使用的提供者.(Choose the provider you like to use.)记得(Remember):更改不会反映在正在运行的应用中.您必须重新启动它们才能获得新设置.(: the change will not be reflected in running apps. You must restart them to get the new setting.)
-
选择"启动SCC界面"或用鼠标左键双击以启动"当前"提供程序的用户界面.(Choose “Start SCC Interface” or double click with the left button to start the user interface of the “current” provider.)
-
用左键单击以显示包含所有SCC提供程序的菜单.选择您要开始的一个.(Click with the left button to display a menu with all SCC providers. Choose the one you’d like to start.)
-
如果愿意,可通过菜单选项将其添加到"自动启动"组中.(If you like, add it to the “autostart” group via menu option.)
UI增强(UI Enhancement)
要为每个SCC提供程序提供一个图标,请在该值所指向的"提供程序"部分中创建一个注册表值(To provide an icon for each SCC provider, create a registry value in the Provider section pointed to by the value) <Provider Name>
在关键:(in the key:) HKEY_LOCAL_MACHINE\Software\Microsoft\ SourceCodeControlProvider\InstalledSCCProviders
.该值必须是文本并命名(. The value must be text and named) IconDll
.它必须包含图像的完整路径-Exe或DLL-包含图标.作为选项,可以提供一个图标索引,该索引与路径之间用"'“分隔.否则,将使用1作为默认索引.通过在资源编辑器中打开图像,可以找到正确的索引.(. It must contain the complete path to the Image - Exe or DLL - which contains the icon. As an option, an icon index, separated from the path by a ‘,’ can be supplied. Otherwise 1 will be used as the default index. You can find the correct index by opening the image in a Resource Editor.)
例如:(For example:)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SourceSafe]
"IconDll"="C:\Programme\Microsoft Visual Studio\Vss\win32\Ssexp.exe,12"
将在我的Visual SourceSafe安装中执行.(will do in my Visual SourceSafe installation.)
问题(Problems)
- 您应该具有对(You should have write access to)
HKEY_LOCAL_MACHINE\Software\Microsoft\SourceCodeControlProvider
.否则程序将无法启动.(. Otherwise the program will not start.) - 当您无权访问时(When you have no write access to)
HKEY_CURRENT_USER\Software\Windows\CurrentVersion\Run
自动启动选项被禁用.(the Autostart option is disabled.) - 在终端服务器和XP中,通过用户切换功能,您可以多次启动SCCSwitcher.它将显示在每个开始的会话中.当您切换到另一个提供程序时,更改仅反映在当前会话中.为了也自动切换其他会话,我们必须监视相关的注册表部分.但是谁真正需要这种功能?(In Terminal server and XP, with the Userswitching feature, you can start SCCSwitcher multiple times. It will show up in each started session. When you switch to another provider, the change is only reflected in the current session. To automatically switch the other session too, we have to monitor the relevant registry section. But who really needs such a feature?) 该程序是在NT 4.0 SP6,W2K XP Professional上编写和测试的.(The program was written and tested on NT 4.0 SP6, W2K an XP Professional.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
VC7.0 C++ VC6 WinXP Windows Win2K Visual-Studio Dev 新闻 翻译