本文整理汇总了C#中IVsCfg类的典型用法代码示例。如果您正苦于以下问题:C# IVsCfg类的具体用法?C# IVsCfg怎么用?C# IVsCfg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVsCfg类属于命名空间,在下文中一共展示了IVsCfg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NodejsUwpProjectFlavorCfg
public NodejsUwpProjectFlavorCfg(NodejsUwpProjectFlavor baseProjectNode, IVsCfg baseConfiguration, IVsProjectFlavorCfg innerConfiguration)
{
_baseCfg = baseConfiguration;
_innerCfg = innerConfiguration;
project = baseProjectNode;
mapIVsCfgToNodejsUwpProjectFlavorCfg.Add(baseConfiguration, this);
}
示例2: VsProjectFlavorCfg
public VsProjectFlavorCfg(VsProject project, IVsCfg baseCfg)
{
m_vsCfg = baseCfg;
m_project = project;
m_innerIVsDebuggableProjectCfg = m_vsCfg as IVsDebuggableProjectCfg;
m_IVsBuildPropertyStorage = m_project as IVsBuildPropertyStorage;
Debug.Assert(m_innerIVsDebuggableProjectCfg != null);
m_connectionsDeployStatusCallback = new ConnectionPoint.Connections();
DeployPropertyPort = new ProjectBuildProperty("DeployTransport", m_IVsBuildPropertyStorage, this, _PersistStorageType.PST_USER_FILE, _PersistStorageType.PST_PROJECT_FILE, DebugPort.NameFromPortFilter(PortFilter.Emulator));
DeployPropertyDevice = new ProjectBuildProperty("DeployDevice", m_IVsBuildPropertyStorage, this, _PersistStorageType.PST_USER_FILE, _PersistStorageType.PST_PROJECT_FILE);
GenerateStubsFlag = new ProjectBuildPropertyBool("MF_GenerateStubs", m_IVsBuildPropertyStorage, this, _PersistStorageType.PST_USER_FILE);
GenerateStubsRootName = new ProjectBuildProperty("MF_GenerateStubsRootName", m_IVsBuildPropertyStorage, this, _PersistStorageType.PST_USER_FILE, _PersistStorageType.PST_PROJECT_FILE, "TARGET");
GenerateStubsDirectory = new ProjectBuildProperty("MF_GenerateStubsDirectory", m_IVsBuildPropertyStorage, this, _PersistStorageType.PST_USER_FILE, _PersistStorageType.PST_PROJECT_FILE, "DIRECTORY");
try
{
ActivateDebugEngine();
}
catch (Exception e)
{
VsPackage.MessageCentre.InternalErrorMsg(false, String.Format("Unable to register debug engine: {0}", e.Message));
}
}
示例3:
int IVsUpdateSolutionEvents2.UpdateProjectCfg_Begin(
IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, ref int pfCancel)
{
//
// if clean project or solution, dwAction == 0x100000
// if build project or solution, dwAction == 0x010000
// if rebuild project or solution, dwAction == 0x410000
//
if (dwAction == 0x010000
|| dwAction == 0x410000)
{
var validationSuccessful =
VisualStudioEdmxValidator.LoadAndValidateAllFilesInProject(
pHierProj, /*doEscherValidation*/ false, ShouldValidateArtifactDuringBuild);
// we cause a 'build break' for command-line builds by setting PfCancel = 1
if (PackageManager.Package.IsBuildingFromCommandLine
&& !validationSuccessful)
{
pfCancel = 1;
}
}
return VSConstants.S_OK;
}
示例4: GetNameProperty
int IVsUpdateSolutionEvents2.UpdateProjectCfg_Done(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, int fSuccess, int fCancel)
{
var name = GetNameProperty(pHierProj);
var folder = GetProjectDirectoryProperty(pHierProj);
if (!string.IsNullOrEmpty(name))
BuildFinishedEvent(this, new SolutionBuildFinishedEvent() { ProjectName = name, ProjectFolder = folder });
return VSConstants.S_OK;
}
示例5: GetCfgOfName
public void GetCfgOfName(string name, string platName, out IVsCfg cfg) {
CCITracing.TraceCall();
cfg = null;
foreach (XmlElement e in this.projectManager.StateElement.SelectNodes("Build/Settings/Config")) {
if (name == e.GetAttribute("Name")) {
cfg = new ProjectConfig(this.projectManager, e);
break;
}
}
}
示例6: GetACSPropertyPageProjectFlavorCfgFromIVsCfg
internal static ACSPropertyPageProjectFlavorCfg GetACSPropertyPageProjectFlavorCfgFromIVsCfg(IVsCfg configuration)
{
if (mapIVsCfgToACSPropertyPageProjectFlavorCfg.ContainsKey(configuration))
{
return (ACSPropertyPageProjectFlavorCfg)mapIVsCfgToACSPropertyPageProjectFlavorCfg[configuration];
}
else
{
throw new ArgumentOutOfRangeException("Cannot find configuration in mapIVsCfgToSpecializedCfg.");
}
}
示例7: UpdateProjectCfg_Done
/// <summary>
/// This is overridden to open the help file after a successful build or the log viewer tool window
/// after a failed build if so indicated by the Sandcastle Help File Builder options.
/// </summary>
/// <inheritdoc />
/// <remarks>Note that the base method documentation is wrong. The action parameter is actually a
/// combination of VSSOLNBUILDUPDATEFLAGS values.</remarks>
public override int UpdateProjectCfg_Done(IVsHierarchy hierarchy, IVsCfg configProject,
IVsCfg configSolution, uint action, int success, int cancel)
{
SandcastleBuilderProjectNode projectNode;
SandcastleBuilderOptionsPage options;
ProjectConfig cfg = configProject as ProjectConfig;
if(cfg != null)
{
if(cancel == 0 && success != 0)
{
// Open the help file on a successful build if so requested
projectNode = cfg.ProjectMgr as SandcastleBuilderProjectNode;
options = SandcastleBuilderPackage.Instance.GeneralOptions;
if(projectNode != null && options != null)
if((action & (uint)VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_BUILD) != 0 && options.OpenHelpAfterBuild)
SandcastleBuilderPackage.Instance.ViewBuiltHelpFile(projectNode);
else
if((action & (uint)VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_CLEAN) != 0)
{
var window = cfg.ProjectMgr.Package.FindToolWindow(typeof(ToolWindows.BuildLogToolWindow), 0, false) as
BuildLogToolWindow;
if(window != null)
window.ClearLog();
}
}
else
if(cancel == 0 && success == 0)
{
// Open the build log tool window on a failed build if so requested
projectNode = cfg.ProjectMgr as SandcastleBuilderProjectNode;
options = SandcastleBuilderPackage.Instance.GeneralOptions;
if(projectNode != null && options != null)
if((action & (uint)VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_BUILD) != 0 && options.OpenLogViewerOnFailedBuild)
projectNode.OpenBuildLogToolWindow(true);
else
{
// The user doesn't want it opened. However, if it's already open, refresh the
// log file reference so that it shows the correct file when it is displayed.
var window = cfg.ProjectMgr.Package.FindToolWindow(typeof(ToolWindows.BuildLogToolWindow), 0, false) as
BuildLogToolWindow;
if(window != null && ((IVsWindowFrame)window.Frame).IsVisible() == VSConstants.S_OK)
projectNode.OpenBuildLogToolWindow(false);
}
}
}
return VSConstants.S_OK;
}
示例8: CreateProjectFlavorCfg
public int CreateProjectFlavorCfg(IVsCfg pBaseProjectCfg, out IVsProjectFlavorCfg ppFlavorCfg)
{
IVsProjectFlavorCfg cfg;
ErrorHandler.ThrowOnFailure(
_innerVsProjectFlavorCfgProvider.CreateProjectFlavorCfg(
pBaseProjectCfg,
out cfg
)
);
ppFlavorCfg = _config = new NodejsUwpProjectFlavorCfg(this, pBaseProjectCfg, cfg);
return VSConstants.S_OK;
}
示例9: PersistXMLFragments
protected void PersistXMLFragments()
{
if (this.IsFlavorDirty() != 0)
{
XmlDocument doc = new XmlDocument();
XmlElement root = doc.CreateElement("ROOT");
// We will need the list of configuration inside the loop, so get it before entering the loop
uint[] count = new uint[1];
IVsCfg[] configs = null;
int hr = this.ConfigProvider.GetCfgs(0, null, count, null);
if (ErrorHandler.Succeeded(hr) && count[0] > 0)
{
configs = new IVsCfg[count[0]];
hr = this.ConfigProvider.GetCfgs((uint)configs.Length, configs, count, null);
if (ErrorHandler.Failed(hr))
count[0] = 0;
}
if (count[0] == 0)
configs = new IVsCfg[0];
// We need to loop through all the flavors
string flavorsGuid;
ErrorHandler.ThrowOnFailure(((IVsAggregatableProject)this).GetAggregateProjectTypeGuids(out flavorsGuid));
foreach (Guid flavor in Utilities.GuidsArrayFromSemicolonDelimitedStringOfGuids(flavorsGuid))
{
IPersistXMLFragment outerHierarchy = HierarchyNode.GetOuterHierarchy(this) as IPersistXMLFragment;
// First check the project
if (outerHierarchy != null)
{
// Retrieve the XML fragment
string fragment = string.Empty;
Guid flavorGuid = flavor;
ErrorHandler.ThrowOnFailure((outerHierarchy).Save(ref flavorGuid, (uint)_PersistStorageType.PST_PROJECT_FILE, out fragment, 1));
if (!String.IsNullOrEmpty(fragment))
{
// Add the fragment to our XML
WrapXmlFragment(doc, root, flavor, null, fragment);
}
// While we don't yet support user files, our flavors might, so we will store that in the project file until then
// TODO: Refactor this code when we support user files
fragment = String.Empty;
ErrorHandler.ThrowOnFailure((outerHierarchy).Save(ref flavorGuid, (uint)_PersistStorageType.PST_USER_FILE, out fragment, 1));
if (!String.IsNullOrEmpty(fragment))
{
// Add the fragment to our XML
XmlElement node = WrapXmlFragment(doc, root, flavor, null, fragment);
node.Attributes.Append(doc.CreateAttribute(ProjectFileConstants.User));
}
}
// Then look at the configurations
foreach (IVsCfg config in configs)
{
// Get the fragment for this flavor/config pair
string fragment;
ErrorHandler.ThrowOnFailure(((ProjectConfig)config).GetXmlFragment(flavor, _PersistStorageType.PST_PROJECT_FILE, out fragment));
if (!String.IsNullOrEmpty(fragment))
{
string configName;
ErrorHandler.ThrowOnFailure(config.get_DisplayName(out configName));
WrapXmlFragment(doc, root, flavor, configName, fragment);
}
}
}
if (root.ChildNodes != null && root.ChildNodes.Count > 0)
{
// Save our XML (this is only the non-build information for each flavor) in msbuild
SetProjectExtensions(ProjectFileConstants.VisualStudio, root.InnerXml.ToString());
}
}
}
示例10: IsFlavorDirty
protected int IsFlavorDirty()
{
int isDirty = 0;
// See if one of our flavor consider us dirty
IPersistXMLFragment outerHierarchy = HierarchyNode.GetOuterHierarchy(this) as IPersistXMLFragment;
if (outerHierarchy != null)
{
// First check the project
ErrorHandler.ThrowOnFailure(outerHierarchy.IsFragmentDirty((uint)_PersistStorageType.PST_PROJECT_FILE, out isDirty));
// While we don't yet support user files, our flavors might, so we will store that in the project file until then
// TODO: Refactor this code when we support user files
if (isDirty == 0)
ErrorHandler.ThrowOnFailure(outerHierarchy.IsFragmentDirty((uint)_PersistStorageType.PST_USER_FILE, out isDirty));
}
if (isDirty == 0)
{
// Then look at the configurations
uint[] count = new uint[1];
int hr = this.ConfigProvider.GetCfgs(0, null, count, null);
if (ErrorHandler.Succeeded(hr) && count[0] > 0)
{
// We need to loop through the configurations
IVsCfg[] configs = new IVsCfg[count[0]];
hr = this.ConfigProvider.GetCfgs((uint)configs.Length, configs, count, null);
Debug.Assert(ErrorHandler.Succeeded(hr), "failed to retrieve configurations");
foreach (IVsCfg config in configs)
{
isDirty = ((ProjectConfig)config).IsFlavorDirty(_PersistStorageType.PST_PROJECT_FILE);
if (isDirty != 0)
break;
}
}
}
return isDirty;
}
示例11: GetCfgOfName
/// <summary>
/// Returns the configuration associated with a specified configuration or platform name.
/// </summary>
/// <param name="name">The name of the configuration to be returned.</param>
/// <param name="platName">The name of the platform for the configuration to be returned.</param>
/// <param name="cfg">The implementation of the IVsCfg interface.</param>
/// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns>
public override int GetCfgOfName(string name, string platName, out IVsCfg cfg)
{
cfg = this.GetProjectConfiguration(name, platName);
return VSConstants.S_OK;
}
示例12: UpdateProjectCfg_Begin
public int UpdateProjectCfg_Begin(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, ref int pfCancel)
{
return VSConstants.S_OK;
}
示例13: UpdateProjectCfg_Begin
/// <summary>
/// Called right before a project configuration begins to build.
/// </summary>
/// <param name="hierarchy">The project that is to be build.</param>
/// <param name="configProject">A configuration project object.</param>
/// <param name="configSolution">A configuration solution object.</param>
/// <param name="action">The action taken.</param>
/// <param name="cancel">A flag indicating cancel.</param>
/// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns>
/// <remarks>The values for the action are defined in the enum _SLNUPDACTION env\msenv\core\slnupd2.h</remarks>
public int UpdateProjectCfg_Begin(IVsHierarchy hierarchy, IVsCfg configProject, IVsCfg configSolution, uint action, ref int cancel) {
return VSConstants.E_NOTIMPL;
}
示例14: return
int IVsProjectCfgProvider.GetCfgs(uint celt, IVsCfg[] rgpcfg, uint[] pcActual, uint[] prgfFlags)
{
return ((IVsCfgProvider2)this).GetCfgs(celt, rgpcfg, pcActual, prgfFlags);
}
示例15: GetCfg
public int GetCfg(out IVsCfg ppCfg)
{
ppCfg = this;
return VSConstants.S_OK;
}