From dbe0dd465dcf7fe8fd761eb73c54cc921a80a545 Mon Sep 17 00:00:00 2001 From: "Eric Labashosky(d)" Date: Sun, 9 Feb 2014 10:04:25 -0500 Subject: [PATCH] [BUG] losing custom entities from include list fixed. --- .../MultiSelectComboBox.xaml.cs | 2 +- .../CrmCodeGenerator2011.cs | 32 +++++++------------ 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/CrmCodeGenerator.Controls/MultiSelectComboBox.xaml.cs b/CrmCodeGenerator.Controls/MultiSelectComboBox.xaml.cs index bb03503..270abce 100644 --- a/CrmCodeGenerator.Controls/MultiSelectComboBox.xaml.cs +++ b/CrmCodeGenerator.Controls/MultiSelectComboBox.xaml.cs @@ -140,7 +140,7 @@ private void SelectNodes() { foreach (var keyValue in SelectedItems) { - Node node = _nodeList.FirstOrDefault(i => i.Title == keyValue); + Node node = _nodeList.FirstOrDefault(i => i.Title == keyValue.Replace("_", "__")); if (node != null) node.IsSelected = true; } diff --git a/CrmCodeGenerator.VSPackage/CrmCodeGenerator2011.cs b/CrmCodeGenerator.VSPackage/CrmCodeGenerator2011.cs index 708e37d..e7adb9d 100644 --- a/CrmCodeGenerator.VSPackage/CrmCodeGenerator2011.cs +++ b/CrmCodeGenerator.VSPackage/CrmCodeGenerator2011.cs @@ -73,26 +73,6 @@ private ServiceProvider SiteServiceProvider return serviceProvider; } } - public CrmCodeGenerator2011() - { - //Configuration.Instance.DTE.ExecuteCommand("View.Output"); - var dte = Package.GetGlobalService(typeof(SDTE)) as EnvDTE.DTE; - var win = dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput); - win.Visible = true; - - - //System.Windows.Forms.Application.DoEvents(); - - IVsOutputWindow outputWindow = Package.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow; - Guid guidGeneral = Microsoft.VisualStudio.VSConstants.OutputWindowPaneGuid.GeneralPane_guid; - IVsOutputWindowPane pane; - int hr = outputWindow.CreatePane(guidGeneral, "General", 1, 0); - hr = outputWindow.GetPane(guidGeneral, out pane); - pane.Activate(); - pane.Clear(); - pane.FlushToTaskList(); - System.Windows.Forms.Application.DoEvents(); - } public void Dispose() { @@ -123,6 +103,7 @@ public int Generate(string wszInputFilePath, string bstrInputFileContents, strin if (bstrInputFileContents == null) throw new ArgumentException(bstrInputFileContents); + ClearStatus(); UpdateStatus("In order to generate code from this template, you need to provide login credentials for your CRM system"); UpdateStatus("The Discovery URL is the URL to your Discovery Service, you can find this URL in CRM -> Settings -> Customizations -> Developer Resources. \n eg " + @"https://dsc.yourdomain.com/XRMServices/2011/Discovery.svc"); @@ -217,6 +198,17 @@ private void UpdateStatus(string message) pane.FlushToTaskList(); System.Windows.Forms.Application.DoEvents(); } + private void ClearStatus() + { + IVsOutputWindow outputWindow = Package.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow; + Guid guidGeneral = Microsoft.VisualStudio.VSConstants.OutputWindowPaneGuid.GeneralPane_guid; + IVsOutputWindowPane pane; + int hr = outputWindow.CreatePane(guidGeneral, "General", 1, 0); + hr = outputWindow.GetPane(guidGeneral, out pane); + pane.Clear(); + pane.FlushToTaskList(); + System.Windows.Forms.Application.DoEvents(); + } #region IObjectWithSite public void GetSite(ref Guid riid, out IntPtr ppvSite)