- promatrixunplugged_src.zip
- Install.Readme.txt
- ProMatrix.Common
- ProMatrix.Lib
- App_Data
- CStorage.mdf
- CStorage_log.ldf
- bin
- Debug
- App_Data
- ProMatrix.Common.dll
- ProMatrix.Lib.dll
- Controls
- CClock.cs
- CFeatures
- CMenu
- ControlBase.cs
- ControlBaseEx.cs
- CStorage
- Images
- app_frame_10.gif
- app_frame_close_10.gif
- button_forward2.gif
- button_reverse2.gif
- ddlButton_off.gif
- ddlButton_on.gif
- menu.arrow.down.png
- menu.arrow.right.png
- menu.check_off.gif
- menu.check_on.gif
- menu.radio_off.gif
- menu.radio_on.gif
- party_icon.gif
- ConversionReport.txt
- DScripts
- Images
- clockface.gif
- clockface2.gif
- copyright-side.gif
- copyright-upright.gif
- footer_info.gif
- Loading.gif
- JScripts
- obj
- Debug
- TempPE
- ProMatrix.Lib.csproj
- ProMatrix.Lib.csproj.user
- Properties
- Styles
- Support
- ProMatrix.TestControls
- App_Data
- Database.mdf
- Database_log.LDF
- Bin
- ProMatrix.Common.dll
- ProMatrix.Lib.dll
- CClock
- CFeatures
- CStorage
- Default.aspx
- Default.aspx.cs
- Unplugged
- Web.Config
- ProMatrix.Unplugged.123.sln
|
using EnvDTE;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Collections;
using System.Runtime.InteropServices.ComTypes;
namespace ProMatrix.Lib.Controls
{
/*
support for:
EnableUnmanagedDebugging
FxCopRuleAssemblies
StartWorkingDirectory
CurrentWebsiteLanguage
EnableASPXDebugging
StartURL
VsWebServerPort
StartProgram
StartAction
StartArguments
FullPath
OpenedURL
EnableSQLServerDebugging
FxCopRules
EnableNTLMAuthentication
WebSiteType
EnableFxCop
EnableVsWebServer
BrowseURL
StartPage
VSPolicyExtenderProvider.TDLFileName
EnableVsWebServerDynamicPort
*/
public class ControlDesignerHelper
{
private DTE _oDTE = null;
private Hashtable ProjectPropertiesHashTable = new Hashtable();
private ArrayList ProjectPropertiesArrayList = new ArrayList();
public string AllProjectProperties="";
[DllImportAttribute("ole32.dll")]
private static extern int GetRunningObjectTable(int reserved, out IRunningObjectTable prot);
[DllImportAttribute("ole32.dll")]
private static extern int CreateBindCtx(int reserved, out IBindCtx ppbc);
//********************
// CONSTRUCTORS
//
/// <summary>
/// Default constructor needed for XML serialization
/// </summary>
public ControlDesignerHelper()
{
init();
}
~ControlDesignerHelper()
{
try { _oDTE = null; }
finally
{ //base.Finalize();
}
}
public string ProjectDocument()
{
return _oDTE.ActiveDocument.FullName;
}
public string ProjectProperties(string key)
{
if ( ProjectPropertiesHashTable.ContainsKey(key))
return ProjectPropertiesHashTable[key].ToString();
else
return "";
}
private void GetMSDEVFromGIT(string left, string right)
{
string str;
object local;
IRunningObjectTable iRunningObjectTable;
IEnumMoniker iEnumMoniker;
IBindCtx iBindCtx = null;
try
{
GetRunningObjectTable(0, out iRunningObjectTable);
iRunningObjectTable.EnumRunning(out iEnumMoniker);
iEnumMoniker.Reset();
IMoniker[] iMonikers = new IMoniker[1];
IntPtr intptr = new IntPtr(0);
while (iEnumMoniker.Next(1, iMonikers, intptr) == 0)
{
CreateBindCtx(0, out iBindCtx);
iMonikers[0].GetDisplayName(iBindCtx, null, out str);
if (str.StartsWith(left) && str.EndsWith(right))
{
iRunningObjectTable.GetObject(iMonikers[0], out local);
_oDTE = (DTE)local;
}
}
}
catch (Exception e)
{ throw e; }
}
public void init()
{
System.Array projs;
EnvDTE.Project proj;
ProjectPropertiesHashTable.Clear();
GetMSDEVFromGIT("!VisualStudio.DTE.8", System.Diagnostics.Process.GetCurrentProcess().Id.ToString());
if (_oDTE == null) return;
projs = (System.Array)_oDTE.ActiveSolutionProjects;
proj = (EnvDTE.Project)projs.GetValue(0);
EnvDTE.Properties pProps = proj.Properties;
try
{
foreach (EnvDTE.Property propObj in pProps)
{
ProjectPropertiesHashTable.Add(propObj.Name, propObj.Value.ToString());
}
}
catch {}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
My formal education was in Electronic Engineering with a background in real-time data acquisition for aerospace. Early in my career, I switched my focus from hardware engineering to software engineering. Most, but not all, of my development experience has been using Microsoft technologies and tools. My current accomplishments are web applications using ASP.Net, SQL Server 2005, JavaScript, and Visual Studio Tools for Office. I enjoy all facets of a development life cycle, and have played almost all roles. Most recently, I have been involved in project technical leadership, architecture, and training, and I have created several small courses including this one on
Abstract Programming.