public CustomPropertyPage() { _projectMgr = null; _projectConfigs = null; _project = null; _site = null; _dirty = false; IgnoreDirty = false; _title = string.Empty; _helpKeyword = string.Empty; }
public CustomPropertyPage() { _projectMgr = null; _projectConfigs = null; _project = null; _site = null; _dirty = false; IgnoreDirty = false; _title = string.Empty; _helpKeyword = string.Empty; }
void IPropertyPage.SetObjects(uint count, object[] punk) { if (count > 0) { if (punk[0] is ProjectConfig) { ArrayList configs = new ArrayList(); for (int i = 0; i < count; i++) { ProjectConfig config = (ProjectConfig)punk[i]; if (_projectMgr == null) { _projectMgr = config.ProjectMgr; } configs.Add(config); } _projectConfigs = (ProjectConfig[])configs.ToArray(typeof(ProjectConfig)); // For ProjectNodes we will get one of these } else if (punk[0] is NodeProperties) { if (_projectMgr == null) { _projectMgr = (punk[0] as NodeProperties).Node.ProjectMgr; } Dictionary<string, ProjectConfig> configsMap = new Dictionary<string, ProjectConfig>(); for (int i = 0; i < count; i++) { NodeProperties property = (NodeProperties)punk[i]; IVsCfgProvider provider; ErrorHandler.ThrowOnFailure(property.Node.ProjectMgr.GetCfgProvider(out provider)); uint[] expected = new uint[1]; ErrorHandler.ThrowOnFailure(provider.GetCfgs(0, null, expected, null)); if (expected[0] > 0) { ProjectConfig[] configs = new ProjectConfig[expected[0]]; uint[] actual = new uint[1]; provider.GetCfgs(expected[0], configs, actual, null); foreach (ProjectConfig config in configs) { if (!configsMap.ContainsKey(config.ConfigName)) { configsMap.Add(config.ConfigName, config); } } } } if (configsMap.Count > 0) { if (_projectConfigs == null) { _projectConfigs = new ProjectConfig[configsMap.Keys.Count]; } configsMap.Values.CopyTo(_projectConfigs, 0); } } } else { _projectMgr = null; } /* This code calls FillProperties without Initialize call if (_projectMgr != null) { FillProperties(); } */ if ((_projectMgr != null) && (_project == null)) { _project = new Microsoft.VisualStudio.Project.Automation.OAProject(_projectMgr); } }
void IPropertyPage.SetObjects(uint count, object[] punk) { if (count > 0) { if (punk[0] is ProjectConfig) { ArrayList configs = new ArrayList(); for (int i = 0; i < count; i++) { ProjectConfig config = (ProjectConfig)punk[i]; if (_projectMgr == null) { _projectMgr = config.ProjectMgr; } configs.Add(config); } _projectConfigs = (ProjectConfig[])configs.ToArray(typeof(ProjectConfig)); // For ProjectNodes we will get one of these } else if (punk[0] is NodeProperties) { if (_projectMgr == null) { _projectMgr = (punk[0] as NodeProperties).Node.ProjectMgr; } Dictionary <string, ProjectConfig> configsMap = new Dictionary <string, ProjectConfig>(); for (int i = 0; i < count; i++) { NodeProperties property = (NodeProperties)punk[i]; IVsCfgProvider provider; ErrorHandler.ThrowOnFailure(property.Node.ProjectMgr.GetCfgProvider(out provider)); uint[] expected = new uint[1]; ErrorHandler.ThrowOnFailure(provider.GetCfgs(0, null, expected, null)); if (expected[0] > 0) { ProjectConfig[] configs = new ProjectConfig[expected[0]]; uint[] actual = new uint[1]; provider.GetCfgs(expected[0], configs, actual, null); foreach (ProjectConfig config in configs) { if (!configsMap.ContainsKey(config.ConfigName)) { configsMap.Add(config.ConfigName, config); } } } } if (configsMap.Count > 0) { if (_projectConfigs == null) { _projectConfigs = new ProjectConfig[configsMap.Keys.Count]; } configsMap.Values.CopyTo(_projectConfigs, 0); } } } else { _projectMgr = null; } /* This code calls FillProperties without Initialize call * if (_projectMgr != null) * { * FillProperties(); * } */ if ((_projectMgr != null) && (_project == null)) { _project = new Microsoft.VisualStudio.Project.Automation.OAProject(_projectMgr); } }