From df487093e19da2589dfdda9c4c882bba886fd9e6 Mon Sep 17 00:00:00 2001 From: comintern Date: Thu, 23 Feb 2017 18:26:00 -0600 Subject: [PATCH 01/31] Add modern folder browser dialog. --- RetailCoder.VBE/Root/RubberduckModule.cs | 1 + RetailCoder.VBE/Rubberduck.csproj | 1 + .../UI/FileBrowserDialogFactory.cs | 14 +- RetailCoder.VBE/UI/ModernFolderBrowser.cs | 121 ++++++++++++++++++ 4 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 RetailCoder.VBE/UI/ModernFolderBrowser.cs diff --git a/RetailCoder.VBE/Root/RubberduckModule.cs b/RetailCoder.VBE/Root/RubberduckModule.cs index 7b2b42e51a..1436aba97e 100644 --- a/RetailCoder.VBE/Root/RubberduckModule.cs +++ b/RetailCoder.VBE/Root/RubberduckModule.cs @@ -82,6 +82,7 @@ public override void Load() ApplyDefaultInterfacesConvention(assemblies); ApplyConfigurationConvention(assemblies); ApplyAbstractFactoryConvention(assemblies); + Rebind().To().InSingletonScope(); BindCommandsToMenuItems(); diff --git a/RetailCoder.VBE/Rubberduck.csproj b/RetailCoder.VBE/Rubberduck.csproj index b3521ab085..efa774cb02 100644 --- a/RetailCoder.VBE/Rubberduck.csproj +++ b/RetailCoder.VBE/Rubberduck.csproj @@ -467,6 +467,7 @@ + diff --git a/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs b/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs index 118953a510..582235f907 100644 --- a/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs +++ b/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs @@ -14,19 +14,27 @@ public interface IFolderBrowserFactory public class DialogFactory : IFolderBrowserFactory { + private static readonly bool OldSchool = Environment.OSVersion.Version.Major < 6; + public IFolderBrowser CreateFolderBrowser(string description) { - return new FolderBrowser(description); + return !OldSchool + ? new ModernFolderBrowser(description) as IFolderBrowser + : new FolderBrowser(description); } public IFolderBrowser CreateFolderBrowser(string description, bool showNewFolderButton) { - return new FolderBrowser(description, showNewFolderButton); + return !OldSchool + ? new ModernFolderBrowser(description, showNewFolderButton) as IFolderBrowser + : new FolderBrowser(description, showNewFolderButton); } public IFolderBrowser CreateFolderBrowser(string description, bool showNewFolderButton, Environment.SpecialFolder rootFolder) { - return new FolderBrowser(description, showNewFolderButton, rootFolder); + return !OldSchool + ? new ModernFolderBrowser(description, showNewFolderButton, rootFolder) as IFolderBrowser + : new FolderBrowser(description, showNewFolderButton, rootFolder); } } } diff --git a/RetailCoder.VBE/UI/ModernFolderBrowser.cs b/RetailCoder.VBE/UI/ModernFolderBrowser.cs new file mode 100644 index 0000000000..754ee09d59 --- /dev/null +++ b/RetailCoder.VBE/UI/ModernFolderBrowser.cs @@ -0,0 +1,121 @@ +using System; +using System.Linq; +using System.Reflection; +using System.Windows.Forms; +using FileDialog = System.Windows.Forms.FileDialog; + +namespace Rubberduck.UI +{ + public class ModernFolderBrowser : IFolderBrowser + { + // ReSharper disable InconsistentNaming + private const BindingFlags DefaultBindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; + + private static readonly AssemblyName FormsAssemblyName = + Assembly.GetExecutingAssembly() + .GetReferencedAssemblies() + .FirstOrDefault(a => a.FullName.StartsWith("System.Windows.Forms")); + + private static readonly Assembly FormsAssembly = Assembly.Load(FormsAssemblyName); + private static readonly Type IFileDialog = FormsAssembly.GetTypes().SingleOrDefault(t => t.Name.Equals("IFileDialog")); + private static readonly MethodInfo OpenFileDialogCreateVistaDialog = typeof(System.Windows.Forms.OpenFileDialog).GetMethod("CreateVistaDialog", DefaultBindingFlags); + private static readonly MethodInfo OpenFileDialogOnBeforeVistaDialog = typeof(System.Windows.Forms.OpenFileDialog).GetMethod("OnBeforeVistaDialog", DefaultBindingFlags); + private static readonly MethodInfo FileDialogGetOptions = typeof(FileDialog).GetMethod("GetOptions", DefaultBindingFlags); + private static readonly MethodInfo IFileDialogSetOptions = IFileDialog.GetMethod("SetOptions", DefaultBindingFlags); + private static readonly MethodInfo IFileDialogShow = IFileDialog.GetMethod("Show", DefaultBindingFlags); + private static readonly Type FOS = FormsAssembly.GetTypes().SingleOrDefault(t => t.Name.Equals("FOS")); + private static readonly uint FOS_PICKFOLDERS = (uint)FOS.GetField("FOS_PICKFOLDERS").GetValue(null); + private static readonly Type VistaDialogEvents = FormsAssembly.GetTypes().SingleOrDefault(t => t.Name.Equals("VistaDialogEvents")); + private static readonly ConstructorInfo VistaDialogEventsCtor = VistaDialogEvents.GetConstructors().SingleOrDefault(); + private static readonly MethodInfo IFileDialogAdvise = IFileDialog.GetMethod("Advise", DefaultBindingFlags); + private static readonly MethodInfo IFileDialogUnadvise = IFileDialog.GetMethod("Unadvise", DefaultBindingFlags); + + // ReSharper restore InconsistentNaming + + private readonly System.Windows.Forms.OpenFileDialog _dialog; + private readonly object _newDialog; + + // ReSharper disable once UnusedParameter.Local + public ModernFolderBrowser(string description, bool showNewFolderButton, Environment.SpecialFolder rootFolder) + { + _root = rootFolder; + _dialog = new System.Windows.Forms.OpenFileDialog + { + Title = description, + InitialDirectory = Environment.GetFolderPath(_root), + // ReSharper disable once LocalizableElement + Filter = "Folders|\n", + AddExtension = false, + CheckFileExists = false, + DereferenceLinks = true, + Multiselect = false + }; + _newDialog = OpenFileDialogCreateVistaDialog.Invoke(_dialog, new object[] { }); + OpenFileDialogOnBeforeVistaDialog.Invoke(_dialog, new[] { _newDialog }); + var options = (uint)FileDialogGetOptions.Invoke(_dialog, new object[] { }) | FOS_PICKFOLDERS; + IFileDialogSetOptions.Invoke(_newDialog, new object[] { options }); + } + + public ModernFolderBrowser(string description, bool showNewFolderButton) + : this(description, showNewFolderButton, Environment.SpecialFolder.MyDocuments) + { } + + public ModernFolderBrowser(string description) : this(description, true) { } + + public string Description + { + get { return _dialog.Title; } + set { _dialog.Title = value; } + } + + public bool ShowNewFolderButton + { + get { return true; } + // ReSharper disable once ValueParameterNotUsed + set { } + } + + private Environment.SpecialFolder _root; + public Environment.SpecialFolder RootFolder + { + get { return _root; } + set + { + _root = value; + _dialog.InitialDirectory = Environment.GetFolderPath(_root); + } + } + + public string SelectedPath + { + get { return _dialog.FileName; } + set { _dialog.FileName = value; } + } + + public DialogResult ShowDialog() + { + var sink = VistaDialogEventsCtor.Invoke(new object[] { _dialog }); + var cookie = 0u; + var parameters = new[] { sink, cookie }; + IFileDialogAdvise.Invoke(_newDialog, parameters); + //This is the cookie returned as a ref parameter in the call above. + cookie = (uint)parameters[1]; + int returnValue; + try + { + returnValue = (int)IFileDialogShow.Invoke(_newDialog, new object[] { IntPtr.Zero }); + } + finally + { + IFileDialogUnadvise.Invoke(_newDialog, new object[] { cookie }); + GC.KeepAlive(sink); + } + return returnValue == 0 ? DialogResult.OK : DialogResult.Cancel; + } + + public void Dispose() + { + _dialog.Dispose(); + } + } +} From 8b61706e1ad0c8e25e4618965ed97bfbd71930ef Mon Sep 17 00:00:00 2001 From: Max Doerner Date: Fri, 24 Feb 2017 17:17:25 +0100 Subject: [PATCH 02/31] Made the `ParseCoordinator` remove all references upon reparse and not only those to the built-in declarations and the modules that have been modified. --- Rubberduck.Parsing/VBA/ParseCoordinator.cs | 8 ++++---- Rubberduck.Parsing/VBA/RubberduckParserState.cs | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Rubberduck.Parsing/VBA/ParseCoordinator.cs b/Rubberduck.Parsing/VBA/ParseCoordinator.cs index a41ee656fa..f3b61fe77b 100644 --- a/Rubberduck.Parsing/VBA/ParseCoordinator.cs +++ b/Rubberduck.Parsing/VBA/ParseCoordinator.cs @@ -215,7 +215,7 @@ private void ExecuteCommonParseActivities(List toParse, Cancellati token.ThrowIfCancellationRequested(); _projectDeclarations.Clear(); - State.ClearBuiltInReferences(); + State.ClearAllReferences(); ParseComponents(toParse, token); @@ -612,7 +612,7 @@ private void ParseAllInternal(object requestor, CancellationToken token) token.ThrowIfCancellationRequested(); - var componentsRemoved = ClearStateCashForRemovedComponents(components); + var componentsRemoved = CleanUpRemovedComponents(components); token.ThrowIfCancellationRequested(); @@ -642,10 +642,10 @@ private void ParseAllInternal(object requestor, CancellationToken token) } /// - /// Clears state cach for removed components. + /// Clears state cache of removed components. /// Returns whether components have been removed. /// - private bool ClearStateCashForRemovedComponents(List components) + private bool CleanUpRemovedComponents(List components) { var removedModuledecalrations = RemovedModuleDeclarations(components); var componentRemoved = removedModuledecalrations.Any(); diff --git a/Rubberduck.Parsing/VBA/RubberduckParserState.cs b/Rubberduck.Parsing/VBA/RubberduckParserState.cs index c4c8cd2af6..f0df2cc50b 100644 --- a/Rubberduck.Parsing/VBA/RubberduckParserState.cs +++ b/Rubberduck.Parsing/VBA/RubberduckParserState.cs @@ -742,6 +742,14 @@ public void ClearBuiltInReferences() } } + public void ClearAllReferences() + { + foreach (var declaration in AllDeclarations) + { + declaration.ClearReferences(); + } + } + public bool ClearStateCache(IVBComponent component, bool notifyStateChanged = false) { return component != null && ClearStateCache(new QualifiedModuleName(component), notifyStateChanged); From 93385bf730cb82f4672b7f5d98076e69493281d0 Mon Sep 17 00:00:00 2001 From: Max Doerner Date: Sat, 25 Feb 2017 00:20:14 +0100 Subject: [PATCH 03/31] Fixed issue #2737. --- .../Symbols/DeclarationFinder.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Rubberduck.Parsing/Symbols/DeclarationFinder.cs b/Rubberduck.Parsing/Symbols/DeclarationFinder.cs index c5f927dcdb..c782a4adaa 100644 --- a/Rubberduck.Parsing/Symbols/DeclarationFinder.cs +++ b/Rubberduck.Parsing/Symbols/DeclarationFinder.cs @@ -98,15 +98,23 @@ public DeclarationFinder(IReadOnlyList declarations, IEnumerable ParserRuleContextHelper.HasParent(reference.Context)) .Select(reference => new { IdentifierReference = reference, Context = ParserRuleContextHelper.GetParent(reference.Context)})); - var interfaceMembers = implementsInstructions.Select(item => new + var interfaceModules = implementsInstructions.Select(item => item.IdentifierReference.Declaration).Distinct(); + + var interfaceMembers = interfaceModules.Select(item => new { - InterfaceModule = item.IdentifierReference.Declaration, - InterfaceMembers = _declarations[item.IdentifierReference.Declaration.QualifiedName.QualifiedModuleName] - .Where(member => member.DeclarationType.HasFlag(DeclarationType.Member)) + InterfaceModule = item, + InterfaceMembers = _declarations[item.QualifiedName.QualifiedModuleName] + .Where(member => member.DeclarationType.HasFlag(DeclarationType.Member)) }); _interfaceMembers = new Lazy>(() => - new ConcurrentDictionary(interfaceMembers.ToDictionary(item => item.InterfaceModule, item => item.InterfaceMembers.ToArray())), true); + new ConcurrentDictionary( + interfaceMembers.ToDictionary( + item => item.InterfaceModule, + item => item.InterfaceMembers.ToArray() + ) + ) + , true); var implementingNames = new Lazy>(() => implementsInstructions.SelectMany(item => _declarations[item.IdentifierReference.Declaration.QualifiedName.QualifiedModuleName] From 3c6bfd6697fb4885aebf24caaa77913f2c77eba8 Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 18:09:21 -0600 Subject: [PATCH 04/31] Add checks for protected projects in project event handlers. --- .../SafeComWrappers/VBA/VBProjects.cs | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs index dfeae049c9..f28c223937 100644 --- a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs +++ b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs @@ -145,7 +145,10 @@ private static void DetatchEvents() private static ItemAddedDelegate _projectAdded; private static void OnProjectAdded(VB.VBProject vbProject) { - if (IsInDesignMode()) OnDispatch(ProjectAdded, vbProject, true); + if (IsInDesignMode() && vbProject.Protection == VB.vbext_ProjectProtection.vbext_pp_none) + { + OnDispatch(ProjectAdded, vbProject, true); + } } public static event EventHandler ProjectRemoved; @@ -153,7 +156,10 @@ private static void OnProjectAdded(VB.VBProject vbProject) private static ItemRemovedDelegate _projectRemoved; private static void OnProjectRemoved(VB.VBProject vbProject) { - if (IsInDesignMode()) OnDispatch(ProjectRemoved, vbProject); + if (IsInDesignMode() && vbProject.Protection == VB.vbext_ProjectProtection.vbext_pp_none) + { + OnDispatch(ProjectRemoved, vbProject); + } } public static event EventHandler ProjectRenamed; @@ -161,7 +167,10 @@ private static void OnProjectRemoved(VB.VBProject vbProject) private static ItemRenamedDelegate _projectRenamed; private static void OnProjectRenamed(VB.VBProject vbProject, string oldName) { - if (!IsInDesignMode()) { return; } + if (!IsInDesignMode() || vbProject.Protection == VB.vbext_ProjectProtection.vbext_pp_locked) + { + return; + } var project = new VBProject(vbProject); var projectId = project.ProjectId; @@ -178,13 +187,16 @@ private static void OnProjectRenamed(VB.VBProject vbProject, string oldName) private static ItemActivatedDelegate _projectActivated; private static void OnProjectActivated(VB.VBProject vbProject) { - if (IsInDesignMode()) OnDispatch(ProjectActivated, vbProject); + if (IsInDesignMode() && vbProject.Protection == VB.vbext_ProjectProtection.vbext_pp_none) + { + OnDispatch(ProjectActivated, vbProject); + } } private static void OnDispatch(EventHandler dispatched, VB.VBProject vbProject, bool assignId = false) { var handler = dispatched; - if (handler != null) + if (handler != null && vbProject.Protection != VB.vbext_ProjectProtection.vbext_pp_locked) { var project = new VBProject(vbProject); if (assignId) @@ -201,7 +213,10 @@ private static bool IsInDesignMode() if (_projects == null) return true; foreach (var project in _projects.Cast()) { - if (project.Mode != VB.vbext_VBAMode.vbext_vm_Design) return false; + if (project.Mode != VB.vbext_VBAMode.vbext_vm_Design) + { + return false; + } } return true; } From 812d8bd445997af29e772776ce21c9eb5b8c647f Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 19:09:56 -0600 Subject: [PATCH 05/31] Limit VBComponents\VBProjects handlers to a single instance. Check project protection in VBComponent events. --- .../Events/VBENativeServices.cs | 2 + .../SafeComWrappers/VBA/VBComponents.cs | 55 +++++++++++-------- .../SafeComWrappers/VBA/VBProjects.cs | 11 ++-- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/Rubberduck.VBEEditor/Events/VBENativeServices.cs b/Rubberduck.VBEEditor/Events/VBENativeServices.cs index a3e75fcaa2..5f03b3a159 100644 --- a/Rubberduck.VBEEditor/Events/VBENativeServices.cs +++ b/Rubberduck.VBEEditor/Events/VBENativeServices.cs @@ -60,6 +60,8 @@ public static void UnhookEvents() info.Subclass.FocusChange -= FocusDispatcher; info.Subclass.Dispose(); } + SafeComWrappers.VBA.VBProjects.DetatchEvents(); + SafeComWrappers.VBA.VBComponents.DetatchEvents(); } } diff --git a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBComponents.cs b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBComponents.cs index f2efb4dcf7..cd655b5511 100644 --- a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBComponents.cs +++ b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBComponents.cs @@ -1,6 +1,5 @@ using System; using System.Collections; -using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; @@ -15,8 +14,8 @@ namespace Rubberduck.VBEditor.SafeComWrappers.VBA public class VBComponents : SafeComWrapper, IVBComponents { private static readonly Guid VBComponentsEventsGuid = new Guid("0002E116-0000-0000-C000-000000000046"); - private static HashSet _handlers = new HashSet(); private static object _lockObject = new object(); + private static VB.VBComponents _components; private enum ComponentEventDispId { @@ -30,7 +29,10 @@ private enum ComponentEventDispId public VBComponents(VB.VBComponents target) : base(target) { - AttachEvents(Target); + if (_components == null) + { + AttachEvents(target); + } } public int Count @@ -98,8 +100,7 @@ IEnumerator IEnumerable.GetEnumerator() public override void Release(bool final = false) { if (!IsWrappingNullReference) - { - DetatchEvents(Target); + { for (var i = 1; i <= Count; i++) { this[i].Release(); @@ -199,38 +200,38 @@ private static void AttachEvents(VB.VBComponents components) { lock (_lockObject) { - if (!_handlers.Contains(components)) + if (_components == null) { + _components = components; _componentAdded = OnComponentAdded; _componentRemoved = OnComponentRemoved; _componentRenamed = OnComponentRenamed; _componentSelected = OnComponentSelected; _componentActivated = OnComponentActivated; _componentReloaded = OnComponentReloaded; - ComEventsHelper.Combine(components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemAdded, _componentAdded); - ComEventsHelper.Combine(components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemRemoved, _componentRemoved); - ComEventsHelper.Combine(components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemRenamed, _componentRenamed); - ComEventsHelper.Combine(components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemSelected, _componentSelected); - ComEventsHelper.Combine(components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemActivated, _componentActivated); - ComEventsHelper.Combine(components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemReloaded, _componentReloaded); - _handlers.Add(components); + ComEventsHelper.Combine(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemAdded, _componentAdded); + ComEventsHelper.Combine(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemRemoved, _componentRemoved); + ComEventsHelper.Combine(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemRenamed, _componentRenamed); + ComEventsHelper.Combine(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemSelected, _componentSelected); + ComEventsHelper.Combine(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemActivated, _componentActivated); + ComEventsHelper.Combine(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemReloaded, _componentReloaded); } } } - private static void DetatchEvents(VB.VBComponents components) + internal static void DetatchEvents() { lock (_lockObject) { - if (_handlers.Contains(components)) + if (_components != null) { - ComEventsHelper.Remove(components, VBComponentsEventsGuid, (int) ComponentEventDispId.ItemAdded, _componentAdded); - ComEventsHelper.Remove(components, VBComponentsEventsGuid, (int) ComponentEventDispId.ItemRemoved, _componentRemoved); - ComEventsHelper.Remove(components, VBComponentsEventsGuid, (int) ComponentEventDispId.ItemRenamed, _componentRenamed); - ComEventsHelper.Remove(components, VBComponentsEventsGuid, (int) ComponentEventDispId.ItemSelected, _componentSelected); - ComEventsHelper.Remove(components, VBComponentsEventsGuid, (int) ComponentEventDispId.ItemActivated, _componentActivated); - ComEventsHelper.Remove(components, VBComponentsEventsGuid, (int) ComponentEventDispId.ItemReloaded, _componentReloaded); - _handlers.Remove(components); + ComEventsHelper.Remove(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemAdded, _componentAdded); + ComEventsHelper.Remove(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemRemoved, _componentRemoved); + ComEventsHelper.Remove(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemRenamed, _componentRenamed); + ComEventsHelper.Remove(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemSelected, _componentSelected); + ComEventsHelper.Remove(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemActivated, _componentActivated); + ComEventsHelper.Remove(_components, VBComponentsEventsGuid, (int)ComponentEventDispId.ItemReloaded, _componentReloaded); + _components = null; } } } @@ -261,7 +262,10 @@ private static void OnComponentRenamed(VB.VBComponent vbComponent, string oldNam { var component = new VBComponent(vbComponent); var project = component.Collection.Parent; - handler.Invoke(component, new ComponentRenamedEventArgs(project.ProjectId, project, new VBComponent(vbComponent), oldName)); + if (project.Protection != ProjectProtection.Locked) + { + handler.Invoke(component, new ComponentRenamedEventArgs(project.ProjectId, project, new VBComponent(vbComponent), oldName)); + } } } @@ -296,7 +300,10 @@ private static void OnDispatch(EventHandler dispatched, VB.V { var component = new VBComponent(vbComponent); var project = component.Collection.Parent; - handler.Invoke(component, new ComponentEventArgs(project.ProjectId, project, component)); + if (project.Protection != ProjectProtection.Locked) + { + handler.Invoke(component, new ComponentEventArgs(project.ProjectId, project, component)); + } } } diff --git a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs index f28c223937..8299b6f749 100644 --- a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs +++ b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs @@ -84,7 +84,6 @@ public override void Release(bool final = false) { if (!IsWrappingNullReference) { - DetatchEvents(); for (var i = 1; i <= Count; i++) { this[i].Release(); @@ -111,10 +110,9 @@ public override int GetHashCode() #region Events - private static bool _eventsAttached; private static void AttachEvents() { - if (!_eventsAttached) + if (_projects != null) { _projectAdded = OnProjectAdded; _projectRemoved = OnProjectRemoved; @@ -124,19 +122,18 @@ private static void AttachEvents() ComEventsHelper.Combine(_projects, VBProjectsEventsGuid, (int)ProjectEventDispId.ItemRemoved, _projectRemoved); ComEventsHelper.Combine(_projects, VBProjectsEventsGuid, (int)ProjectEventDispId.ItemRenamed, _projectRenamed); ComEventsHelper.Combine(_projects, VBProjectsEventsGuid, (int)ProjectEventDispId.ItemActivated, _projectActivated); - _eventsAttached = true; } } - private static void DetatchEvents() + internal static void DetatchEvents() { - if (!_eventsAttached && _projects != null) + if (_projects != null) { ComEventsHelper.Remove(_projects, VBProjectsEventsGuid, (int)ProjectEventDispId.ItemAdded, _projectAdded); ComEventsHelper.Remove(_projects, VBProjectsEventsGuid, (int)ProjectEventDispId.ItemRemoved, _projectRemoved); ComEventsHelper.Remove(_projects, VBProjectsEventsGuid, (int)ProjectEventDispId.ItemRenamed, _projectRenamed); ComEventsHelper.Remove(_projects, VBProjectsEventsGuid, (int)ProjectEventDispId.ItemActivated, _projectActivated); - _eventsAttached = false; + _projects = null; } } From 96eca0cf67d7e4104c5c6585f6bd0f870a3105ac Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 19:42:22 -0600 Subject: [PATCH 06/31] Disable logging to the system logs. Closes #2739 --- RetailCoder.VBE/NLog.dll.nlog | 6 ------ 1 file changed, 6 deletions(-) diff --git a/RetailCoder.VBE/NLog.dll.nlog b/RetailCoder.VBE/NLog.dll.nlog index 75d4c62d25..fa23a04eea 100644 --- a/RetailCoder.VBE/NLog.dll.nlog +++ b/RetailCoder.VBE/NLog.dll.nlog @@ -16,12 +16,6 @@ deleteOldFileOnStartup="true" keepFileOpen="false" encoding="UTF-8"/> - - Date: Fri, 24 Feb 2017 21:18:29 -0600 Subject: [PATCH 07/31] Missed a line removing the system logging. --- RetailCoder.VBE/NLog.dll.nlog | 1 - 1 file changed, 1 deletion(-) diff --git a/RetailCoder.VBE/NLog.dll.nlog b/RetailCoder.VBE/NLog.dll.nlog index fa23a04eea..fc4754b4ed 100644 --- a/RetailCoder.VBE/NLog.dll.nlog +++ b/RetailCoder.VBE/NLog.dll.nlog @@ -23,7 +23,6 @@ - From 16f698a829197a929c7ab2584ac66b51c09f0909 Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 21:52:15 -0600 Subject: [PATCH 08/31] Replace manual filepath parsing with Path statics. --- .../SourceControlViewViewModel.cs | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs index e66e2feec4..00c810a235 100644 --- a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs @@ -129,7 +129,7 @@ private void ComponentAdded(object sender, ComponentEventArgs e) } Logger.Trace("Component {0} added", e.Component.Name); - var fileStatus = Provider.Status().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == e.Component.Name); + var fileStatus = Provider.Status().SingleOrDefault(stat => Path.GetFileNameWithoutExtension(stat.FilePath) == e.Component.Name); if (fileStatus != null) { Provider.AddFile(fileStatus.FilePath); @@ -146,7 +146,7 @@ private void ComponentRemoved(object sender, ComponentEventArgs e) } Logger.Trace("Component {0] removed", e.Component.Name); - var fileStatus = Provider.Status().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == e.Component.Name); + var fileStatus = Provider.Status().SingleOrDefault(stat => Path.GetFileNameWithoutExtension(stat.FilePath) == e.Component.Name); if (fileStatus != null) { Provider.RemoveFile(fileStatus.FilePath, true); @@ -163,16 +163,16 @@ private void ComponentRenamed(object sender, ComponentRenamedEventArgs e) } Logger.Trace("Component {0} renamed to {1}", e.OldName, e.Component.Name); - var fileStatus = Provider.LastKnownStatus().SingleOrDefault(stat => stat.FilePath.Split('.')[0] == e.OldName); + var fileStatus = Provider.LastKnownStatus().SingleOrDefault(stat => Path.GetFileNameWithoutExtension(stat.FilePath) == e.OldName); if (fileStatus != null) { var directory = Provider.CurrentRepository.LocalLocation; - directory += directory.EndsWith("\\") ? string.Empty : "\\"; + directory += directory.EndsWith(@"\") ? string.Empty : @"\"; - var fileExt = "." + fileStatus.FilePath.Split('.').Last(); + var fileExt = "." + Path.GetExtension(fileStatus.FilePath); _fileSystemWatcher.EnableRaisingEvents = false; - File.Move(directory + fileStatus.FilePath, directory + e.Component.Name + fileExt); + File.Move(Path.Combine(directory, fileStatus.FilePath), Path.Combine(directory, e.Component.Name + fileExt)); _fileSystemWatcher.EnableRaisingEvents = true; Provider.RemoveFile(e.OldName + fileExt, false); @@ -260,7 +260,7 @@ public ISourceControlProvider Provider private void _fileSystemWatcher_Changed(object sender, FileSystemEventArgs e) { // the file system filter doesn't support multiple filters - if (!VbFileExtensions.Contains(e.Name.Split('.').Last())) + if (!VbFileExtensions.Contains(Path.GetExtension(e.Name))) { return; } @@ -282,7 +282,7 @@ private void _fileSystemWatcher_Changed(object sender, FileSystemEventArgs e) private void _fileSystemWatcher_Renamed(object sender, RenamedEventArgs e) { // the file system filter doesn't support multiple filters - if (!VbFileExtensions.Contains(e.Name.Split('.').Last())) + if (!VbFileExtensions.Contains(Path.GetExtension(e.Name))) { return; } @@ -327,7 +327,7 @@ private void _fileSystemWatcher_Deleted(object sender, FileSystemEventArgs e) private void _fileSystemWatcher_Created(object sender, FileSystemEventArgs e) { // the file system filter doesn't support multiple filters - if (!VbFileExtensions.Contains(e.Name.Split('.').Last())) + if (!VbFileExtensions.Contains(Path.GetExtension(e.Name))) { return; } @@ -438,9 +438,10 @@ public string CloneRemotePath if (_cloneRemotePath != value) { _cloneRemotePath = value; + //TODO LocalDirectory = _config.DefaultRepositoryLocation + - (_config.DefaultRepositoryLocation.EndsWith("\\") ? string.Empty : "\\") + + (_config.DefaultRepositoryLocation.EndsWith(@"\") ? string.Empty : @"\") + _cloneRemotePath.Split('/').Last().Replace(".git", string.Empty); OnPropertyChanged(); @@ -535,7 +536,7 @@ public BitmapImage ErrorIcon get { return _errorIcon; } set { - if (_errorIcon != value) + if (!Equals(_errorIcon, value)) { _errorIcon = value; OnPropertyChanged(); From 587217f09fbccb1687baa1f62d43940573c82228 Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 21:58:06 -0600 Subject: [PATCH 09/31] R#'d file. --- .../UI/SourceControl/SourceControlViewViewModel.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs index 00c810a235..8d81c157b4 100644 --- a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs @@ -17,6 +17,7 @@ using Rubberduck.VBEditor.Events; using Rubberduck.VBEditor.SafeComWrappers.Abstract; using resx = Rubberduck.UI.SourceControl.SourceControl; +// ReSharper disable ExplicitCallerInfoArgument namespace Rubberduck.UI.SourceControl { @@ -438,7 +439,6 @@ public string CloneRemotePath if (_cloneRemotePath != value) { _cloneRemotePath = value; - //TODO LocalDirectory = _config.DefaultRepositoryLocation + (_config.DefaultRepositoryLocation.EndsWith(@"\") ? string.Empty : @"\") + @@ -747,7 +747,7 @@ private void OpenRepo() } } - private bool _isCloning = false; + private bool _isCloning; private void CloneRepo(SecureCredentials credentials = null) { _isCloning = true; @@ -770,7 +770,7 @@ private void CloneRepo(SecureCredentials credentials = null) catch (SourceControlException ex) { const string unauthorizedMessage = "Request failed with status code: 401"; - if (ex.InnerException.Message != unauthorizedMessage) + if (ex.InnerException != null && ex.InnerException.Message != unauthorizedMessage) { _isCloning = false; } From 771bde1d3ab4604b93737abb1e617813f3d4ae18 Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 22:10:04 -0600 Subject: [PATCH 10/31] Make branch name rule more complete, convert to regular expression. --- .../UI/SourceControl/BranchesViewViewModel.cs | 42 +++---------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs index edd8c25155..89ae72d5e4 100644 --- a/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; using NLog; using Rubberduck.SourceControl; using Rubberduck.UI.Command; @@ -219,45 +220,12 @@ public string NewBranchName } } - public bool IsNotValidBranchName - { - get { return !IsValidBranchName(NewBranchName); } - } + // Courtesy of http://stackoverflow.com/a/12093994/4088852 + private static readonly Regex ValidBranchNameRegex = new Regex(@"^(?!@$|build-|/|.*([/.]\.|//|@\{|\\))[^\000-\037\177 ~^:?*[]+/[^\000-\037\177 ~^:?*[]+(? Date: Fri, 24 Feb 2017 22:19:05 -0600 Subject: [PATCH 11/31] More manual filepath replacements. --- RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs | 8 ++------ .../UI/SourceControl/SourceControlViewViewModel.cs | 8 +------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs index ef2986b711..b36369e863 100644 --- a/RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs @@ -1,5 +1,6 @@ using System; using System.Collections.ObjectModel; +using System.IO; using System.Linq; using NLog; using Rubberduck.SourceControl; @@ -148,12 +149,7 @@ private void UndoChanges(IFileStatusEntry fileStatusEntry) try { - var localLocation = Provider.CurrentRepository.LocalLocation.EndsWith("\\") - ? Provider.CurrentRepository.LocalLocation - : Provider.CurrentRepository.LocalLocation + "\\"; - - Provider.Undo(localLocation + fileStatusEntry.FilePath); - + Provider.Undo(Path.Combine(Provider.CurrentRepository.LocalLocation, fileStatusEntry.FilePath)); RefreshView(); } catch (SourceControlException ex) diff --git a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs index 8d81c157b4..b9ae17a265 100644 --- a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs @@ -168,8 +168,6 @@ private void ComponentRenamed(object sender, ComponentRenamedEventArgs e) if (fileStatus != null) { var directory = Provider.CurrentRepository.LocalLocation; - directory += directory.EndsWith(@"\") ? string.Empty : @"\"; - var fileExt = "." + Path.GetExtension(fileStatus.FilePath); _fileSystemWatcher.EnableRaisingEvents = false; @@ -439,11 +437,7 @@ public string CloneRemotePath if (_cloneRemotePath != value) { _cloneRemotePath = value; - LocalDirectory = - _config.DefaultRepositoryLocation + - (_config.DefaultRepositoryLocation.EndsWith(@"\") ? string.Empty : @"\") + - _cloneRemotePath.Split('/').Last().Replace(".git", string.Empty); - + LocalDirectory = Path.Combine(_config.DefaultRepositoryLocation, _cloneRemotePath.Split('/').Last().Replace(".git", string.Empty)); OnPropertyChanged(); OnPropertyChanged("IsNotValidCloneRemotePath"); } From 7dc5c48831608de4042b826ed910a47a73c98e0f Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 22:45:00 -0600 Subject: [PATCH 12/31] Use default repository directory from settings. Closes #2726 --- RetailCoder.VBE/UI/FileBrowserDialogFactory.cs | 4 ++-- RetailCoder.VBE/UI/FolderBrowser.cs | 14 +++++++------- RetailCoder.VBE/UI/ModernFolderBrowser.cs | 12 ++++++------ .../UI/SourceControl/BranchesViewViewModel.cs | 2 +- .../SourceControl/SourceControlViewViewModel.cs | 17 ++++++++++++++--- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs b/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs index 582235f907..0bc51e3c1c 100644 --- a/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs +++ b/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs @@ -9,7 +9,7 @@ public interface IFolderBrowserFactory IFolderBrowser CreateFolderBrowser(string description, bool showNewFolderButton); IFolderBrowser CreateFolderBrowser(string description, bool showNewFolderButton, - Environment.SpecialFolder rootFolder); + string rootFolder); } public class DialogFactory : IFolderBrowserFactory @@ -30,7 +30,7 @@ public IFolderBrowser CreateFolderBrowser(string description, bool showNewFolder : new FolderBrowser(description, showNewFolderButton); } - public IFolderBrowser CreateFolderBrowser(string description, bool showNewFolderButton, Environment.SpecialFolder rootFolder) + public IFolderBrowser CreateFolderBrowser(string description, bool showNewFolderButton, string rootFolder) { return !OldSchool ? new ModernFolderBrowser(description, showNewFolderButton, rootFolder) as IFolderBrowser diff --git a/RetailCoder.VBE/UI/FolderBrowser.cs b/RetailCoder.VBE/UI/FolderBrowser.cs index 7984fcc7dc..cefa3116b2 100644 --- a/RetailCoder.VBE/UI/FolderBrowser.cs +++ b/RetailCoder.VBE/UI/FolderBrowser.cs @@ -7,7 +7,7 @@ public interface IFolderBrowser : IDisposable { string Description { get; set; } bool ShowNewFolderButton { get; set; } - Environment.SpecialFolder RootFolder { get; set; } + string RootFolder { get; set; } string SelectedPath { get; set; } DialogResult ShowDialog(); } @@ -16,18 +16,18 @@ public class FolderBrowser : IFolderBrowser { private readonly FolderBrowserDialog _dialog; - public FolderBrowser(string description, bool showNewFolderButton, Environment.SpecialFolder rootFolder) + public FolderBrowser(string description, bool showNewFolderButton, string rootFolder) { _dialog = new FolderBrowserDialog { Description = description, - RootFolder = rootFolder, + SelectedPath = rootFolder, ShowNewFolderButton = showNewFolderButton }; } public FolderBrowser(string description, bool showNewFolderButton) - :this(description, showNewFolderButton, Environment.SpecialFolder.MyComputer) + : this(description, showNewFolderButton, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) { } public FolderBrowser(string description) @@ -46,10 +46,10 @@ public bool ShowNewFolderButton set { _dialog.ShowNewFolderButton = value; } } - public Environment.SpecialFolder RootFolder + public string RootFolder { - get { return _dialog.RootFolder; } - set { _dialog.RootFolder = value; } + get { return _dialog.SelectedPath; } + set { _dialog.SelectedPath = value; } } public string SelectedPath diff --git a/RetailCoder.VBE/UI/ModernFolderBrowser.cs b/RetailCoder.VBE/UI/ModernFolderBrowser.cs index 754ee09d59..c6dbec3593 100644 --- a/RetailCoder.VBE/UI/ModernFolderBrowser.cs +++ b/RetailCoder.VBE/UI/ModernFolderBrowser.cs @@ -36,13 +36,13 @@ public class ModernFolderBrowser : IFolderBrowser private readonly object _newDialog; // ReSharper disable once UnusedParameter.Local - public ModernFolderBrowser(string description, bool showNewFolderButton, Environment.SpecialFolder rootFolder) + public ModernFolderBrowser(string description, bool showNewFolderButton, string rootFolder) { _root = rootFolder; _dialog = new System.Windows.Forms.OpenFileDialog { Title = description, - InitialDirectory = Environment.GetFolderPath(_root), + InitialDirectory = _root, // ReSharper disable once LocalizableElement Filter = "Folders|\n", AddExtension = false, @@ -57,7 +57,7 @@ public ModernFolderBrowser(string description, bool showNewFolderButton, Environ } public ModernFolderBrowser(string description, bool showNewFolderButton) - : this(description, showNewFolderButton, Environment.SpecialFolder.MyDocuments) + : this(description, showNewFolderButton, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) { } public ModernFolderBrowser(string description) : this(description, true) { } @@ -75,14 +75,14 @@ public bool ShowNewFolderButton set { } } - private Environment.SpecialFolder _root; - public Environment.SpecialFolder RootFolder + private string _root; + public string RootFolder { get { return _root; } set { _root = value; - _dialog.InitialDirectory = Environment.GetFolderPath(_root); + _dialog.InitialDirectory = _root; } } diff --git a/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs index 89ae72d5e4..37240e9319 100644 --- a/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs @@ -225,7 +225,7 @@ public string NewBranchName public bool IsNotValidBranchName { - get { return !ValidBranchNameRegex.IsMatch(NewBranchName); } + get { return string.IsNullOrEmpty(NewBranchName) || !ValidBranchNameRegex.IsMatch(NewBranchName); } } private bool _displayMergeBranchesGrid; diff --git a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs index b9ae17a265..962981b674 100644 --- a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs @@ -623,7 +623,7 @@ public void CreateProviderWithCredentials(SecureCredentials credentials) private void InitRepo() { - using (var folderPicker = _folderBrowserFactory.CreateFolderBrowser((RubberduckUI.SourceControl_CreateNewRepo))) + using (var folderPicker = _folderBrowserFactory.CreateFolderBrowser(RubberduckUI.SourceControl_CreateNewRepo, false, GetDefaultRepoFolderOrDefault())) { if (folderPicker.ShowDialog() != DialogResult.OK) { @@ -703,7 +703,7 @@ private void AddOrUpdateLocalPathConfig(Repository repo) private void OpenRepo() { - using (var folderPicker = _folderBrowserFactory.CreateFolderBrowser(RubberduckUI.SourceControl_OpenWorkingDirectory, false)) + using (var folderPicker = _folderBrowserFactory.CreateFolderBrowser(RubberduckUI.SourceControl_OpenWorkingDirectory, false, GetDefaultRepoFolderOrDefault())) { if (folderPicker.ShowDialog() != DialogResult.OK) { @@ -937,9 +937,20 @@ private bool ValidRepoExists() return false; } + private string GetDefaultRepoFolderOrDefault() + { + var settings = _configService.Create(); + var folder = settings.DefaultRepositoryLocation; + if (string.IsNullOrEmpty(folder)) + { + folder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + } + return folder; + } + private void ShowFilePicker() { - using (var folderPicker = _folderBrowserFactory.CreateFolderBrowser("Default Repository Directory")) + using (var folderPicker = _folderBrowserFactory.CreateFolderBrowser("Default Repository Directory", true, GetDefaultRepoFolderOrDefault())) { if (folderPicker.ShowDialog() == DialogResult.OK) { From 12d625b88ce337d2cab33c34f5a2081a54a1b7b4 Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 22:58:30 -0600 Subject: [PATCH 13/31] Select path delimiter based on local network v. non-local network. --- .../UI/SourceControl/SourceControlViewViewModel.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs index 962981b674..a9ed7add3a 100644 --- a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs @@ -6,6 +6,7 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using System.Windows.Forms; using System.Windows.Media.Imaging; using NLog; @@ -428,6 +429,8 @@ public bool DisplayPublishRepoGrid } } + private static readonly Regex LocalFileSystemOrNetworkPathRegex = new Regex(@"^([A-Z]:|\\).*"); + private string _cloneRemotePath; public string CloneRemotePath { @@ -437,7 +440,8 @@ public string CloneRemotePath if (_cloneRemotePath != value) { _cloneRemotePath = value; - LocalDirectory = Path.Combine(_config.DefaultRepositoryLocation, _cloneRemotePath.Split('/').Last().Replace(".git", string.Empty)); + var delimiter = LocalFileSystemOrNetworkPathRegex.IsMatch(_config.DefaultRepositoryLocation) ? '\\' : '/'; + LocalDirectory = Path.Combine(_config.DefaultRepositoryLocation, _cloneRemotePath.Split(delimiter).Last().Replace(".git", string.Empty)); OnPropertyChanged(); OnPropertyChanged("IsNotValidCloneRemotePath"); } From 97cbcd060a4b033694de82f342a21c8f6ec18f7e Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 23:03:47 -0600 Subject: [PATCH 14/31] Split the correct path string for CloneRemotePath... --- RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs index a9ed7add3a..27e29e2c91 100644 --- a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs @@ -440,7 +440,7 @@ public string CloneRemotePath if (_cloneRemotePath != value) { _cloneRemotePath = value; - var delimiter = LocalFileSystemOrNetworkPathRegex.IsMatch(_config.DefaultRepositoryLocation) ? '\\' : '/'; + var delimiter = LocalFileSystemOrNetworkPathRegex.IsMatch(_cloneRemotePath) ? '\\' : '/'; LocalDirectory = Path.Combine(_config.DefaultRepositoryLocation, _cloneRemotePath.Split(delimiter).Last().Replace(".git", string.Empty)); OnPropertyChanged(); OnPropertyChanged("IsNotValidCloneRemotePath"); From f2c7576cc7592d43c151f5ac4bfeb8433a126c2c Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 23:04:25 -0600 Subject: [PATCH 15/31] Remove retun from WndProc - WM_DESTROY needs to reach base. --- RetailCoder.VBE/UI/DockableWindowHost.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/RetailCoder.VBE/UI/DockableWindowHost.cs b/RetailCoder.VBE/UI/DockableWindowHost.cs index d7239a710f..e0a8e06ec3 100644 --- a/RetailCoder.VBE/UI/DockableWindowHost.cs +++ b/RetailCoder.VBE/UI/DockableWindowHost.cs @@ -147,7 +147,6 @@ protected override void DefWndProc(ref Message m) if (m.Msg == (int) WM.DESTROY) { _thisHandle.Free(); - return; } base.DefWndProc(ref m); } From 3a111740c3a8977c87379e706176c9defb08f498 Mon Sep 17 00:00:00 2001 From: comintern Date: Fri, 24 Feb 2017 23:53:07 -0600 Subject: [PATCH 16/31] Add comments for R# suppressions. --- RetailCoder.VBE/UI/ModernFolderBrowser.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RetailCoder.VBE/UI/ModernFolderBrowser.cs b/RetailCoder.VBE/UI/ModernFolderBrowser.cs index c6dbec3593..4864059a20 100644 --- a/RetailCoder.VBE/UI/ModernFolderBrowser.cs +++ b/RetailCoder.VBE/UI/ModernFolderBrowser.cs @@ -29,13 +29,12 @@ public class ModernFolderBrowser : IFolderBrowser private static readonly ConstructorInfo VistaDialogEventsCtor = VistaDialogEvents.GetConstructors().SingleOrDefault(); private static readonly MethodInfo IFileDialogAdvise = IFileDialog.GetMethod("Advise", DefaultBindingFlags); private static readonly MethodInfo IFileDialogUnadvise = IFileDialog.GetMethod("Unadvise", DefaultBindingFlags); - // ReSharper restore InconsistentNaming private readonly System.Windows.Forms.OpenFileDialog _dialog; private readonly object _newDialog; - // ReSharper disable once UnusedParameter.Local + // ReSharper disable once UnusedParameter.Local - new folder button suppression isn't supported in this dialog. public ModernFolderBrowser(string description, bool showNewFolderButton, string rootFolder) { _root = rootFolder; @@ -43,7 +42,7 @@ public ModernFolderBrowser(string description, bool showNewFolderButton, string { Title = description, InitialDirectory = _root, - // ReSharper disable once LocalizableElement + // ReSharper disable once LocalizableElement - This is an API keyword. Filter = "Folders|\n", AddExtension = false, CheckFileExists = false, @@ -68,6 +67,7 @@ public string Description set { _dialog.Title = value; } } + //Does nothing - new folder button suppression isn't supported in this dialog. public bool ShowNewFolderButton { get { return true; } From b78e8bf91125f08b2e22fcf6740f0abf719d4c79 Mon Sep 17 00:00:00 2001 From: comintern Date: Sat, 25 Feb 2017 01:35:52 -0600 Subject: [PATCH 17/31] Fix unicode escapes in regex, remove multi-level requirement. --- RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs index 37240e9319..28e620ac92 100644 --- a/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/BranchesViewViewModel.cs @@ -220,8 +220,8 @@ public string NewBranchName } } - // Courtesy of http://stackoverflow.com/a/12093994/4088852 - private static readonly Regex ValidBranchNameRegex = new Regex(@"^(?!@$|build-|/|.*([/.]\.|//|@\{|\\))[^\000-\037\177 ~^:?*[]+/[^\000-\037\177 ~^:?*[]+(? Date: Sat, 25 Feb 2017 01:36:43 -0600 Subject: [PATCH 18/31] Fix bad file path construction for Undo. --- RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs index b36369e863..05dc834686 100644 --- a/RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/ChangesViewViewModel.cs @@ -1,5 +1,6 @@ using System; using System.Collections.ObjectModel; +using System.Diagnostics; using System.IO; using System.Linq; using NLog; @@ -149,7 +150,9 @@ private void UndoChanges(IFileStatusEntry fileStatusEntry) try { - Provider.Undo(Path.Combine(Provider.CurrentRepository.LocalLocation, fileStatusEntry.FilePath)); + var file = Path.GetFileName(fileStatusEntry.FilePath); + Debug.Assert(!string.IsNullOrEmpty(file)); + Provider.Undo(Path.Combine(Provider.CurrentRepository.LocalLocation, file)); RefreshView(); } catch (SourceControlException ex) From 5346f62f4035bc0ad6ee55f9f379501d9b2a1a10 Mon Sep 17 00:00:00 2001 From: comintern Date: Sat, 25 Feb 2017 01:37:45 -0600 Subject: [PATCH 19/31] Wrap Environment to support testing, add trys. --- RetailCoder.VBE/Rubberduck.csproj | 1 + RetailCoder.VBE/UI/EnvironmentProvider.cs | 22 +++++++++++ .../UI/FileBrowserDialogFactory.cs | 38 ++++++++++++------- RetailCoder.VBE/UI/FolderBrowser.cs | 12 +++--- RetailCoder.VBE/UI/ModernFolderBrowser.cs | 10 +++-- .../SourceControlViewViewModel.cs | 14 ++++++- 6 files changed, 73 insertions(+), 24 deletions(-) create mode 100644 RetailCoder.VBE/UI/EnvironmentProvider.cs diff --git a/RetailCoder.VBE/Rubberduck.csproj b/RetailCoder.VBE/Rubberduck.csproj index 2959822a3a..c80f9af936 100644 --- a/RetailCoder.VBE/Rubberduck.csproj +++ b/RetailCoder.VBE/Rubberduck.csproj @@ -467,6 +467,7 @@ + diff --git a/RetailCoder.VBE/UI/EnvironmentProvider.cs b/RetailCoder.VBE/UI/EnvironmentProvider.cs new file mode 100644 index 0000000000..4593eb387e --- /dev/null +++ b/RetailCoder.VBE/UI/EnvironmentProvider.cs @@ -0,0 +1,22 @@ +using System; + +namespace Rubberduck.UI +{ + public interface IEnvironmentProvider + { + string GetFolderPath(Environment.SpecialFolder folder); + // ReSharper disable once InconsistentNaming + OperatingSystem OSVersion { get; } + } + + //Wrapper to enable unit testing of folder dialogs. + public class EnvironmentProvider : IEnvironmentProvider + { + public string GetFolderPath(Environment.SpecialFolder folder) + { + return Environment.GetFolderPath(folder); + } + + public OperatingSystem OSVersion { get { return Environment.OSVersion; } } + } +} diff --git a/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs b/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs index 0bc51e3c1c..5356d96741 100644 --- a/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs +++ b/RetailCoder.VBE/UI/FileBrowserDialogFactory.cs @@ -1,6 +1,4 @@ -using System; - -namespace Rubberduck.UI +namespace Rubberduck.UI { public interface IFolderBrowserFactory { @@ -14,27 +12,41 @@ public interface IFolderBrowserFactory public class DialogFactory : IFolderBrowserFactory { - private static readonly bool OldSchool = Environment.OSVersion.Version.Major < 6; + private readonly IEnvironmentProvider _environment; + private readonly bool _oldSchool; + + public DialogFactory(IEnvironmentProvider environment) + { + _environment = environment; + try + { + _oldSchool = _environment.OSVersion.Version.Major < 6; + } + catch + { + // ignored - fall back to "safe" dialog version. + } + } public IFolderBrowser CreateFolderBrowser(string description) { - return !OldSchool - ? new ModernFolderBrowser(description) as IFolderBrowser - : new FolderBrowser(description); + return !_oldSchool + ? new ModernFolderBrowser(_environment, description) as IFolderBrowser + : new FolderBrowser(_environment, description); } public IFolderBrowser CreateFolderBrowser(string description, bool showNewFolderButton) { - return !OldSchool - ? new ModernFolderBrowser(description, showNewFolderButton) as IFolderBrowser - : new FolderBrowser(description, showNewFolderButton); + return !_oldSchool + ? new ModernFolderBrowser(_environment, description, showNewFolderButton) as IFolderBrowser + : new FolderBrowser(_environment, description, showNewFolderButton); } public IFolderBrowser CreateFolderBrowser(string description, bool showNewFolderButton, string rootFolder) { - return !OldSchool - ? new ModernFolderBrowser(description, showNewFolderButton, rootFolder) as IFolderBrowser - : new FolderBrowser(description, showNewFolderButton, rootFolder); + return !_oldSchool + ? new ModernFolderBrowser(_environment, description, showNewFolderButton, rootFolder) as IFolderBrowser + : new FolderBrowser(_environment, description, showNewFolderButton, rootFolder); } } } diff --git a/RetailCoder.VBE/UI/FolderBrowser.cs b/RetailCoder.VBE/UI/FolderBrowser.cs index cefa3116b2..118217b5cc 100644 --- a/RetailCoder.VBE/UI/FolderBrowser.cs +++ b/RetailCoder.VBE/UI/FolderBrowser.cs @@ -15,9 +15,11 @@ public interface IFolderBrowser : IDisposable public class FolderBrowser : IFolderBrowser { private readonly FolderBrowserDialog _dialog; + private readonly IEnvironmentProvider _environment; - public FolderBrowser(string description, bool showNewFolderButton, string rootFolder) + public FolderBrowser(IEnvironmentProvider environment, string description, bool showNewFolderButton, string rootFolder) { + _environment = environment; _dialog = new FolderBrowserDialog { Description = description, @@ -26,12 +28,12 @@ public FolderBrowser(string description, bool showNewFolderButton, string rootFo }; } - public FolderBrowser(string description, bool showNewFolderButton) - : this(description, showNewFolderButton, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) + public FolderBrowser(IEnvironmentProvider environment, string description, bool showNewFolderButton) + : this(environment, description, showNewFolderButton, environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) { } - public FolderBrowser(string description) - : this(description, true) + public FolderBrowser(IEnvironmentProvider environment, string description) + : this(environment, description, true) { } public string Description diff --git a/RetailCoder.VBE/UI/ModernFolderBrowser.cs b/RetailCoder.VBE/UI/ModernFolderBrowser.cs index 4864059a20..1eb19780a1 100644 --- a/RetailCoder.VBE/UI/ModernFolderBrowser.cs +++ b/RetailCoder.VBE/UI/ModernFolderBrowser.cs @@ -33,10 +33,12 @@ public class ModernFolderBrowser : IFolderBrowser private readonly System.Windows.Forms.OpenFileDialog _dialog; private readonly object _newDialog; + private readonly IEnvironmentProvider _environment; // ReSharper disable once UnusedParameter.Local - new folder button suppression isn't supported in this dialog. - public ModernFolderBrowser(string description, bool showNewFolderButton, string rootFolder) + public ModernFolderBrowser(IEnvironmentProvider environment, string description, bool showNewFolderButton, string rootFolder) { + _environment = environment; _root = rootFolder; _dialog = new System.Windows.Forms.OpenFileDialog { @@ -55,11 +57,11 @@ public ModernFolderBrowser(string description, bool showNewFolderButton, string IFileDialogSetOptions.Invoke(_newDialog, new object[] { options }); } - public ModernFolderBrowser(string description, bool showNewFolderButton) - : this(description, showNewFolderButton, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) + public ModernFolderBrowser(IEnvironmentProvider environment, string description, bool showNewFolderButton) + : this(environment, description, showNewFolderButton, environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) { } - public ModernFolderBrowser(string description) : this(description, true) { } + public ModernFolderBrowser(IEnvironmentProvider environment, string description) : this(environment, description, true) { } public string Description { diff --git a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs index 27e29e2c91..45ae493246 100644 --- a/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs +++ b/RetailCoder.VBE/UI/SourceControl/SourceControlViewViewModel.cs @@ -38,6 +38,7 @@ public sealed class SourceControlViewViewModel : ViewModelBase, IDisposable private readonly IFolderBrowserFactory _folderBrowserFactory; private readonly IConfigProvider _configService; private readonly IMessageBox _messageBox; + private readonly IEnvironmentProvider _environment; private readonly FileSystemWatcher _fileSystemWatcher; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); private static readonly IEnumerable VbFileExtensions = new[] { "cls", "bas", "frm" }; @@ -51,7 +52,8 @@ public sealed class SourceControlViewViewModel : ViewModelBase, IDisposable IFolderBrowserFactory folderBrowserFactory, IConfigProvider configService, IEnumerable views, - IMessageBox messageBox) + IMessageBox messageBox, + IEnvironmentProvider environment) { _vbe = vbe; _state = state; @@ -63,6 +65,7 @@ public sealed class SourceControlViewViewModel : ViewModelBase, IDisposable _configService = configService; _config = _configService.Create(); _messageBox = messageBox; + _environment = environment; _initRepoCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), _ => InitRepo(), _ => _vbe.VBProjects.Count != 0); _openRepoCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), _ => OpenRepo(), _ => _vbe.VBProjects.Count != 0); @@ -947,7 +950,14 @@ private string GetDefaultRepoFolderOrDefault() var folder = settings.DefaultRepositoryLocation; if (string.IsNullOrEmpty(folder)) { - folder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + try + { + folder = _environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + } + catch + { + // ignored - empty is fine if the environment call fails. + } } return folder; } From cf8001a19f76d05f1f8abee410f0394054f4a83a Mon Sep 17 00:00:00 2001 From: comintern Date: Sat, 25 Feb 2017 01:38:53 -0600 Subject: [PATCH 20/31] Rearrange mocks. --- .../SourceControlViewModelTests.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/RubberduckTests/SourceControl/SourceControlViewModelTests.cs b/RubberduckTests/SourceControl/SourceControlViewModelTests.cs index 0e303c8990..aef0416fcb 100644 --- a/RubberduckTests/SourceControl/SourceControlViewModelTests.cs +++ b/RubberduckTests/SourceControl/SourceControlViewModelTests.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Collections.ObjectModel; using System.Security; using System.Windows.Forms; @@ -10,7 +11,6 @@ using Rubberduck.UI; using Rubberduck.UI.SourceControl; using Rubberduck.VBEditor.Application; -using Rubberduck.VBEditor.Events; using Rubberduck.VBEditor.SafeComWrappers; using Rubberduck.VBEditor.SafeComWrappers.Abstract; using RubberduckTests.Mocks; @@ -60,7 +60,8 @@ public void InitializeMocks() _folderBrowser = new Mock(); _folderBrowserFactory = new Mock(); _folderBrowserFactory.Setup(f => f.CreateFolderBrowser(It.IsAny())).Returns(_folderBrowser.Object); - _folderBrowserFactory.Setup(f => f.CreateFolderBrowser(It.IsAny(), false)).Returns(_folderBrowser.Object); + _folderBrowserFactory.Setup(f => f.CreateFolderBrowser(It.IsAny(), It.IsAny())).Returns(_folderBrowser.Object); + _folderBrowserFactory.Setup(f => f.CreateFolderBrowser(It.IsAny(), It.IsAny(), It.IsAny())).Returns(_folderBrowser.Object); var masterRemote = new Mock(); @@ -121,7 +122,7 @@ private void SetupVM() }; _vm = new SourceControlViewViewModel(_vbe.Object, new RubberduckParserState(_vbe.Object), _providerFactory.Object, _folderBrowserFactory.Object, - _configService.Object, views, new Mock().Object); + _configService.Object, views, new Mock().Object, GetDummyEnvironment()); } [TestCategory("SourceControl")] @@ -1050,7 +1051,7 @@ public void NullProject_DisplaysError() private SourceControlSettings GetDummyConfig() { - return new SourceControlSettings("username", "username@email.com", string.Empty, + return new SourceControlSettings("username", "username@email.com", @"C:\path\to", new List { GetDummyRepo() }, "ps.exe"); } @@ -1063,5 +1064,12 @@ private static Repository GetDummyRepo() @"https://github.com/ckuhn203/SourceControlTest.git" ); } + + private static IEnvironmentProvider GetDummyEnvironment() + { + var environment = new Mock(); + environment.Setup(e => e.GetFolderPath(Environment.SpecialFolder.MyDocuments)).Returns(@"C:\Users\Christopher\Documents"); + return environment.Object; + } } } From 601665cb425af428963bd9da40fb54cda6c5a5a7 Mon Sep 17 00:00:00 2001 From: comintern Date: Sat, 25 Feb 2017 01:39:22 -0600 Subject: [PATCH 21/31] Fix broken test that was testing broken behavior. --- RubberduckTests/SourceControl/ChangesViewModelTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RubberduckTests/SourceControl/ChangesViewModelTests.cs b/RubberduckTests/SourceControl/ChangesViewModelTests.cs index 154cc205f3..54f8029ebc 100644 --- a/RubberduckTests/SourceControl/ChangesViewModelTests.cs +++ b/RubberduckTests/SourceControl/ChangesViewModelTests.cs @@ -342,7 +342,7 @@ public void Undo_UndoesChanges() Provider = _provider.Object }; - var localLocation = "C:\\users\\desktop\\git\\"; + var localLocation = @"C:\users\desktop\git\"; _provider.Setup(git => git.Status()).Returns(fileStatusEntries); _provider.SetupGet(git => git.CurrentRepository).Returns(new Repository{LocalLocation = localLocation}); @@ -351,7 +351,7 @@ public void Undo_UndoesChanges() vm.UndoChangesToolbarButtonCommand.Execute(fileStatusEntries[0]); //Assert - _provider.Verify(git => git.Undo(localLocation + fileStatusEntries[0].FilePath)); + _provider.Verify(git => git.Undo(@"C:\users\desktop\git\module.bas")); } [TestCategory("SourceControl")] From 9d2c7798846c654fbfbe61b736a5d4b822e72055 Mon Sep 17 00:00:00 2001 From: comintern Date: Sat, 25 Feb 2017 13:56:54 -0600 Subject: [PATCH 22/31] Check for null project IDs before raising events with them. --- Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs index 8299b6f749..82be145b60 100644 --- a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs +++ b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs @@ -173,7 +173,7 @@ private static void OnProjectRenamed(VB.VBProject vbProject, string oldName) var projectId = project.ProjectId; var handler = ProjectRenamed; - if (handler != null) + if (handler != null && projectId != null) { handler(project, new ProjectRenamedEventArgs(projectId, project, oldName)); } @@ -201,7 +201,10 @@ private static void OnDispatch(EventHandler dispatched, VB.VBP project.AssignProjectId(); } var projectId = project.ProjectId; - handler.Invoke(project, new ProjectEventArgs(projectId, project)); + if (projectId != null) + { + handler.Invoke(project, new ProjectEventArgs(projectId, project)); + } } } From af3b2f3fb169b90f25ebbb29699030e862016ece Mon Sep 17 00:00:00 2001 From: comintern Date: Sat, 25 Feb 2017 14:43:23 -0600 Subject: [PATCH 23/31] Fix name validation for EncapsulateFieldDialog --- RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs index 55ef8e0b5e..9d50946c8e 100644 --- a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs +++ b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs @@ -171,7 +171,7 @@ private void ValidatePropertyName() { InvalidPropertyNameIcon.Visible = ValidateName(NewPropertyName, ParameterName) || _state.AllUserDeclarations.Where(a => a.ParentScope == TargetDeclaration.ParentScope) - .Any(a => a.IdentifierName == NewPropertyName); + .Any(a => a.IdentifierName.Equals(NewPropertyName, StringComparison.InvariantCultureIgnoreCase)); SetOkButtonEnabledState(); } @@ -188,8 +188,8 @@ private bool ValidateName(string changedName, string otherName) var tokenValues = typeof(Tokens).GetFields().Select(item => item.GetValue(null)).Cast().Select(item => item); return TargetDeclaration == null - || changedName == TargetDeclaration.IdentifierName - || changedName == otherName + || changedName.Equals(TargetDeclaration.IdentifierName, StringComparison.InvariantCultureIgnoreCase) + || changedName.Equals(otherName, StringComparison.InvariantCultureIgnoreCase) || !char.IsLetter(changedName.FirstOrDefault()) || tokenValues.Contains(ParameterName, StringComparer.InvariantCultureIgnoreCase) || changedName.Any(c => !char.IsLetterOrDigit(c) && c != '_'); From 23e4f6155ccdd7d2a85dbf0ddc1e62f335529297 Mon Sep 17 00:00:00 2001 From: comintern Date: Sat, 25 Feb 2017 16:20:03 -0600 Subject: [PATCH 24/31] Fix code writing logic in EncapsulateFieldDialog. Corrected Get for Variants with both Let and Set. Closes #2500 --- .../EncapsulateFieldPresenter.cs | 63 +++++------ .../IEncapsulateFieldDialog.cs | 4 +- .../UI/Refactorings/EncapsulateFieldDialog.cs | 104 +++++++++--------- 3 files changed, 81 insertions(+), 90 deletions(-) diff --git a/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldPresenter.cs b/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldPresenter.cs index 9b77def338..35792309ee 100644 --- a/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldPresenter.cs +++ b/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldPresenter.cs @@ -1,7 +1,9 @@ using System.Linq; using System.Windows.Forms; using Antlr4.Runtime; +using Rubberduck.Parsing; using Rubberduck.Parsing.Grammar; +using Rubberduck.Parsing.Symbols; namespace Rubberduck.Refactorings.EncapsulateField { @@ -21,22 +23,6 @@ public EncapsulateFieldPresenter(IEncapsulateFieldDialog view, EncapsulateFieldM _model = model; } - private static readonly string[] PrimitiveTypes = - { - Tokens.Boolean, - Tokens.Byte, - Tokens.Date, - Tokens.Decimal, - Tokens.Double, - Tokens.Long, - Tokens.LongLong, - Tokens.LongPtr, - Tokens.Integer, - Tokens.Single, - Tokens.String, - Tokens.StrPtr - }; - public EncapsulateFieldModel Show() { if (_model.TargetDeclaration == null) { return null; } @@ -44,19 +30,13 @@ public EncapsulateFieldModel Show() _view.TargetDeclaration = _model.TargetDeclaration; _view.NewPropertyName = _model.TargetDeclaration.IdentifierName; + var isVariant = _model.TargetDeclaration.AsTypeName.Equals(Tokens.Variant); + var isValueType = !isVariant && (SymbolList.ValueTypes.Contains(_model.TargetDeclaration.AsTypeName) || + _model.TargetDeclaration.DeclarationType == DeclarationType.Enumeration); + if (_model.TargetDeclaration.References.Any(r => r.IsAssignment)) { - if (PrimitiveTypes.Contains(_model.TargetDeclaration.AsTypeName)) - { - _view.MustImplementLetSetterType = true; - _view.CanImplementSetSetterType = false; - } - else if (_model.TargetDeclaration.AsTypeName != Tokens.Variant) - { - _view.MustImplementSetSetterType = true; - _view.CanImplementLetSetterType = false; - } - else + if (isVariant) { RuleContext node = _model.TargetDeclaration.References.First(r => r.IsAssignment).Context; while (!(node is VBAParser.LetStmtContext) && !(node is VBAParser.SetStmtContext)) @@ -66,25 +46,36 @@ public EncapsulateFieldModel Show() if (node is VBAParser.LetStmtContext) { - _view.MustImplementLetSetterType = true; - _view.CanImplementSetSetterType = false; + _view.CanImplementLetSetterType = true; } else { - _view.MustImplementSetSetterType = true; - _view.CanImplementLetSetterType = false; - } + _view.CanImplementSetSetterType = true; + } + } + else if (isValueType) + { + _view.CanImplementLetSetterType = true; + } + else + { + _view.CanImplementSetSetterType = true; } } else { - if (PrimitiveTypes.Contains(_model.TargetDeclaration.AsTypeName)) + if (isValueType) + { + _view.CanImplementLetSetterType = true; + } + else if (!isVariant) { - _view.CanImplementSetSetterType = false; + _view.CanImplementSetSetterType = true; } - else if (_model.TargetDeclaration.AsTypeName != Tokens.Variant) + else { - _view.CanImplementLetSetterType = false; + _view.CanImplementLetSetterType = true; + _view.CanImplementSetSetterType = true; } } diff --git a/RetailCoder.VBE/Refactorings/EncapsulateField/IEncapsulateFieldDialog.cs b/RetailCoder.VBE/Refactorings/EncapsulateField/IEncapsulateFieldDialog.cs index d9c989ee7c..6af187d3cd 100644 --- a/RetailCoder.VBE/Refactorings/EncapsulateField/IEncapsulateFieldDialog.cs +++ b/RetailCoder.VBE/Refactorings/EncapsulateField/IEncapsulateFieldDialog.cs @@ -11,8 +11,8 @@ public interface IEncapsulateFieldDialog :IDialogView bool CanImplementLetSetterType { get; set; } bool CanImplementSetSetterType { get; set; } - bool MustImplementLetSetterType { get; set; } - bool MustImplementSetSetterType { get; set; } + bool MustImplementLetSetterType { get; } + bool MustImplementSetSetterType { get; } string ParameterName { get; set; } } diff --git a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs index 9d50946c8e..241b1d7295 100644 --- a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs +++ b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs @@ -29,56 +29,18 @@ public string ParameterName public Declaration TargetDeclaration { get; set; } - public bool CanImplementLetSetterType - { - get { return LetSetterTypeCheckBox.Enabled; } - set - { - if (!value) - { - LetSetterTypeCheckBox.Checked = false; - } - LetSetterTypeCheckBox.Enabled = value; - } - } + public bool CanImplementLetSetterType { get; set; } - public bool CanImplementSetSetterType - { - get { return SetSetterTypeCheckBox.Enabled; } - set - { - if (!value) - { - SetSetterTypeCheckBox.Checked = false; - } - SetSetterTypeCheckBox.Enabled = value; - } - } + public bool CanImplementSetSetterType { get; set; } public bool MustImplementLetSetterType { - get { return LetSetterTypeCheckBox.Checked; } - set - { - if (value) - { - LetSetterTypeCheckBox.Checked = true; - } - LetSetterTypeCheckBox.Enabled = !value; - } + get { return CanImplementLetSetterType && !CanImplementSetSetterType; } } public bool MustImplementSetSetterType { - get { return SetSetterTypeCheckBox.Checked; } - set - { - if (value) - { - SetSetterTypeCheckBox.Checked = true; - } - SetSetterTypeCheckBox.Enabled = !value; - } + get { return CanImplementSetSetterType && !CanImplementLetSetterType; } } public EncapsulateFieldDialog(RubberduckParserState state, IIndenter indenter) @@ -90,10 +52,7 @@ public EncapsulateFieldDialog(RubberduckParserState state, IIndenter indenter) PropertyNameTextBox.TextChanged += PropertyNameBox_TextChanged; ParameterNameTextBox.TextChanged += VariableNameBox_TextChanged; - - LetSetterTypeCheckBox.CheckedChanged += EncapsulateFieldDialog_SetterTypeChanged; - SetSetterTypeCheckBox.CheckedChanged += EncapsulateFieldDialog_SetterTypeChanged; - + Shown += EncapsulateFieldDialog_Shown; } @@ -116,11 +75,36 @@ private void LocalizeDialog() void EncapsulateFieldDialog_Shown(object sender, EventArgs e) { + if (MustImplementSetSetterType) + { + SetSetterTypeCheckBox.Checked = true; + DisableAssignmentSelection(); + } + else + { + LetSetterTypeCheckBox.Checked = true; + if (MustImplementLetSetterType) + { + DisableAssignmentSelection(); + } + else + { + LetSetterTypeCheckBox.CheckedChanged += EncapsulateFieldDialog_SetterTypeChanged; + SetSetterTypeCheckBox.CheckedChanged += EncapsulateFieldDialog_SetterTypeChanged; + } + } + ValidatePropertyName(); ValidateVariableName(); UpdatePreview(); } + private void DisableAssignmentSelection() + { + LetSetterTypeCheckBox.Enabled = false; + SetSetterTypeCheckBox.Enabled = false; + } + private void PropertyNameBox_TextChanged(object sender, EventArgs e) { ValidatePropertyName(); @@ -142,10 +126,7 @@ private string GetPropertyText() { if (TargetDeclaration == null) { return string.Empty; } - var getterText = string.Join(Environment.NewLine, - string.Format("Public Property Get {0}() As {1}", NewPropertyName, TargetDeclaration.AsTypeName), - string.Format(" {0}{1} = {2}", MustImplementSetSetterType || !CanImplementLetSetterType ? "Set " : string.Empty, NewPropertyName, TargetDeclaration.IdentifierName), - "End Property"); + var getterText = GenerateGetter(); var letterText = string.Join(Environment.NewLine, string.Format(Environment.NewLine + Environment.NewLine + "Public Property Let {0}(ByVal {1} As {2})", @@ -160,13 +141,32 @@ private string GetPropertyText() "End Property"); var propertyText = getterText + - (MustImplementLetSetterType ? letterText : string.Empty) + - (MustImplementSetSetterType ? setterText : string.Empty); + (LetSetterTypeCheckBox.Checked ? letterText : string.Empty) + + (SetSetterTypeCheckBox.Checked ? setterText : string.Empty); var propertyTextLines = propertyText.Split(new[] { Environment.NewLine }, StringSplitOptions.None); return string.Join(Environment.NewLine, _indenter.Indent(propertyTextLines)); } + private string GenerateGetter() + { + if (SetSetterTypeCheckBox.Checked && LetSetterTypeCheckBox.Checked) + { + return string.Join(Environment.NewLine, + string.Format("Public Property Get {0}() As {1}", NewPropertyName, TargetDeclaration.AsTypeName), + string.Format(" If VarType({0}) = vbObject Then", TargetDeclaration.IdentifierName), + string.Format(" Set {0} = {1}", NewPropertyName, TargetDeclaration.IdentifierName), + " Else", + string.Format(" {0} = {1}", NewPropertyName, TargetDeclaration.IdentifierName), + " End If", + "End Property"); + } + return string.Join(Environment.NewLine, + string.Format("Public Property Get {0}() As {1}", NewPropertyName, TargetDeclaration.AsTypeName), + string.Format(" {0}{1} = {2}", SetSetterTypeCheckBox.Checked ? "Set " : string.Empty, NewPropertyName, TargetDeclaration.IdentifierName), + "End Property"); + } + private void ValidatePropertyName() { InvalidPropertyNameIcon.Visible = ValidateName(NewPropertyName, ParameterName) || From 600fac4423b6c1f947c3822c38fc720b6c4b8a45 Mon Sep 17 00:00:00 2001 From: comintern Date: Sat, 25 Feb 2017 19:44:48 -0600 Subject: [PATCH 25/31] Refactor EncapsulateField to share code-writing code. Commented out tests that only test mocked behavior. --- .../EncapsulateFieldPresenter.cs | 6 +- .../EncapsulateFieldRefactoring.cs | 37 +++---- .../IEncapsulateFieldDialog.cs | 3 +- .../EncapsulateField/PropertyGenerator.cs | 81 ++++++++++++++++ RetailCoder.VBE/Rubberduck.csproj | 1 + .../UI/Refactorings/EncapsulateFieldDialog.cs | 97 +++++++------------ .../Refactoring/EncapsulateFieldTests.cs | 20 +++- 7 files changed, 148 insertions(+), 97 deletions(-) create mode 100644 RetailCoder.VBE/Refactorings/EncapsulateField/PropertyGenerator.cs diff --git a/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldPresenter.cs b/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldPresenter.cs index 35792309ee..c3691e3ff5 100644 --- a/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldPresenter.cs +++ b/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldPresenter.cs @@ -85,9 +85,9 @@ public EncapsulateFieldModel Show() } _model.PropertyName = _view.NewPropertyName; - _model.ImplementLetSetterType = _view.MustImplementLetSetterType; - _model.ImplementSetSetterType = _view.MustImplementSetSetterType; - _model.CanImplementLet = _view.CanImplementLetSetterType; + _model.ImplementLetSetterType = _view.CanImplementLetSetterType; + _model.ImplementSetSetterType = _view.CanImplementSetSetterType; + _model.CanImplementLet = !_view.MustImplementSetSetterType; _model.ParameterName = _view.ParameterName; return _model; diff --git a/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldRefactoring.cs b/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldRefactoring.cs index 57d974d40f..65530617c0 100644 --- a/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldRefactoring.cs +++ b/RetailCoder.VBE/Refactorings/EncapsulateField/EncapsulateFieldRefactoring.cs @@ -79,7 +79,7 @@ private void AddProperty() var module = _model.TargetDeclaration.QualifiedName.QualifiedModuleName.Component.CodeModule; SetFieldToPrivate(module); - module.InsertLines(module.CountOfDeclarationLines + 1, GetPropertyText()); + module.InsertLines(module.CountOfDeclarationLines + 1, Environment.NewLine + GetPropertyText()); } private void UpdateReferences() @@ -207,30 +207,17 @@ private string RemoveExtraComma(string str, int numParams, int indexRemoved) private string GetPropertyText() { - var getterText = string.Join(Environment.NewLine, - string.Format(Environment.NewLine + "Public Property Get {0}() As {1}", _model.PropertyName, - _model.TargetDeclaration.AsTypeName), - string.Format(" {0}{1} = {2}", !_model.CanImplementLet || _model.ImplementSetSetterType ? "Set " : string.Empty, _model.PropertyName, _model.TargetDeclaration.IdentifierName), - "End Property" + Environment.NewLine); - - var letterText = string.Join(Environment.NewLine, - string.Format(Environment.NewLine + "Public Property Let {0}(ByVal {1} As {2})", - _model.PropertyName, _model.ParameterName, _model.TargetDeclaration.AsTypeName), - string.Format(" {0} = {1}", _model.TargetDeclaration.IdentifierName, _model.ParameterName), - "End Property" + Environment.NewLine); - - var setterText = string.Join(Environment.NewLine, - string.Format(Environment.NewLine + "Public Property Set {0}(ByVal {1} As {2})", - _model.PropertyName, _model.ParameterName, _model.TargetDeclaration.AsTypeName), - string.Format(" Set {0} = {1}", _model.TargetDeclaration.IdentifierName, _model.ParameterName), - "End Property" + Environment.NewLine); - - var propertyText = string.Join(string.Empty, - getterText, - (_model.ImplementLetSetterType ? letterText : string.Empty), - (_model.ImplementSetSetterType ? setterText : string.Empty)).TrimEnd() + Environment.NewLine; - - var propertyTextLines = propertyText.Split(new[] {Environment.NewLine}, StringSplitOptions.None); + var generator = new PropertyGenerator + { + PropertyName = _model.PropertyName, + AsTypeName = _model.TargetDeclaration.AsTypeName, + BackingField = _model.TargetDeclaration.IdentifierName, + ParameterName = _model.ParameterName, + GenerateSetter = _model.ImplementSetSetterType, + GenerateLetter = _model.ImplementLetSetterType + }; + + var propertyTextLines = generator.AllPropertyCode.Split(new[] { Environment.NewLine }, StringSplitOptions.None); return string.Join(Environment.NewLine, _indenter.Indent(propertyTextLines, true)); } } diff --git a/RetailCoder.VBE/Refactorings/EncapsulateField/IEncapsulateFieldDialog.cs b/RetailCoder.VBE/Refactorings/EncapsulateField/IEncapsulateFieldDialog.cs index 6af187d3cd..4a140b2069 100644 --- a/RetailCoder.VBE/Refactorings/EncapsulateField/IEncapsulateFieldDialog.cs +++ b/RetailCoder.VBE/Refactorings/EncapsulateField/IEncapsulateFieldDialog.cs @@ -10,7 +10,8 @@ public interface IEncapsulateFieldDialog :IDialogView string NewPropertyName { get; set; } bool CanImplementLetSetterType { get; set; } bool CanImplementSetSetterType { get; set; } - + bool LetSetterSelected { get; } + bool SetSetterSelected { get; } bool MustImplementLetSetterType { get; } bool MustImplementSetSetterType { get; } diff --git a/RetailCoder.VBE/Refactorings/EncapsulateField/PropertyGenerator.cs b/RetailCoder.VBE/Refactorings/EncapsulateField/PropertyGenerator.cs new file mode 100644 index 0000000000..1d46764e10 --- /dev/null +++ b/RetailCoder.VBE/Refactorings/EncapsulateField/PropertyGenerator.cs @@ -0,0 +1,81 @@ +using System; + +namespace Rubberduck.Refactorings.EncapsulateField +{ + public class PropertyGenerator + { + public string PropertyName { get; set; } + public string BackingField { get; set; } + public string AsTypeName { get; set; } + public string ParameterName { get; set; } + public bool GenerateLetter { get; set; } + public bool GenerateSetter { get; set; } + + public string AllPropertyCode + { + get + { + return GetterCode + + (GenerateLetter ? LetterCode : string.Empty) + + (GenerateSetter ? SetterCode : string.Empty); + } + } + + public string GetterCode + { + get + { + if (GenerateSetter && GenerateLetter) + { + return string.Join(Environment.NewLine, + string.Format("Public Property Get {0}() As {1}", PropertyName, AsTypeName), + string.Format(" If IsObject({0}) Then", BackingField), + string.Format(" Set {0} = {1}", PropertyName, BackingField), + " Else", + string.Format(" {0} = {1}", PropertyName, BackingField), + " End If", + "End Property", + Environment.NewLine); + } + + return string.Join(Environment.NewLine, + string.Format("Public Property Get {0}() As {1}", PropertyName, AsTypeName), + string.Format(" {0}{1} = {2}", GenerateSetter ? "Set " : string.Empty, PropertyName, BackingField), + "End Property", + Environment.NewLine); + } + } + + public string SetterCode + { + get + { + if (!GenerateSetter) + { + return string.Empty; + } + return string.Join(Environment.NewLine, + string.Format("Public Property Set {0}(ByVal {1} As {2})", PropertyName, ParameterName, AsTypeName), + string.Format(" Set {0} = {1}", BackingField, ParameterName), + "End Property", + Environment.NewLine); + } + } + + public string LetterCode + { + get + { + if (!GenerateLetter) + { + return string.Empty; + } + return string.Join(Environment.NewLine, + string.Format("Public Property Let {0}(ByVal {1} As {2})", PropertyName, ParameterName, AsTypeName), + string.Format(" {0} = {1}", BackingField, ParameterName), + "End Property", + Environment.NewLine); + } + } + } +} diff --git a/RetailCoder.VBE/Rubberduck.csproj b/RetailCoder.VBE/Rubberduck.csproj index c80f9af936..a26a1ca208 100644 --- a/RetailCoder.VBE/Rubberduck.csproj +++ b/RetailCoder.VBE/Rubberduck.csproj @@ -413,6 +413,7 @@ + diff --git a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs index 241b1d7295..6955bdee81 100644 --- a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs +++ b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs @@ -14,6 +14,7 @@ public partial class EncapsulateFieldDialog : Form, IEncapsulateFieldDialog { private readonly RubberduckParserState _state; private readonly IIndenter _indenter; + private PropertyGenerator _previewGenerator; public string NewPropertyName { @@ -32,7 +33,11 @@ public string ParameterName public bool CanImplementLetSetterType { get; set; } public bool CanImplementSetSetterType { get; set; } - + + public bool LetSetterSelected { get { return LetSetterTypeCheckBox.Checked; } } + + public bool SetSetterSelected { get { return SetSetterTypeCheckBox.Checked; } } + public bool MustImplementLetSetterType { get { return CanImplementLetSetterType && !CanImplementSetSetterType; } @@ -47,17 +52,17 @@ public EncapsulateFieldDialog(RubberduckParserState state, IIndenter indenter) { _state = state; _indenter = indenter; + InitializeComponent(); LocalizeDialog(); - - PropertyNameTextBox.TextChanged += PropertyNameBox_TextChanged; - ParameterNameTextBox.TextChanged += VariableNameBox_TextChanged; Shown += EncapsulateFieldDialog_Shown; } void EncapsulateFieldDialog_SetterTypeChanged(object sender, EventArgs e) { + _previewGenerator.GenerateSetter = SetSetterTypeCheckBox.Checked; + _previewGenerator.GenerateLetter = LetSetterTypeCheckBox.Checked; UpdatePreview(); } @@ -78,93 +83,57 @@ void EncapsulateFieldDialog_Shown(object sender, EventArgs e) if (MustImplementSetSetterType) { SetSetterTypeCheckBox.Checked = true; - DisableAssignmentSelection(); + LetSetterTypeCheckBox.Enabled = false; } else { LetSetterTypeCheckBox.Checked = true; - if (MustImplementLetSetterType) - { - DisableAssignmentSelection(); - } - else - { - LetSetterTypeCheckBox.CheckedChanged += EncapsulateFieldDialog_SetterTypeChanged; - SetSetterTypeCheckBox.CheckedChanged += EncapsulateFieldDialog_SetterTypeChanged; - } + SetSetterTypeCheckBox.Enabled = !MustImplementLetSetterType; } ValidatePropertyName(); ValidateVariableName(); - UpdatePreview(); - } - private void DisableAssignmentSelection() - { - LetSetterTypeCheckBox.Enabled = false; - SetSetterTypeCheckBox.Enabled = false; + _previewGenerator = new PropertyGenerator + { + PropertyName = NewPropertyName, + AsTypeName = TargetDeclaration.AsTypeName, + BackingField = TargetDeclaration.IdentifierName, + ParameterName = ParameterName, + GenerateSetter = SetSetterTypeCheckBox.Checked, + GenerateLetter = LetSetterTypeCheckBox.Checked + }; + + LetSetterTypeCheckBox.CheckedChanged += EncapsulateFieldDialog_SetterTypeChanged; + SetSetterTypeCheckBox.CheckedChanged += EncapsulateFieldDialog_SetterTypeChanged; + PropertyNameTextBox.TextChanged += PropertyNameBox_TextChanged; + ParameterNameTextBox.TextChanged += VariableNameBox_TextChanged; + + UpdatePreview(); } private void PropertyNameBox_TextChanged(object sender, EventArgs e) { ValidatePropertyName(); + _previewGenerator.PropertyName = NewPropertyName; UpdatePreview(); } private void VariableNameBox_TextChanged(object sender, EventArgs e) { ValidateVariableName(); + _previewGenerator.ParameterName = ParameterName; UpdatePreview(); } private void UpdatePreview() { - PreviewBox.Text = GetPropertyText(); - } - - private string GetPropertyText() - { - if (TargetDeclaration == null) { return string.Empty; } - - var getterText = GenerateGetter(); - - var letterText = string.Join(Environment.NewLine, - string.Format(Environment.NewLine + Environment.NewLine + "Public Property Let {0}(ByVal {1} As {2})", - NewPropertyName, ParameterName, TargetDeclaration.AsTypeName), - string.Format(" {0} = {1}", TargetDeclaration.IdentifierName, ParameterName), - "End Property"); - - var setterText = string.Join(Environment.NewLine, - string.Format(Environment.NewLine + Environment.NewLine + "Public Property Set {0}(ByVal {1} As {2})", - NewPropertyName, ParameterName, TargetDeclaration.AsTypeName), - string.Format(" Set {0} = {1}", TargetDeclaration.IdentifierName, ParameterName), - "End Property"); - - var propertyText = getterText + - (LetSetterTypeCheckBox.Checked ? letterText : string.Empty) + - (SetSetterTypeCheckBox.Checked ? setterText : string.Empty); - - var propertyTextLines = propertyText.Split(new[] { Environment.NewLine }, StringSplitOptions.None); - return string.Join(Environment.NewLine, _indenter.Indent(propertyTextLines)); - } - - private string GenerateGetter() - { - if (SetSetterTypeCheckBox.Checked && LetSetterTypeCheckBox.Checked) + if (TargetDeclaration == null) { - return string.Join(Environment.NewLine, - string.Format("Public Property Get {0}() As {1}", NewPropertyName, TargetDeclaration.AsTypeName), - string.Format(" If VarType({0}) = vbObject Then", TargetDeclaration.IdentifierName), - string.Format(" Set {0} = {1}", NewPropertyName, TargetDeclaration.IdentifierName), - " Else", - string.Format(" {0} = {1}", NewPropertyName, TargetDeclaration.IdentifierName), - " End If", - "End Property"); + PreviewBox.Text = string.Empty; } - return string.Join(Environment.NewLine, - string.Format("Public Property Get {0}() As {1}", NewPropertyName, TargetDeclaration.AsTypeName), - string.Format(" {0}{1} = {2}", SetSetterTypeCheckBox.Checked ? "Set " : string.Empty, NewPropertyName, TargetDeclaration.IdentifierName), - "End Property"); + var propertyTextLines = _previewGenerator.AllPropertyCode.Split(new[] { Environment.NewLine }, StringSplitOptions.None); + PreviewBox.Text = string.Join(Environment.NewLine, _indenter.Indent(propertyTextLines, true)); } private void ValidatePropertyName() diff --git a/RubberduckTests/Refactoring/EncapsulateFieldTests.cs b/RubberduckTests/Refactoring/EncapsulateFieldTests.cs index 2b22efc08c..0c52c9da25 100644 --- a/RubberduckTests/Refactoring/EncapsulateFieldTests.cs +++ b/RubberduckTests/Refactoring/EncapsulateFieldTests.cs @@ -460,7 +460,11 @@ public void EncapsulatePublicField_FieldDeclarationHasMultipleFields_MoveFirst() Private fizz As Variant Public Property Get Name() As Variant - Set Name = fizz + If IsObject(fizz) Then + Set Name = fizz + Else + Name = fizz + End If End Property Public Property Let Name(ByVal value As Variant) @@ -502,9 +506,10 @@ End Property //Act var refactoring = new EncapsulateFieldRefactoring(vbe.Object, CreateIndenter(vbe.Object), factory.Object); refactoring.Refactor(qualifiedSelection); + var actual = module.Content(); //Assert - Assert.AreEqual(expectedCode, module.Content()); + Assert.AreEqual(expectedCode, actual); } [TestMethod] @@ -676,9 +681,10 @@ End Property //Act var refactoring = new EncapsulateFieldRefactoring(vbe.Object, CreateIndenter(vbe.Object), factory.Object); refactoring.Refactor(qualifiedSelection); + var actual = module.Content(); //Assert - Assert.AreEqual(expectedCode, module.Content()); + Assert.AreEqual(expectedCode, actual); } [TestMethod] @@ -1178,6 +1184,11 @@ public void Presenter_Accept_ReturnsModelWithCanImplementLetChanged() Assert.AreEqual(true, presenter.Show().CanImplementLet); } + //NOTE: The tests below are commented out pending some sort of refactoring that enables them + //to actually *test* something. Currently, all of the behavior the tests are looking for is + //being mocked. + + /* [TestMethod] public void Presenter_Accept_ReturnsModelWithImplementLetChanged() { @@ -1530,6 +1541,7 @@ Sub foo() Assert.AreEqual(true, view.Object.MustImplementSetSetterType); } + [TestMethod] public void Presenter_Accept_DefaultCreateGetOnly_PrimitiveType_NoReference() { @@ -1616,7 +1628,7 @@ public void Presenter_Accept_DefaultCreateGetOnly_Variant_NoReference() Assert.AreEqual(false, model.ImplementLetSetterType); Assert.AreEqual(false, model.ImplementSetSetterType); } - + */ #region setup private static Mock> SetupFactory(EncapsulateFieldModel model) { From ad6b9c05e490c62d4af8e95dec4f7eacaf044e4c Mon Sep 17 00:00:00 2001 From: Max Doerner Date: Sun, 26 Feb 2017 15:44:14 +0100 Subject: [PATCH 26/31] Added IsReferencedByModule and HasReferenceToModule to ModuleState --- Rubberduck.Parsing/VBA/ModuleState.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Rubberduck.Parsing/VBA/ModuleState.cs b/Rubberduck.Parsing/VBA/ModuleState.cs index 7e97c6b1d3..8543fec441 100644 --- a/Rubberduck.Parsing/VBA/ModuleState.cs +++ b/Rubberduck.Parsing/VBA/ModuleState.cs @@ -6,6 +6,7 @@ using Antlr4.Runtime.Tree; using Rubberduck.Parsing.Annotations; using Rubberduck.Parsing.Symbols; +using Rubberduck.VBEditor; namespace Rubberduck.Parsing.VBA { @@ -20,6 +21,8 @@ public class ModuleState public List Annotations { get; private set; } public SyntaxErrorException ModuleException { get; private set; } public IDictionary, Attributes> ModuleAttributes { get; private set; } + public HashSet HasReferenceToModule { get; private set;} + public ConcurrentDictionary IsReferencedByModule { get; private set; } public bool IsNew { get; private set; } @@ -43,6 +46,8 @@ public ModuleState(ConcurrentDictionary declarations) Annotations = new List(); ModuleException = null; ModuleAttributes = new Dictionary, Attributes>(); + HasReferenceToModule = new HashSet(); + IsReferencedByModule = new ConcurrentDictionary(); IsNew = true; } @@ -58,6 +63,8 @@ public ModuleState(ParserState state) Annotations = new List(); ModuleException = null; ModuleAttributes = new Dictionary, Attributes>(); + HasReferenceToModule = new HashSet(); + IsReferencedByModule = new ConcurrentDictionary(); IsNew = true; } @@ -73,6 +80,8 @@ public ModuleState(SyntaxErrorException moduleException) Annotations = new List(); ModuleException = moduleException; ModuleAttributes = new Dictionary, Attributes>(); + HasReferenceToModule = new HashSet(); + IsReferencedByModule = new ConcurrentDictionary(); IsNew = true; } @@ -88,6 +97,8 @@ public ModuleState(IDictionary, Attributes> modul Annotations = new List(); ModuleException = null; ModuleAttributes = moduleAttributes; + HasReferenceToModule = new HashSet(); + IsReferencedByModule = new ConcurrentDictionary(); IsNew = true; } @@ -141,6 +152,17 @@ public ModuleState SetModuleAttributes(IDictionary(); + } + + public void RefreshIsReferencedByModule() + { + IsReferencedByModule = new ConcurrentDictionary(); + } + + private bool _isDisposed; public void Dispose() { From 99ff37a8d3dafb1cef63309376cf8ac19ae2cb65 Mon Sep 17 00:00:00 2001 From: Max Doerner Date: Sun, 26 Feb 2017 18:49:24 +0100 Subject: [PATCH 27/31] Added access through the RubberduckParserState. --- .../VBA/RubberduckParserState.cs | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/Rubberduck.Parsing/VBA/RubberduckParserState.cs b/Rubberduck.Parsing/VBA/RubberduckParserState.cs index f0df2cc50b..155f7fd38f 100644 --- a/Rubberduck.Parsing/VBA/RubberduckParserState.cs +++ b/Rubberduck.Parsing/VBA/RubberduckParserState.cs @@ -1090,6 +1090,63 @@ public void RemoveBuiltInDeclarations(IReference reference) } } + public void AddModuleToModuleReference(QualifiedModuleName referencedModule, QualifiedModuleName referencingModule) + { + ModuleState referencedModuleState; + ModuleState referencingModuleState; + if (!_moduleStates.TryGetValue(referencedModule, out referencedModuleState) || !_moduleStates.TryGetValue(referencingModule, out referencingModuleState)) + { + return; + } + if (referencingModuleState.HasReferenceToModule.Contains(referencedModule)) + { + return; + } + referencedModuleState.IsReferencedByModule.AddOrUpdate(referencingModule, 1, (key,value) => value); + referencingModuleState.HasReferenceToModule.Add(referencedModule); + } + + public void ClearModuleToModuleReferencesFromModule(QualifiedModuleName referencingModule) + { + ModuleState referencingModuleState; + if (!_moduleStates.TryGetValue(referencingModule, out referencingModuleState)) + { + return; + } + + ModuleState referencedModuleState; + byte dummyOutValue; + foreach (var referencedModule in referencingModuleState.HasReferenceToModule) + { + if (!_moduleStates.TryGetValue(referencedModule,out referencedModuleState)) + { + continue; + } + referencedModuleState.IsReferencedByModule.TryRemove(referencingModule,out dummyOutValue); + } + referencingModuleState.RefreshHasReferenceToModule(); + } + + public HashSet ModulesReferencedBy(QualifiedModuleName referencingModule) + { + ModuleState referencingModuleState; + if (!_moduleStates.TryGetValue(referencingModule, out referencingModuleState)) + { + return new HashSet(); + } + return new HashSet(referencingModuleState.HasReferenceToModule); + } + + public HashSet ModulesReferencing(QualifiedModuleName referencedModule) + { + ModuleState referencedModuleState; + if (!_moduleStates.TryGetValue(referencedModule, out referencedModuleState)) + { + return new HashSet(); + } + return new HashSet(referencedModuleState.IsReferencedByModule.Keys); + } + private bool _isDisposed; public void Dispose() From 5f86fa8e880ee876e8651635037364b9acaa638c Mon Sep 17 00:00:00 2001 From: Max Doerner Date: Mon, 27 Feb 2017 02:39:39 +0100 Subject: [PATCH 28/31] Added module to module reference handling to the ParseCoordinator. --- .../Symbols/DeclarationFinder.cs | 7 ++- Rubberduck.Parsing/VBA/ModuleState.cs | 24 ++++----- Rubberduck.Parsing/VBA/ParseCoordinator.cs | 50 +++++++++++++++++++ .../VBA/RubberduckParserState.cs | 17 +++---- 4 files changed, 76 insertions(+), 22 deletions(-) diff --git a/Rubberduck.Parsing/Symbols/DeclarationFinder.cs b/Rubberduck.Parsing/Symbols/DeclarationFinder.cs index c782a4adaa..7da0ee93f9 100644 --- a/Rubberduck.Parsing/Symbols/DeclarationFinder.cs +++ b/Rubberduck.Parsing/Symbols/DeclarationFinder.cs @@ -141,7 +141,12 @@ public IEnumerable Undeclared public IEnumerable Members(Declaration module) { - return _declarations[module.QualifiedName.QualifiedModuleName]; + return Members(module.QualifiedName.QualifiedModuleName); + } + + public IEnumerable Members(QualifiedModuleName module) + { + return _declarations[module]; } private IEnumerable _nonBaseAsType; diff --git a/Rubberduck.Parsing/VBA/ModuleState.cs b/Rubberduck.Parsing/VBA/ModuleState.cs index 8543fec441..9773b718ab 100644 --- a/Rubberduck.Parsing/VBA/ModuleState.cs +++ b/Rubberduck.Parsing/VBA/ModuleState.cs @@ -21,8 +21,8 @@ public class ModuleState public List Annotations { get; private set; } public SyntaxErrorException ModuleException { get; private set; } public IDictionary, Attributes> ModuleAttributes { get; private set; } - public HashSet HasReferenceToModule { get; private set;} - public ConcurrentDictionary IsReferencedByModule { get; private set; } + public ConcurrentDictionary HasReferenceToModule { get; private set; } + public HashSet IsReferencedByModule { get; private set; } public bool IsNew { get; private set; } @@ -46,8 +46,8 @@ public ModuleState(ConcurrentDictionary declarations) Annotations = new List(); ModuleException = null; ModuleAttributes = new Dictionary, Attributes>(); - HasReferenceToModule = new HashSet(); - IsReferencedByModule = new ConcurrentDictionary(); + HasReferenceToModule = new ConcurrentDictionary(); + IsReferencedByModule = new HashSet(); IsNew = true; } @@ -63,8 +63,8 @@ public ModuleState(ParserState state) Annotations = new List(); ModuleException = null; ModuleAttributes = new Dictionary, Attributes>(); - HasReferenceToModule = new HashSet(); - IsReferencedByModule = new ConcurrentDictionary(); + HasReferenceToModule = new ConcurrentDictionary(); + IsReferencedByModule = new HashSet(); IsNew = true; } @@ -80,8 +80,8 @@ public ModuleState(SyntaxErrorException moduleException) Annotations = new List(); ModuleException = moduleException; ModuleAttributes = new Dictionary, Attributes>(); - HasReferenceToModule = new HashSet(); - IsReferencedByModule = new ConcurrentDictionary(); + HasReferenceToModule = new ConcurrentDictionary(); + IsReferencedByModule = new HashSet(); IsNew = true; } @@ -97,8 +97,8 @@ public ModuleState(IDictionary, Attributes> modul Annotations = new List(); ModuleException = null; ModuleAttributes = moduleAttributes; - HasReferenceToModule = new HashSet(); - IsReferencedByModule = new ConcurrentDictionary(); + HasReferenceToModule = new ConcurrentDictionary(); + IsReferencedByModule = new HashSet(); IsNew = true; } @@ -154,12 +154,12 @@ public ModuleState SetModuleAttributes(IDictionary(); + HasReferenceToModule = new ConcurrentDictionary(); } public void RefreshIsReferencedByModule() { - IsReferencedByModule = new ConcurrentDictionary(); + IsReferencedByModule = new HashSet(); } diff --git a/Rubberduck.Parsing/VBA/ParseCoordinator.cs b/Rubberduck.Parsing/VBA/ParseCoordinator.cs index f3b61fe77b..22109be3ac 100644 --- a/Rubberduck.Parsing/VBA/ParseCoordinator.cs +++ b/Rubberduck.Parsing/VBA/ParseCoordinator.cs @@ -217,6 +217,8 @@ private void ExecuteCommonParseActivities(List toParse, Cancellati _projectDeclarations.Clear(); State.ClearAllReferences(); + ClearModuleToModuleReferences(toParse); + ParseComponents(toParse, token); if (token.IsCancellationRequested || State.Status >= ParserState.Error) @@ -268,6 +270,14 @@ private void SetModuleStates(List components, ParserState parserSt } } + private void ClearModuleToModuleReferences(List toClear) + { + foreach (var component in toClear) + { + State.ClearModuleToModuleReferencesFromModule(new QualifiedModuleName(component)); + } + } + private void ParseComponents(List components, CancellationToken token) { token.ThrowIfCancellationRequested(); @@ -496,6 +506,10 @@ private void ResolveAllReferences(CancellationToken token) token.ThrowIfCancellationRequested(); + AddModuleToModuleReferences(State.DeclarationFinder, token); + + token.ThrowIfCancellationRequested(); + AddUndeclaredVariablesToDeclarations(); //This is here and not in the calling method because it has to happen before the ready state is reached. @@ -555,6 +569,41 @@ private void ResolveReferences(DeclarationFinder finder, QualifiedModuleName qua } } + private void AddModuleToModuleReferences(DeclarationFinder finder, CancellationToken token) + { + var options = new ParallelOptions(); + options.CancellationToken = token; + options.MaxDegreeOfParallelism = _maxDegreeOfReferenceResolverParallelism; + try + { + Parallel.For(0, State.ParseTrees.Count, options, + (index) => AddModuleToModuleReferences(finder, State.ParseTrees[index].Key) + ); + } + catch (AggregateException exception) + { + if (exception.Flatten().InnerExceptions.All(ex => ex is OperationCanceledException)) + { + throw exception.InnerException; //This eliminates the stack trace, but for the cancellation, this is irrelevant. + } + State.SetStatusAndFireStateChanged(this, ParserState.ResolverError); + throw; + } + } + + private void AddModuleToModuleReferences(DeclarationFinder finder, QualifiedModuleName referencedModule) + { + var referencingModules = finder.Members(referencedModule) + .SelectMany(declaration => declaration.References) + .Select(reference => reference.QualifiedModuleName) + .Distinct() + .Where(referencingModule => !referencedModule.Equals(referencingModule)); + foreach (var referencingModule in referencingModules) + { + State.AddModuleToModuleReference(referencedModule, referencingModule); + } + } + private void AddUndeclaredVariablesToDeclarations() { var undeclared = State.DeclarationFinder.Undeclared.ToList(); @@ -651,6 +700,7 @@ private bool CleanUpRemovedComponents(List components) var componentRemoved = removedModuledecalrations.Any(); foreach (var declaration in removedModuledecalrations) { + State.ClearModuleToModuleReferencesFromModule(declaration.QualifiedName.QualifiedModuleName); State.ClearStateCache(declaration.QualifiedName.QualifiedModuleName); } return componentRemoved; diff --git a/Rubberduck.Parsing/VBA/RubberduckParserState.cs b/Rubberduck.Parsing/VBA/RubberduckParserState.cs index 155f7fd38f..99ff0b1758 100644 --- a/Rubberduck.Parsing/VBA/RubberduckParserState.cs +++ b/Rubberduck.Parsing/VBA/RubberduckParserState.cs @@ -1098,12 +1098,12 @@ public void AddModuleToModuleReference(QualifiedModuleName referencedModule, Qua { return; } - if (referencingModuleState.HasReferenceToModule.Contains(referencedModule)) + if (referencedModuleState.IsReferencedByModule.Contains(referencingModule)) { return; } - referencedModuleState.IsReferencedByModule.AddOrUpdate(referencingModule, 1, (key,value) => value); - referencingModuleState.HasReferenceToModule.Add(referencedModule); + referencedModuleState.IsReferencedByModule.Add(referencingModule); + referencingModuleState.HasReferenceToModule.AddOrUpdate(referencedModule, 1, (key, value) => value); } public void ClearModuleToModuleReferencesFromModule(QualifiedModuleName referencingModule) @@ -1115,14 +1115,13 @@ public void ClearModuleToModuleReferencesFromModule(QualifiedModuleName referenc } ModuleState referencedModuleState; - byte dummyOutValue; - foreach (var referencedModule in referencingModuleState.HasReferenceToModule) - { + foreach (var referencedModule in referencingModuleState.HasReferenceToModule.Keys) + { if (!_moduleStates.TryGetValue(referencedModule,out referencedModuleState)) { continue; } - referencedModuleState.IsReferencedByModule.TryRemove(referencingModule,out dummyOutValue); + referencedModuleState.IsReferencedByModule.Remove(referencingModule); } referencingModuleState.RefreshHasReferenceToModule(); } @@ -1134,7 +1133,7 @@ public HashSet ModulesReferencedBy(QualifiedModuleName refe { return new HashSet(); } - return new HashSet(referencingModuleState.HasReferenceToModule); + return new HashSet(referencingModuleState.HasReferenceToModule.Keys); } public HashSet ModulesReferencing(QualifiedModuleName referencedModule) @@ -1144,7 +1143,7 @@ public HashSet ModulesReferencing(QualifiedModuleName refer { return new HashSet(); } - return new HashSet(referencedModuleState.IsReferencedByModule.Keys); + return new HashSet(referencedModuleState.IsReferencedByModule); } private bool _isDisposed; From 01e4c0aa00e7c59902561d3d01194945bef1c4f3 Mon Sep 17 00:00:00 2001 From: comintern Date: Sun, 26 Feb 2017 22:53:21 -0600 Subject: [PATCH 29/31] Gut App.cs, and move the entrails to classes that should have those responsibilities. --- RetailCoder.VBE/App.cs | 178 +--------------- RetailCoder.VBE/AppMenu.cs | 24 ++- RetailCoder.VBE/Root/RubberduckModule.cs | 4 +- RetailCoder.VBE/Rubberduck.csproj | 1 + .../CommandBars/AppCommandBarBase.cs | 3 +- .../CommandBars/IContextFormatter.cs | 23 ++- .../CommandBars/RubberduckCommandBar.cs | 85 +++++++- RetailCoder.VBE/UI/SelectionChangeService.cs | 191 ++++++++++++++++++ .../VBA/RubberduckParserState.cs | 3 +- 9 files changed, 319 insertions(+), 193 deletions(-) create mode 100644 RetailCoder.VBE/UI/SelectionChangeService.cs diff --git a/RetailCoder.VBE/App.cs b/RetailCoder.VBE/App.cs index 4ab03cd999..353c5516df 100644 --- a/RetailCoder.VBE/App.cs +++ b/RetailCoder.VBE/App.cs @@ -3,23 +3,15 @@ using Infralution.Localization.Wpf; using NLog; using Rubberduck.Common; -using Rubberduck.Parsing; -using Rubberduck.Parsing.Symbols; -using Rubberduck.Parsing.VBA; using Rubberduck.Settings; using Rubberduck.UI; using Rubberduck.UI.Command.MenuItems; using System; using System.Globalization; -using System.Linq; using System.Windows.Forms; using Rubberduck.UI.Command; using Rubberduck.UI.Command.MenuItems.CommandBars; -using Rubberduck.VBEditor.Events; -using Rubberduck.VBEditor.SafeComWrappers; using Rubberduck.VBEditor.SafeComWrappers.Abstract; -using Rubberduck.VBEditor.SafeComWrappers.MSForms; -using Rubberduck.VBEditor.SafeComWrappers.Office.Core.Abstract; using Rubberduck.VersionCheck; using Application = System.Windows.Forms.Application; @@ -27,9 +19,7 @@ namespace Rubberduck { public sealed class App : IDisposable { - private readonly IVBE _vbe; private readonly IMessageBox _messageBox; - private readonly IParseCoordinator _parser; private readonly AutoSave.AutoSave _autoSave; private readonly IGeneralConfigService _configService; private readonly IAppMenu _appMenus; @@ -44,7 +34,6 @@ public sealed class App : IDisposable public App(IVBE vbe, IMessageBox messageBox, - IParseCoordinator parser, IGeneralConfigService configService, IAppMenu appMenus, RubberduckCommandBar stateBar, @@ -52,163 +41,20 @@ public sealed class App : IDisposable IVersionCheck version, CommandBase checkVersionCommand) { - _vbe = vbe; _messageBox = messageBox; - _parser = parser; _configService = configService; - _autoSave = new AutoSave.AutoSave(_vbe, _configService); + _autoSave = new AutoSave.AutoSave(vbe, _configService); _appMenus = appMenus; _stateBar = stateBar; _hooks = hooks; _version = version; _checkVersionCommand = checkVersionCommand; - VBENativeServices.SelectionChanged += _vbe_SelectionChanged; - VBENativeServices.WindowFocusChange += _vbe_FocusChanged; - _configService.SettingsChanged += _configService_SettingsChanged; - _parser.State.StateChanged += Parser_StateChanged; - _parser.State.StatusMessageUpdate += State_StatusMessageUpdate; - + UiDispatcher.Initialize(); } - //TODO - This should be able to move to the appropriate handling classes now. - #region Statusbar - - private void State_StatusMessageUpdate(object sender, RubberduckStatusMessageEventArgs e) - { - var message = e.Message; - if (message == ParserState.LoadingReference.ToString()) - { - // note: ugly hack to enable Rubberduck.Parsing assembly to do this - message = RubberduckUI.ParserState_LoadingReference; - } - - _stateBar.SetStatusLabelCaption(message, _parser.State.ModuleExceptions.Count); - } - - private void _vbe_SelectionChanged(object sender, SelectionChangedEventArgs e) - { - RefreshSelection(e.CodePane); - } - - private void _vbe_FocusChanged(object sender, WindowChangedEventArgs e) - { - if (e.EventType == FocusType.GotFocus) - { - switch (e.Window.Type) - { - case WindowKind.Designer: - //Designer or control on designer form selected. - RefreshSelection(e.Window); - break; - case WindowKind.CodeWindow: - //Caret changed in a code pane. - RefreshSelection(e.CodePane); - break; - } - } - else if (e.EventType == FocusType.ChildFocus) - { - //Treeview selection changed in project window. - RefreshSelection(); - } - } - - private ParserState _lastStatus; - private Declaration _lastSelectedDeclaration; - private void RefreshSelection(ICodePane pane) - { - if (pane == null || pane.IsWrappingNullReference) - { - return; - } - - var selectedDeclaration = _parser.State.FindSelectedDeclaration(pane); - var caption = _stateBar.GetContextSelectionCaption(_vbe.ActiveCodePane, selectedDeclaration); - UpdateStatusbarAndCommandState(caption, selectedDeclaration); - } - - private void RefreshSelection(IWindow window) - { - if (window == null || window.IsWrappingNullReference || window.Type != WindowKind.Designer) - { - return; - } - - var component = _vbe.SelectedVBComponent; - var caption = GetComponentControlsCaption(component); - //TODO: Need to find the selected declaration for the Form\Control. - UpdateStatusbarAndCommandState(caption, null); - } - - private void RefreshSelection() - { - var caption = string.Empty; - var component = _vbe.SelectedVBComponent; - if (component == null || component.IsWrappingNullReference) - { - //The user might have selected the project node in Project Explorer - //If they've chosen a folder, we'll return the project anyway - caption = !_vbe.ActiveVBProject.IsWrappingNullReference - ? _vbe.ActiveVBProject.Name - : null; - } - else - { - caption = component.Type == ComponentType.UserForm && component.HasOpenDesigner - ? GetComponentControlsCaption(component) - : string.Format("{0}.{1} ({2})", component.ParentProject.Name, component.Name, component.Type); - } - //TODO: Need to find the selected declaration for the selected treeview item. - UpdateStatusbarAndCommandState(caption, null); - } - - private void UpdateStatusbarAndCommandState(string caption, Declaration selectedDeclaration) - { - var refCount = selectedDeclaration == null ? 0 : selectedDeclaration.References.Count(); - _stateBar.SetContextSelectionCaption(caption, refCount); - - var currentStatus = _parser.State.Status; - if (ShouldEvaluateCanExecute(selectedDeclaration, currentStatus)) - { - _appMenus.EvaluateCanExecute(_parser.State); - _stateBar.EvaluateCanExecute(_parser.State); - } - - _lastStatus = currentStatus; - _lastSelectedDeclaration = selectedDeclaration; - } - - private string GetComponentControlsCaption(IVBComponent component) - { - switch (component.SelectedControls.Count) - { - case 0: - //TODO get the real designer for VB6 - return String.Format("{0}.{1} ({2})", component.ParentProject.Name, component.Name, "MSForms.UserForm"); - break; - case 1: - //TODO return the libraryName.className of the control - IControl control = component.SelectedControls.First(); - return String.Format("{0}.{1}.{2} ({3})", component.ParentProject.Name, component.Name, control.Name, control.TypeName()); - break; - default: - return String.Format("{0}.{1} ({2})", component.ParentProject.Name, component.Name, RubberduckUI.ContextMultipleControlsSelection); - break; - } - } - - private bool ShouldEvaluateCanExecute(Declaration selectedDeclaration, ParserState currentStatus) - { - return _lastStatus != currentStatus || - (selectedDeclaration != null && !selectedDeclaration.Equals(_lastSelectedDeclaration)) || - (selectedDeclaration == null && _lastSelectedDeclaration != null); - } - - #endregion - private void _configService_SettingsChanged(object sender, ConfigurationChangedEventArgs e) { _config = _configService.LoadConfiguration(); @@ -254,8 +100,7 @@ public void Startup() _stateBar.Initialize(); _hooks.HookHotkeys(); // need to hook hotkeys before we localize menus, to correctly display ShortcutTexts _appMenus.Localize(); - _stateBar.SetStatusLabelCaption(ParserState.Pending); - _stateBar.EvaluateCanExecute(_parser.State); + UpdateLoggingLevel(); if (_config.UserSettings.GeneralSettings.CheckVersion) @@ -276,14 +121,6 @@ public void Shutdown() } } - private void Parser_StateChanged(object sender, EventArgs e) - { - Logger.Debug("App handles StateChanged ({0}), evaluating menu states...", _parser.State.Status); - _appMenus.EvaluateCanExecute(_parser.State); - _stateBar.EvaluateCanExecute(_parser.State); - _stateBar.SetStatusLabelCaption(_parser.State.Status, _parser.State.ModuleExceptions.Count); - } - private void LoadConfig() { _config = _configService.LoadConfiguration(); @@ -354,15 +191,6 @@ public void Dispose() return; } - if (_parser != null && _parser.State != null) - { - _parser.State.StateChanged -= Parser_StateChanged; - _parser.State.StatusMessageUpdate -= State_StatusMessageUpdate; - } - - VBENativeServices.SelectionChanged += _vbe_SelectionChanged; - VBENativeServices.WindowFocusChange += _vbe_FocusChanged; - if (_configService != null) { _configService.SettingsChanged -= _configService_SettingsChanged; diff --git a/RetailCoder.VBE/AppMenu.cs b/RetailCoder.VBE/AppMenu.cs index 2b4891db72..3d14ab20b7 100644 --- a/RetailCoder.VBE/AppMenu.cs +++ b/RetailCoder.VBE/AppMenu.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; +using Rubberduck.Parsing; using Rubberduck.Parsing.VBA; +using Rubberduck.UI; using Rubberduck.UI.Command.MenuItems; using Rubberduck.UI.Command.MenuItems.ParentMenus; @@ -10,10 +12,17 @@ namespace Rubberduck public class AppMenu : IAppMenu, IDisposable { private readonly IReadOnlyList _menus; + private readonly IParseCoordinator _parser; + private readonly ISelectionChangeService _selectionService; - public AppMenu(IEnumerable menus) + public AppMenu(IEnumerable menus, IParseCoordinator parser, ISelectionChangeService selectionService) { _menus = menus.ToList(); + _parser = parser; + _selectionService = selectionService; + + _parser.State.StateChanged += OnParserStateChanged; + _selectionService.SelectedDeclarationChanged += OnSelectedDeclarationChange; } public void Initialize() @@ -24,6 +33,16 @@ public void Initialize() } } + public void OnSelectedDeclarationChange(object sender, DeclarationChangedEventArgs e) + { + EvaluateCanExecute(_parser.State); + } + + private void OnParserStateChanged(object sender, EventArgs e) + { + EvaluateCanExecute(_parser.State); + } + public void EvaluateCanExecute(RubberduckParserState state) { foreach (var menu in _menus) @@ -42,6 +61,9 @@ public void Localize() public void Dispose() { + _parser.State.StateChanged -= OnParserStateChanged; + _selectionService.SelectedDeclarationChanged -= OnSelectedDeclarationChange; + // note: doing this wrecks the teardown process. counter-intuitive? sure. but hey it works. //foreach (var menu in _menus.Where(menu => menu.Item != null)) //{ diff --git a/RetailCoder.VBE/Root/RubberduckModule.cs b/RetailCoder.VBE/Root/RubberduckModule.cs index 1436aba97e..46d78d5f94 100644 --- a/RetailCoder.VBE/Root/RubberduckModule.cs +++ b/RetailCoder.VBE/Root/RubberduckModule.cs @@ -63,11 +63,12 @@ public override void Load() Bind().ToConstant(_addin); Bind().ToSelf().InSingletonScope(); Bind().ToSelf().InSingletonScope(); + Bind().To().InSingletonScope(); Bind().To(); //Bind().ToSelf().InSingletonScope(); Bind().ToSelf().InSingletonScope(); Bind().To().InSingletonScope(); - + Bind().To().WhenInjectedExactlyInto(); BindCodeInspectionTypes(); @@ -175,6 +176,7 @@ private void ApplyDefaultInterfacesConvention(IEnumerable assemblies) // inspections & factories have their own binding rules .Where(type => type.Namespace != null && !type.Namespace.StartsWith("Rubberduck.VBEditor.SafeComWrappers") + && !type.Name.Equals("SelectionChangeService") && !type.Name.EndsWith("Factory") && !type.Name.EndsWith("ConfigProvider") && !type.GetInterfaces().Contains(typeof(IInspection))) .BindDefaultInterface() .Configure(binding => binding.InCallScope())); // TransientScope wouldn't dispose disposables diff --git a/RetailCoder.VBE/Rubberduck.csproj b/RetailCoder.VBE/Rubberduck.csproj index a26a1ca208..dcef2a33bc 100644 --- a/RetailCoder.VBE/Rubberduck.csproj +++ b/RetailCoder.VBE/Rubberduck.csproj @@ -470,6 +470,7 @@ + diff --git a/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/AppCommandBarBase.cs b/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/AppCommandBarBase.cs index ee8c06900b..63637e594e 100644 --- a/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/AppCommandBarBase.cs +++ b/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/AppCommandBarBase.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; @@ -50,7 +49,7 @@ public void Localize() } } - public void Initialize() + public virtual void Initialize() { if (Parent == null) { diff --git a/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/IContextFormatter.cs b/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/IContextFormatter.cs index 3972a20637..ddb54628d3 100644 --- a/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/IContextFormatter.cs +++ b/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/IContextFormatter.cs @@ -1,4 +1,3 @@ -using System.Linq; using Rubberduck.Parsing; using Rubberduck.Parsing.Symbols; using Rubberduck.VBEditor.SafeComWrappers.Abstract; @@ -8,9 +7,13 @@ namespace Rubberduck.UI.Command.MenuItems.CommandBars public interface IContextFormatter { /// - /// Determines the formatting of the contextual selection caption. + /// Determines the formatting of the contextual selection caption when a codepane is active. /// string Format(ICodePane activeCodePane, Declaration declaration); + /// + /// Determines the formatting of the contextual selection caption when a codepane is not active. + /// + string Format(Declaration declaration, bool multipleControls); } public class ContextFormatter : IContextFormatter @@ -30,12 +33,17 @@ public string Format(ICodePane activeCodePane, Declaration declaration) var selection = qualifiedSelection.Value; var codePaneSelectionText = selection.Selection.ToString(); - var contextSelectionText = Format(declaration); + var contextSelectionText = FormatDeclaration(declaration); return string.Format("{0} | {1}", codePaneSelectionText, contextSelectionText); } - private string Format(Declaration declaration) + public string Format(Declaration declaration, bool multipleControls) + { + return declaration == null ? string.Empty : FormatDeclaration(declaration, multipleControls); + } + + private string FormatDeclaration(Declaration declaration, bool multipleControls = false) { var formattedDeclaration = string.Empty; var moduleName = declaration.QualifiedName.QualifiedModuleName; @@ -44,11 +52,14 @@ private string Format(Declaration declaration) : declaration.AsTypeName; var declarationType = RubberduckUI.ResourceManager.GetString("DeclarationType_" + declaration.DeclarationType, Settings.Settings.Culture); - typeName = "(" + declarationType + (string.IsNullOrEmpty(typeName) ? string.Empty : ":" + typeName) + ")"; + typeName = multipleControls + ? RubberduckUI.ContextMultipleControlsSelection + : "(" + declarationType + (string.IsNullOrEmpty(typeName) ? string.Empty : ":" + typeName) + ")"; if (declaration.DeclarationType.HasFlag(DeclarationType.Project) || declaration.DeclarationType == DeclarationType.BracketedExpression) { - formattedDeclaration = System.IO.Path.GetFileName(declaration.QualifiedName.QualifiedModuleName.ProjectPath) + ";" + declaration.IdentifierName + " (" + declarationType + ")"; + var filename = System.IO.Path.GetFileName(declaration.QualifiedName.QualifiedModuleName.ProjectPath); + formattedDeclaration = string.Format("{0}{1}{2} ({3})", filename, string.IsNullOrEmpty(filename) ? string.Empty : ";", declaration.IdentifierName, declarationType); } else if (declaration.DeclarationType.HasFlag(DeclarationType.Module)) { diff --git a/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/RubberduckCommandBar.cs b/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/RubberduckCommandBar.cs index f0c2715b84..79fb96ec8d 100644 --- a/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/RubberduckCommandBar.cs +++ b/RetailCoder.VBE/UI/Command/MenuItems/CommandBars/RubberduckCommandBar.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; +using System.Linq; +using Rubberduck.Parsing; using Rubberduck.Parsing.Symbols; using Rubberduck.Parsing.VBA; -using Rubberduck.VBEditor.SafeComWrappers.Abstract; using Rubberduck.VBEditor.SafeComWrappers.Office.Core; namespace Rubberduck.UI.Command.MenuItems.CommandBars @@ -10,11 +11,82 @@ namespace Rubberduck.UI.Command.MenuItems.CommandBars public class RubberduckCommandBar : AppCommandBarBase, IDisposable { private readonly IContextFormatter _formatter; + private readonly IParseCoordinator _parser; + private readonly ISelectionChangeService _selectionService; - public RubberduckCommandBar(IEnumerable items, IContextFormatter formatter) + public RubberduckCommandBar(IParseCoordinator parser, IEnumerable items, IContextFormatter formatter, ISelectionChangeService selectionService) : base("Rubberduck", CommandBarPosition.Top, items) { + _parser = parser; _formatter = formatter; + _selectionService = selectionService; + + _parser.State.StateChanged += OnParserStateChanged; + _parser.State.StatusMessageUpdate += OnParserStatusMessageUpdate; + _selectionService.SelectionChanged += OnSelectionChange; + } + + //This class is instantiated early enough that the initial control state isn't ready to be set up. So... override Initialize + //and have the state set via the Initialize call. + public override void Initialize() + { + base.Initialize(); + SetStatusLabelCaption(ParserState.Pending); + EvaluateCanExecute(_parser.State); + } + + private Declaration _lastDeclaration; + private ParserState _lastStatus = ParserState.None; + private void EvaluateCanExecute(RubberduckParserState state, Declaration selected) + { + var currentStatus = _parser.State.Status; + if (_lastStatus == currentStatus && + (selected == null || selected.Equals(_lastDeclaration)) && + (selected != null || _lastDeclaration == null)) + { + return; + } + + _lastStatus = currentStatus; + _lastDeclaration = selected; + base.EvaluateCanExecute(state); + } + + public void OnSelectionChange(object sender, DeclarationChangedEventArgs e) + { + var caption = e.ActivePane != null + ? _formatter.Format(e.ActivePane, e.Declaration) + : _formatter.Format(e.Declaration, e.MultipleControlsSelected); + + if (string.IsNullOrEmpty(caption) && e.VBComponent != null) + { + //Fallback caption for selections in the Project window. + caption = string.Format("{0}.{1} ({2})", e.VBComponent.ParentProject.Name, e.VBComponent.Name, e.VBComponent.Type); + } + + var refCount = e.Declaration == null ? 0 : e.Declaration.References.Count(); + SetContextSelectionCaption(caption, refCount); + EvaluateCanExecute(_parser.State, e.Declaration); + } + + + private void OnParserStatusMessageUpdate(object sender, RubberduckStatusMessageEventArgs e) + { + var message = e.Message; + if (message == ParserState.LoadingReference.ToString()) + { + // note: ugly hack to enable Rubberduck.Parsing assembly to do this + message = RubberduckUI.ParserState_LoadingReference; + } + + SetStatusLabelCaption(message, _parser.State.ModuleExceptions.Count); + } + + private void OnParserStateChanged(object sender, EventArgs e) + { + _lastStatus = _parser.State.Status; + EvaluateCanExecute(_parser.State); + SetStatusLabelCaption(_parser.State.Status, _parser.State.ModuleExceptions.Count); } public void SetStatusLabelCaption(ParserState state, int? errorCount = null) @@ -43,11 +115,6 @@ public void SetStatusLabelCaption(string caption, int? errorCount = null) Localize(); } - public string GetContextSelectionCaption(ICodePane activeCodePane, Declaration declaration) - { - return _formatter.Format(activeCodePane, declaration); - } - public void SetContextSelectionCaption(string caption, int contextReferenceCount) { var contextLabel = FindChildByTag(typeof(ContextSelectionLabelMenuItem).FullName) as ContextSelectionLabelMenuItem; @@ -66,6 +133,10 @@ public void SetContextSelectionCaption(string caption, int contextReferenceCount public void Dispose() { + _selectionService.SelectionChanged -= OnSelectionChange; + _parser.State.StateChanged -= OnParserStateChanged; + _parser.State.StatusMessageUpdate -= OnParserStatusMessageUpdate; + //note: doing this wrecks the teardown process. counter-intuitive? sure. but hey it works. //RemoveChildren(); //Item.Delete(); diff --git a/RetailCoder.VBE/UI/SelectionChangeService.cs b/RetailCoder.VBE/UI/SelectionChangeService.cs new file mode 100644 index 0000000000..50f45fd5cf --- /dev/null +++ b/RetailCoder.VBE/UI/SelectionChangeService.cs @@ -0,0 +1,191 @@ +using System; +using System.Linq; +using Rubberduck.Parsing; +using Rubberduck.Parsing.Symbols; +using Rubberduck.VBEditor.Events; +using Rubberduck.VBEditor.SafeComWrappers; +using Rubberduck.VBEditor.SafeComWrappers.Abstract; +using Rubberduck.VBEditor.SafeComWrappers.MSForms; + +namespace Rubberduck.UI +{ + public interface ISelectionChangeService + { + event EventHandler SelectedDeclarationChanged; + event EventHandler SelectionChanged; + } + + public class SelectionChangeService : ISelectionChangeService, IDisposable + { + public event EventHandler SelectedDeclarationChanged; + public event EventHandler SelectionChanged; + + private Declaration _lastSelectedDeclaration; + private readonly IVBE _vbe; + private readonly IParseCoordinator _parser; + + public SelectionChangeService(IVBE vbe, IParseCoordinator parser) + { + _parser = parser; + _vbe = vbe; + VBENativeServices.SelectionChanged += OnVbeSelectionChanged; + VBENativeServices.WindowFocusChange += OnVbeFocusChanged; + } + + private void OnVbeSelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (e.CodePane == null || e.CodePane.IsWrappingNullReference) + { + return; + } + + var eventArgs = new DeclarationChangedEventArgs(e.CodePane, _parser.State.FindSelectedDeclaration(e.CodePane)); + DispatchSelectedDeclaration(eventArgs); + } + + private void OnVbeFocusChanged(object sender, WindowChangedEventArgs e) + { + if (e.EventType == FocusType.GotFocus) + { + switch (e.Window.Type) + { + case WindowKind.Designer: + //Designer or control on designer form selected. + if (e.Window == null || e.Window.IsWrappingNullReference || e.Window.Type != WindowKind.Designer) + { + return; + } + DispatchSelectedDesignerDeclaration(_vbe.SelectedVBComponent); + break; + case WindowKind.CodeWindow: + //Caret changed in a code pane. + if (e.CodePane != null && !e.CodePane.IsWrappingNullReference) + { + DispatchSelectedDeclaration(new DeclarationChangedEventArgs(e.CodePane, _parser.State.FindSelectedDeclaration(e.CodePane))); + } + break; + } + } + else if (e.EventType == FocusType.ChildFocus) + { + //Treeview selection changed in project window. + DispatchSelectedProjectNodeDeclaration(_vbe.SelectedVBComponent); + } + } + + private void DispatchSelectionChanged(DeclarationChangedEventArgs eventArgs) + { + if (SelectionChanged == null) + { + return; + } + SelectionChanged.Invoke(null, eventArgs); + } + + + private void DispatchSelectedDeclaration(DeclarationChangedEventArgs eventArgs) + { + DispatchSelectionChanged(eventArgs); + + if (!DeclarationChanged(eventArgs.Declaration)) + { + return; + } + + _lastSelectedDeclaration = eventArgs.Declaration; + if (SelectedDeclarationChanged != null) + { + SelectedDeclarationChanged.Invoke(null, eventArgs); + } + } + + private void DispatchSelectedDesignerDeclaration(IVBComponent component) + { + if (component == null || string.IsNullOrEmpty(component.Name)) + { + return; + } + + var selected = component.SelectedControls.Count; + if (selected == 1) + { + var name = component.SelectedControls.First().Name; + var control = + _parser.State.AllUserDeclarations.SingleOrDefault(decl => + decl.IdentifierName.Equals(name) && + decl.ParentDeclaration.IdentifierName.Equals(component.Name) && + decl.ProjectId.Equals(component.ParentProject.ProjectId)); + + DispatchSelectedDeclaration(new DeclarationChangedEventArgs(null, control, component)); + return; + } + var form = + _parser.State.AllUserDeclarations.SingleOrDefault(decl => + decl.IdentifierName.Equals(component.Name) && + decl.ProjectId.Equals(component.ParentProject.ProjectId)); + + DispatchSelectedDeclaration(new DeclarationChangedEventArgs(null, form, component, selected > 1)); + } + + private void DispatchSelectedProjectNodeDeclaration(IVBComponent component) + { + if ((component == null || component.IsWrappingNullReference) && !_vbe.ActiveVBProject.IsWrappingNullReference) + { + //The user might have selected the project node in Project Explorer. If they've chosen a folder, we'll return the project anyway. + var project = + _parser.State.DeclarationFinder.UserDeclarations(DeclarationType.Project) + .SingleOrDefault(decl => decl.ProjectId.Equals(_vbe.ActiveVBProject.ProjectId)); + + DispatchSelectedDeclaration(new DeclarationChangedEventArgs(null, project, component)); + } + else if (component != null && component.Type == ComponentType.UserForm && component.HasOpenDesigner) + { + DispatchSelectedDesignerDeclaration(component); + } + else if (component != null) + { + //The user might have selected the project node in Project Explorer. If they've chosen a folder, we'll return the project anyway. + var module = + _parser.State.AllUserDeclarations.SingleOrDefault( + decl => decl.DeclarationType.HasFlag(DeclarationType.Module) && + decl.IdentifierName.Equals(component.Name) && + decl.ProjectId.Equals(_vbe.ActiveVBProject.ProjectId)); + + DispatchSelectedDeclaration(new DeclarationChangedEventArgs(null, module, component)); + } + } + + private bool DeclarationChanged(Declaration current) + { + if ((_lastSelectedDeclaration == null && current == null) || + ((_lastSelectedDeclaration != null && current != null) && !_lastSelectedDeclaration.Equals(current))) + { + return false; + } + return true; + } + + public void Dispose() + { + VBENativeServices.SelectionChanged -= OnVbeSelectionChanged; + VBENativeServices.WindowFocusChange -= OnVbeFocusChanged; + } + } + + public class DeclarationChangedEventArgs : EventArgs + { + public ICodePane ActivePane { get; private set; } + public Declaration Declaration { get; private set; } + // ReSharper disable once InconsistentNaming + public IVBComponent VBComponent { get; private set; } + public bool MultipleControlsSelected { get; private set; } + + public DeclarationChangedEventArgs(ICodePane pane, Declaration declaration, IVBComponent component = null, bool multipleControls = false) + { + ActivePane = pane; + Declaration = declaration; + VBComponent = component; + MultipleControlsSelected = multipleControls; + } + } +} diff --git a/Rubberduck.Parsing/VBA/RubberduckParserState.cs b/Rubberduck.Parsing/VBA/RubberduckParserState.cs index f0df2cc50b..f92f601d46 100644 --- a/Rubberduck.Parsing/VBA/RubberduckParserState.cs +++ b/Rubberduck.Parsing/VBA/RubberduckParserState.cs @@ -303,8 +303,9 @@ public List Projects private void OnStateChanged(object requestor, ParserState state = ParserState.Pending) { var handler = StateChanged; + Logger.Debug("RubberduckParserState raised StateChanged ({0})", Status); if (handler != null) - { + { handler.Invoke(requestor, new ParserStateEventArgs(state)); } } From f9a7d78ee63475ee68d9d2f69e20098dac6b2cc2 Mon Sep 17 00:00:00 2001 From: comintern Date: Sun, 26 Feb 2017 22:53:50 -0600 Subject: [PATCH 30/31] Handler should be Invoked, not called directly. --- Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs index 82be145b60..ea49af5661 100644 --- a/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs +++ b/Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProjects.cs @@ -175,7 +175,7 @@ private static void OnProjectRenamed(VB.VBProject vbProject, string oldName) var handler = ProjectRenamed; if (handler != null && projectId != null) { - handler(project, new ProjectRenamedEventArgs(projectId, project, oldName)); + handler.Invoke(project, new ProjectRenamedEventArgs(projectId, project, oldName)); } } From 57abcf57a6f8c0385c8448ab604749d930a7b590 Mon Sep 17 00:00:00 2001 From: comintern Date: Mon, 27 Feb 2017 12:40:31 -0600 Subject: [PATCH 31/31] Freshen up Ducky.ico using the same image source as the About dialog. --- RetailCoder.VBE/Ducky.ico | Bin 1014 -> 1150 bytes RetailCoder.VBE/UI/About/AboutDialog.resx | 37 +++---- .../UI/FindSymbol/FindSymbolDialog.resx | 39 +++---- ...edByValParameterQuickFixDialog.Designer.cs | 60 +++++------ .../AssignedByValParameterQuickFixDialog.resx | 37 +++---- .../EncapsulateFieldDialog.Designer.cs | 96 ++++++++---------- .../Refactorings/EncapsulateFieldDialog.resx | 37 +++---- .../ExtractInterfaceDialog.Designer.cs | 16 +-- .../Refactorings/ExtractInterfaceDialog.resx | 37 +++---- .../ExtractMethodDialog.Designer.cs | 88 +++++++--------- .../UI/Refactorings/ExtractMethodDialog.resx | 37 +++---- .../RemoveParametersDialog.Designer.cs | 56 +++++----- .../Refactorings/RemoveParametersDialog.resx | 37 +++---- .../UI/Refactorings/RenameDialog.Designer.cs | 55 ++++------ .../UI/Refactorings/RenameDialog.resx | 37 +++---- .../ReorderParametersDialog.Designer.cs | 56 +++++----- .../Refactorings/ReorderParametersDialog.resx | 37 +++---- .../RegexAssistantDialog.Designer.cs | 6 +- .../RegexAssistant/RegexAssistantDialog.resx | 37 +++---- .../UI/Settings/SettingsForm.Designer.cs | 8 +- RetailCoder.VBE/UI/Settings/SettingsForm.resx | 37 +++---- 21 files changed, 411 insertions(+), 439 deletions(-) diff --git a/RetailCoder.VBE/Ducky.ico b/RetailCoder.VBE/Ducky.ico index 236f4c74c3e9487d34e935e915d7f91bcdb5c72f..3c1251f05bc9ad5be9c3ceb544215d6d9fafa8bc 100644 GIT binary patch literal 1150 zcmah|OGuPa6u!T&Laii2au9RKQb)&ms5vU;0}~sID9lwwHd9zkn~JuIZ6e%c7A+(d zilT*4fn}(RATn){_8@aI!^iY6v(lQ>`M%UhBgO$$Qjt0K8x_Mq=}W*$?0O6A{Q?+10y(aE6nlUQ0Fiow zN`C)h3`IE~5*>pqmj{+lK$+8nvOX22Zotw96utlohCMKR05XZx(FIuNfbF$4s;ons zl8lsR6EM+cVxIKDDHLAqK>BSr40mQ>>6$_6m0lRe=U{TN7W$R{1nOA_^PgLrriYO= z8kswbkTDY5x{-ADIuef5L0^9pDUSwWbg3}P8t7x40nT{&7a3!qWE|Mj3rK010?eNo z@BJ_4oQGkQdCAM3WNgZ`380R1xDUt~G!cyjb*;!dS&tGM=e^$sQ%jqwp9M7Zje7%V zM;PxL=jsM3*}Idu6LmUSzg(5XaY94L{~kdMB@WGDeZQ9<_YTOI2M&?v=6vy9pm)u>FyECBJ2qnZtDu|e+n8np0NTG`$Zb5X&qUa!YsZdJ6LBz?y zN|(?n4k`{sI;0(flP$%;AyyCvAs~tbqtE|Ko3Bx8@E!lV_uc#dzI(^_eMAaZ)F<2% zR5FR$iRc9sg`Pw5USb=yCJ{$%l9bw1vDlH(({pJilU1X$^OS7+8)_e*mym)QL&i&H ze}BbUSz-6^kp1gx_L;T3a+$*$8yrZd8Q!@@82MmuWJG%#xd-{x6`Os16)*`shf<#- zySq>0(Nkz`O?r4!=T&R#Z@*f7GVdN72)|zEjjpcC2YojD`~8}Caw7Z}&Bx>A`<`aw zNTDG7YMrM*;JeIOXF|CgTjS$w&(5+nGsEG0Uf0B9WwXM+);v+xo}aII!aF;xT=xfR zDd?5*yfb%i?=C+!2EJ{ZsO2p@9^`=e8O&rD`=o$z43ZeKrl#(&@_q04n8_T#93`lC z>yNdzo@wO9-?2Oa8F~jj8mZv$u;%UQX|_g3S@sH1@E1 - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file diff --git a/RetailCoder.VBE/UI/FindSymbol/FindSymbolDialog.resx b/RetailCoder.VBE/UI/FindSymbol/FindSymbolDialog.resx index adccbf543f..0a0a5023e2 100644 --- a/RetailCoder.VBE/UI/FindSymbol/FindSymbolDialog.resx +++ b/RetailCoder.VBE/UI/FindSymbol/FindSymbolDialog.resx @@ -120,23 +120,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== - + \ No newline at end of file diff --git a/RetailCoder.VBE/UI/Refactorings/AssignedByValParameterQuickFixDialog.Designer.cs b/RetailCoder.VBE/UI/Refactorings/AssignedByValParameterQuickFixDialog.Designer.cs index 9d6687461d..e5cb2af33b 100644 --- a/RetailCoder.VBE/UI/Refactorings/AssignedByValParameterQuickFixDialog.Designer.cs +++ b/RetailCoder.VBE/UI/Refactorings/AssignedByValParameterQuickFixDialog.Designer.cs @@ -53,31 +53,28 @@ private void InitializeComponent() this.panel1.Controls.Add(this.InstructionsLabel); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(773, 99); + this.panel1.Size = new System.Drawing.Size(515, 64); this.panel1.TabIndex = 14; // // TitleLabel // this.TitleLabel.AutoSize = true; this.TitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.TitleLabel.Location = new System.Drawing.Point(18, 14); - this.TitleLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.TitleLabel.Location = new System.Drawing.Point(12, 9); this.TitleLabel.Name = "TitleLabel"; - this.TitleLabel.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.TitleLabel.Size = new System.Drawing.Size(273, 26); + this.TitleLabel.Padding = new System.Windows.Forms.Padding(2, 1, 2, 1); + this.TitleLabel.Size = new System.Drawing.Size(195, 17); this.TitleLabel.TabIndex = 4; this.TitleLabel.Text = "Specify Local Variable Name"; // // InstructionsLabel // this.InstructionsLabel.AutoSize = true; - this.InstructionsLabel.Location = new System.Drawing.Point(14, 46); - this.InstructionsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.InstructionsLabel.Location = new System.Drawing.Point(9, 30); this.InstructionsLabel.Name = "InstructionsLabel"; - this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(6); - this.InstructionsLabel.Size = new System.Drawing.Size(255, 32); + this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.InstructionsLabel.Size = new System.Drawing.Size(174, 21); this.InstructionsLabel.TabIndex = 5; this.InstructionsLabel.Text = "Please specify new name for \'{0}\'."; // @@ -86,10 +83,9 @@ private void InitializeComponent() this.panel2.BackColor = System.Drawing.SystemColors.ControlDark; this.panel2.Controls.Add(this.flowLayoutPanel2); this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel2.Location = new System.Drawing.Point(0, 243); - this.panel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.panel2.Location = new System.Drawing.Point(0, 158); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(773, 65); + this.panel2.Size = new System.Drawing.Size(515, 42); this.panel2.TabIndex = 16; // // flowLayoutPanel2 @@ -100,20 +96,18 @@ private void InitializeComponent() this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; this.flowLayoutPanel2.Location = new System.Drawing.Point(0, -1); - this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(12, 12, 0, 12); - this.flowLayoutPanel2.Size = new System.Drawing.Size(773, 66); + this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(8, 8, 0, 8); + this.flowLayoutPanel2.Size = new System.Drawing.Size(515, 43); this.flowLayoutPanel2.TabIndex = 2; // // CancelDialogButton // this.CancelDialogButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.CancelDialogButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelDialogButton.Location = new System.Drawing.Point(645, 17); - this.CancelDialogButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.CancelDialogButton.Location = new System.Drawing.Point(429, 11); this.CancelDialogButton.Name = "CancelDialogButton"; - this.CancelDialogButton.Size = new System.Drawing.Size(112, 35); + this.CancelDialogButton.Size = new System.Drawing.Size(75, 23); this.CancelDialogButton.TabIndex = 2; this.CancelDialogButton.Text = "Cancel"; this.CancelDialogButton.UseVisualStyleBackColor = false; @@ -122,10 +116,9 @@ private void InitializeComponent() // this.OkButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.OkButton.Location = new System.Drawing.Point(525, 17); - this.OkButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.OkButton.Location = new System.Drawing.Point(348, 11); this.OkButton.Name = "OkButton"; - this.OkButton.Size = new System.Drawing.Size(112, 35); + this.OkButton.Size = new System.Drawing.Size(75, 23); this.OkButton.TabIndex = 1; this.OkButton.Text = "Ok"; this.OkButton.UseVisualStyleBackColor = false; @@ -133,8 +126,7 @@ private void InitializeComponent() // InvalidNameValidationIcon // this.InvalidNameValidationIcon.Image = global::Rubberduck.Properties.Resources.cross_circle; - this.InvalidNameValidationIcon.Location = new System.Drawing.Point(739, 108); - this.InvalidNameValidationIcon.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.InvalidNameValidationIcon.Location = new System.Drawing.Point(493, 70); this.InvalidNameValidationIcon.Name = "InvalidNameValidationIcon"; this.InvalidNameValidationIcon.Size = new System.Drawing.Size(16, 16); this.InvalidNameValidationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -143,10 +135,9 @@ private void InitializeComponent() // // NewNameBox // - this.NewNameBox.Location = new System.Drawing.Point(86, 121); - this.NewNameBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.NewNameBox.Location = new System.Drawing.Point(57, 79); this.NewNameBox.Name = "NewNameBox"; - this.NewNameBox.Size = new System.Drawing.Size(666, 26); + this.NewNameBox.Size = new System.Drawing.Size(445, 20); this.NewNameBox.TabIndex = 15; this.NewNameBox.WordWrap = false; this.NewNameBox.TextChanged += new System.EventHandler(this.NewNameBox_TextChanged); @@ -154,26 +145,26 @@ private void InitializeComponent() // NameLabel // this.NameLabel.AutoSize = true; - this.NameLabel.Location = new System.Drawing.Point(14, 126); - this.NameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.NameLabel.Location = new System.Drawing.Point(9, 82); this.NameLabel.Name = "NameLabel"; - this.NameLabel.Size = new System.Drawing.Size(55, 20); + this.NameLabel.Size = new System.Drawing.Size(38, 13); this.NameLabel.TabIndex = 17; this.NameLabel.Text = "Name:"; // // FeedbackLabel // - this.FeedbackLabel.Location = new System.Drawing.Point(86, 160); + this.FeedbackLabel.Location = new System.Drawing.Point(57, 104); + this.FeedbackLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.FeedbackLabel.Name = "FeedbackLabel"; - this.FeedbackLabel.Size = new System.Drawing.Size(666, 61); + this.FeedbackLabel.Size = new System.Drawing.Size(444, 40); this.FeedbackLabel.TabIndex = 19; this.FeedbackLabel.Text = "THis has text"; // // AssignedByValParameterQuickFixDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(773, 308); + this.ClientSize = new System.Drawing.Size(515, 200); this.Controls.Add(this.FeedbackLabel); this.Controls.Add(this.panel1); this.Controls.Add(this.panel2); @@ -182,6 +173,7 @@ private void InitializeComponent() this.Controls.Add(this.NameLabel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "AssignedByValParameterQuickFixDialog"; diff --git a/RetailCoder.VBE/UI/Refactorings/AssignedByValParameterQuickFixDialog.resx b/RetailCoder.VBE/UI/Refactorings/AssignedByValParameterQuickFixDialog.resx index d3a1a2980d..0a0a5023e2 100644 --- a/RetailCoder.VBE/UI/Refactorings/AssignedByValParameterQuickFixDialog.resx +++ b/RetailCoder.VBE/UI/Refactorings/AssignedByValParameterQuickFixDialog.resx @@ -120,23 +120,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file diff --git a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.Designer.cs b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.Designer.cs index 1026be03e9..7945409468 100644 --- a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.Designer.cs +++ b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.Designer.cs @@ -60,37 +60,35 @@ private void InitializeComponent() this.DescriptionPanel.Controls.Add(this.InstructionsLabel); this.DescriptionPanel.Dock = System.Windows.Forms.DockStyle.Top; this.DescriptionPanel.Location = new System.Drawing.Point(0, 0); - this.DescriptionPanel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DescriptionPanel.Name = "DescriptionPanel"; - this.DescriptionPanel.Size = new System.Drawing.Size(667, 84); + this.DescriptionPanel.Size = new System.Drawing.Size(500, 68); this.DescriptionPanel.TabIndex = 14; // // TitleLabel // this.TitleLabel.AutoSize = true; this.TitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.TitleLabel.Location = new System.Drawing.Point(20, 11); - this.TitleLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.TitleLabel.Location = new System.Drawing.Point(15, 9); this.TitleLabel.Name = "TitleLabel"; - this.TitleLabel.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.TitleLabel.Size = new System.Drawing.Size(147, 22); + this.TitleLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.TitleLabel.Size = new System.Drawing.Size(126, 19); this.TitleLabel.TabIndex = 2; this.TitleLabel.Text = "Encapsulate Field"; // // InstructionsLabel // - this.InstructionsLabel.Location = new System.Drawing.Point(20, 30); + this.InstructionsLabel.Location = new System.Drawing.Point(15, 24); + this.InstructionsLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.InstructionsLabel.Name = "InstructionsLabel"; - this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.InstructionsLabel.Size = new System.Drawing.Size(549, 34); + this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.InstructionsLabel.Size = new System.Drawing.Size(412, 28); this.InstructionsLabel.TabIndex = 3; this.InstructionsLabel.Text = "Please specify property name, parameter accessibility, and setter type."; // // InvalidPropertyNameIcon // this.InvalidPropertyNameIcon.Image = global::Rubberduck.Properties.Resources.cross_circle; - this.InvalidPropertyNameIcon.Location = new System.Drawing.Point(473, 102); - this.InvalidPropertyNameIcon.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.InvalidPropertyNameIcon.Location = new System.Drawing.Point(355, 83); this.InvalidPropertyNameIcon.Name = "InvalidPropertyNameIcon"; this.InvalidPropertyNameIcon.Size = new System.Drawing.Size(16, 16); this.InvalidPropertyNameIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -101,13 +99,12 @@ private void InitializeComponent() // this.PreviewBox.BackColor = System.Drawing.Color.White; this.PreviewBox.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.PreviewBox.Location = new System.Drawing.Point(21, 222); - this.PreviewBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.PreviewBox.Location = new System.Drawing.Point(16, 180); this.PreviewBox.Multiline = true; this.PreviewBox.Name = "PreviewBox"; this.PreviewBox.ReadOnly = true; this.PreviewBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.PreviewBox.Size = new System.Drawing.Size(621, 217); + this.PreviewBox.Size = new System.Drawing.Size(467, 177); this.PreviewBox.TabIndex = 23; this.PreviewBox.TabStop = false; this.PreviewBox.WordWrap = false; @@ -115,28 +112,25 @@ private void InitializeComponent() // PreviewLabel // this.PreviewLabel.AutoSize = true; - this.PreviewLabel.Location = new System.Drawing.Point(20, 199); - this.PreviewLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.PreviewLabel.Location = new System.Drawing.Point(15, 162); this.PreviewLabel.Name = "PreviewLabel"; - this.PreviewLabel.Size = new System.Drawing.Size(61, 17); + this.PreviewLabel.Size = new System.Drawing.Size(48, 13); this.PreviewLabel.TabIndex = 22; this.PreviewLabel.Text = "Preview:"; // // PropertyNameTextBox // - this.PropertyNameTextBox.Location = new System.Drawing.Point(23, 113); - this.PropertyNameTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.PropertyNameTextBox.Location = new System.Drawing.Point(17, 92); this.PropertyNameTextBox.Name = "PropertyNameTextBox"; - this.PropertyNameTextBox.Size = new System.Drawing.Size(457, 22); + this.PropertyNameTextBox.Size = new System.Drawing.Size(344, 20); this.PropertyNameTextBox.TabIndex = 0; // // PropertyNameLabel // this.PropertyNameLabel.AutoSize = true; - this.PropertyNameLabel.Location = new System.Drawing.Point(19, 92); - this.PropertyNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.PropertyNameLabel.Location = new System.Drawing.Point(14, 75); this.PropertyNameLabel.Name = "PropertyNameLabel"; - this.PropertyNameLabel.Size = new System.Drawing.Size(107, 17); + this.PropertyNameLabel.Size = new System.Drawing.Size(80, 13); this.PropertyNameLabel.TabIndex = 15; this.PropertyNameLabel.Text = "&Property Name:"; // @@ -147,21 +141,19 @@ private void InitializeComponent() this.flowLayoutPanel2.Controls.Add(this.OkButton); this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 445); - this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 362); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(11, 10, 0, 10); - this.flowLayoutPanel2.Size = new System.Drawing.Size(667, 53); + this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(8, 8, 0, 8); + this.flowLayoutPanel2.Size = new System.Drawing.Size(500, 43); this.flowLayoutPanel2.TabIndex = 27; // // CancelDialogButton // this.CancelDialogButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.CancelDialogButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelDialogButton.Location = new System.Drawing.Point(552, 14); - this.CancelDialogButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.CancelDialogButton.Location = new System.Drawing.Point(414, 11); this.CancelDialogButton.Name = "CancelDialogButton"; - this.CancelDialogButton.Size = new System.Drawing.Size(100, 28); + this.CancelDialogButton.Size = new System.Drawing.Size(75, 23); this.CancelDialogButton.TabIndex = 5; this.CancelDialogButton.Text = "&Cancel"; this.CancelDialogButton.UseVisualStyleBackColor = false; @@ -170,10 +162,9 @@ private void InitializeComponent() // this.OkButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.OkButton.Location = new System.Drawing.Point(444, 14); - this.OkButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.OkButton.Location = new System.Drawing.Point(333, 11); this.OkButton.Name = "OkButton"; - this.OkButton.Size = new System.Drawing.Size(100, 28); + this.OkButton.Size = new System.Drawing.Size(75, 23); this.OkButton.TabIndex = 4; this.OkButton.Text = "&Ok"; this.OkButton.UseVisualStyleBackColor = false; @@ -181,8 +172,7 @@ private void InitializeComponent() // InvalidVariableNameIcon // this.InvalidVariableNameIcon.Image = global::Rubberduck.Properties.Resources.cross_circle; - this.InvalidVariableNameIcon.Location = new System.Drawing.Point(473, 156); - this.InvalidVariableNameIcon.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.InvalidVariableNameIcon.Location = new System.Drawing.Point(355, 127); this.InvalidVariableNameIcon.Name = "InvalidVariableNameIcon"; this.InvalidVariableNameIcon.Size = new System.Drawing.Size(16, 16); this.InvalidVariableNameIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -192,20 +182,18 @@ private void InitializeComponent() // // ParameterNameTextBox // - this.ParameterNameTextBox.Location = new System.Drawing.Point(23, 166); - this.ParameterNameTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.ParameterNameTextBox.Location = new System.Drawing.Point(17, 135); this.ParameterNameTextBox.Name = "ParameterNameTextBox"; - this.ParameterNameTextBox.Size = new System.Drawing.Size(457, 22); + this.ParameterNameTextBox.Size = new System.Drawing.Size(344, 20); this.ParameterNameTextBox.TabIndex = 1; this.ParameterNameTextBox.Text = "value"; // // VariableNameLabel // this.VariableNameLabel.AutoSize = true; - this.VariableNameLabel.Location = new System.Drawing.Point(19, 143); - this.VariableNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.VariableNameLabel.Location = new System.Drawing.Point(14, 116); this.VariableNameLabel.Name = "VariableNameLabel"; - this.VariableNameLabel.Size = new System.Drawing.Size(119, 17); + this.VariableNameLabel.Size = new System.Drawing.Size(89, 13); this.VariableNameLabel.TabIndex = 28; this.VariableNameLabel.Text = "Parameter &Name:"; // @@ -213,11 +201,11 @@ private void InitializeComponent() // this.SetterTypeGroupBox.Controls.Add(this.SetSetterTypeCheckBox); this.SetterTypeGroupBox.Controls.Add(this.LetSetterTypeCheckBox); - this.SetterTypeGroupBox.Location = new System.Drawing.Point(501, 103); - this.SetterTypeGroupBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.SetterTypeGroupBox.Location = new System.Drawing.Point(376, 84); + this.SetterTypeGroupBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.SetterTypeGroupBox.Name = "SetterTypeGroupBox"; - this.SetterTypeGroupBox.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.SetterTypeGroupBox.Size = new System.Drawing.Size(141, 86); + this.SetterTypeGroupBox.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.SetterTypeGroupBox.Size = new System.Drawing.Size(106, 70); this.SetterTypeGroupBox.TabIndex = 2; this.SetterTypeGroupBox.TabStop = false; this.SetterTypeGroupBox.Text = "Assignment:"; @@ -225,10 +213,10 @@ private void InitializeComponent() // SetSetterTypeCheckBox // this.SetSetterTypeCheckBox.AutoSize = true; - this.SetSetterTypeCheckBox.Location = new System.Drawing.Point(13, 48); - this.SetSetterTypeCheckBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.SetSetterTypeCheckBox.Location = new System.Drawing.Point(10, 39); + this.SetSetterTypeCheckBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.SetSetterTypeCheckBox.Name = "SetSetterTypeCheckBox"; - this.SetSetterTypeCheckBox.Size = new System.Drawing.Size(51, 21); + this.SetSetterTypeCheckBox.Size = new System.Drawing.Size(42, 17); this.SetSetterTypeCheckBox.TabIndex = 3; this.SetSetterTypeCheckBox.Text = "&Set"; this.SetSetterTypeCheckBox.UseVisualStyleBackColor = true; @@ -236,10 +224,10 @@ private void InitializeComponent() // LetSetterTypeCheckBox // this.LetSetterTypeCheckBox.AutoSize = true; - this.LetSetterTypeCheckBox.Location = new System.Drawing.Point(13, 21); - this.LetSetterTypeCheckBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.LetSetterTypeCheckBox.Location = new System.Drawing.Point(10, 17); + this.LetSetterTypeCheckBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.LetSetterTypeCheckBox.Name = "LetSetterTypeCheckBox"; - this.LetSetterTypeCheckBox.Size = new System.Drawing.Size(50, 21); + this.LetSetterTypeCheckBox.Size = new System.Drawing.Size(41, 17); this.LetSetterTypeCheckBox.TabIndex = 2; this.LetSetterTypeCheckBox.Text = "&Let"; this.LetSetterTypeCheckBox.UseVisualStyleBackColor = true; @@ -247,10 +235,10 @@ private void InitializeComponent() // EncapsulateFieldDialog // this.AcceptButton = this.OkButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.CancelDialogButton; - this.ClientSize = new System.Drawing.Size(667, 498); + this.ClientSize = new System.Drawing.Size(500, 405); this.Controls.Add(this.SetterTypeGroupBox); this.Controls.Add(this.InvalidVariableNameIcon); this.Controls.Add(this.ParameterNameTextBox); @@ -264,7 +252,7 @@ private void InitializeComponent() this.Controls.Add(this.DescriptionPanel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "EncapsulateFieldDialog"; diff --git a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.resx b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.resx index d3a1a2980d..0a0a5023e2 100644 --- a/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.resx +++ b/RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.resx @@ -120,23 +120,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file diff --git a/RetailCoder.VBE/UI/Refactorings/ExtractInterfaceDialog.Designer.cs b/RetailCoder.VBE/UI/Refactorings/ExtractInterfaceDialog.Designer.cs index 7c294dd60f..d3b4e7b2b1 100644 --- a/RetailCoder.VBE/UI/Refactorings/ExtractInterfaceDialog.Designer.cs +++ b/RetailCoder.VBE/UI/Refactorings/ExtractInterfaceDialog.Designer.cs @@ -116,7 +116,7 @@ private void InitializeComponent() this.TitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold); this.TitleLabel.Location = new System.Drawing.Point(15, 9); this.TitleLabel.Name = "TitleLabel"; - this.TitleLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.TitleLabel.Padding = new System.Windows.Forms.Padding(2); this.TitleLabel.Size = new System.Drawing.Size(115, 19); this.TitleLabel.TabIndex = 2; this.TitleLabel.Text = "Extract Interface"; @@ -126,7 +126,7 @@ private void InitializeComponent() this.InstructionsLabel.Location = new System.Drawing.Point(15, 24); this.InstructionsLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.InstructionsLabel.Name = "InstructionsLabel"; - this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(3); this.InstructionsLabel.Size = new System.Drawing.Size(412, 28); this.InstructionsLabel.TabIndex = 3; this.InstructionsLabel.Text = "Please specify interface name and members."; @@ -151,9 +151,9 @@ private void InitializeComponent() this.MembersGroupBox.Controls.Add(this.DeselectAllButton); this.MembersGroupBox.Controls.Add(this.SelectAllButton); this.MembersGroupBox.Location = new System.Drawing.Point(12, 115); - this.MembersGroupBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.MembersGroupBox.Margin = new System.Windows.Forms.Padding(2); this.MembersGroupBox.Name = "MembersGroupBox"; - this.MembersGroupBox.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.MembersGroupBox.Padding = new System.Windows.Forms.Padding(2); this.MembersGroupBox.Size = new System.Drawing.Size(436, 174); this.MembersGroupBox.TabIndex = 1; this.MembersGroupBox.TabStop = false; @@ -169,7 +169,7 @@ private void InitializeComponent() this.InterfaceMembersGridView.ColumnHeadersVisible = false; this.InterfaceMembersGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.InterfaceMembersGridView.Location = new System.Drawing.Point(5, 21); - this.InterfaceMembersGridView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.InterfaceMembersGridView.Margin = new System.Windows.Forms.Padding(2); this.InterfaceMembersGridView.MultiSelect = false; this.InterfaceMembersGridView.Name = "InterfaceMembersGridView"; this.InterfaceMembersGridView.RowHeadersVisible = false; @@ -183,7 +183,7 @@ private void InitializeComponent() // DeselectAllButton // this.DeselectAllButton.Location = new System.Drawing.Point(331, 52); - this.DeselectAllButton.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.DeselectAllButton.Margin = new System.Windows.Forms.Padding(2); this.DeselectAllButton.Name = "DeselectAllButton"; this.DeselectAllButton.Size = new System.Drawing.Size(100, 26); this.DeselectAllButton.TabIndex = 3; @@ -193,7 +193,7 @@ private void InitializeComponent() // SelectAllButton // this.SelectAllButton.Location = new System.Drawing.Point(331, 21); - this.SelectAllButton.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.SelectAllButton.Margin = new System.Windows.Forms.Padding(2); this.SelectAllButton.Name = "SelectAllButton"; this.SelectAllButton.Size = new System.Drawing.Size(100, 26); this.SelectAllButton.TabIndex = 2; @@ -215,7 +215,7 @@ private void InitializeComponent() this.Controls.Add(this.flowLayoutPanel2); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Margin = new System.Windows.Forms.Padding(2); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ExtractInterfaceDialog"; diff --git a/RetailCoder.VBE/UI/Refactorings/ExtractInterfaceDialog.resx b/RetailCoder.VBE/UI/Refactorings/ExtractInterfaceDialog.resx index d3a1a2980d..0a0a5023e2 100644 --- a/RetailCoder.VBE/UI/Refactorings/ExtractInterfaceDialog.resx +++ b/RetailCoder.VBE/UI/Refactorings/ExtractInterfaceDialog.resx @@ -120,23 +120,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file diff --git a/RetailCoder.VBE/UI/Refactorings/ExtractMethodDialog.Designer.cs b/RetailCoder.VBE/UI/Refactorings/ExtractMethodDialog.Designer.cs index 409633a9ab..a882325525 100644 --- a/RetailCoder.VBE/UI/Refactorings/ExtractMethodDialog.Designer.cs +++ b/RetailCoder.VBE/UI/Refactorings/ExtractMethodDialog.Designer.cs @@ -62,21 +62,19 @@ private void InitializeComponent() this.flowLayoutPanel2.Controls.Add(this.OkButton); this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 539); - this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 438); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(11, 10, 0, 10); - this.flowLayoutPanel2.Size = new System.Drawing.Size(800, 53); + this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(8, 8, 0, 8); + this.flowLayoutPanel2.Size = new System.Drawing.Size(600, 43); this.flowLayoutPanel2.TabIndex = 1; // // CancelDialogButton // this.CancelDialogButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.CancelDialogButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelDialogButton.Location = new System.Drawing.Point(685, 14); - this.CancelDialogButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.CancelDialogButton.Location = new System.Drawing.Point(514, 11); this.CancelDialogButton.Name = "CancelDialogButton"; - this.CancelDialogButton.Size = new System.Drawing.Size(100, 28); + this.CancelDialogButton.Size = new System.Drawing.Size(75, 23); this.CancelDialogButton.TabIndex = 4; this.CancelDialogButton.Text = "Cancel"; this.CancelDialogButton.UseVisualStyleBackColor = false; @@ -85,10 +83,9 @@ private void InitializeComponent() // this.OkButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.OkButton.Location = new System.Drawing.Point(577, 14); - this.OkButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.OkButton.Location = new System.Drawing.Point(433, 11); this.OkButton.Name = "OkButton"; - this.OkButton.Size = new System.Drawing.Size(100, 28); + this.OkButton.Size = new System.Drawing.Size(75, 23); this.OkButton.TabIndex = 3; this.OkButton.Text = "Ok"; this.OkButton.UseVisualStyleBackColor = false; @@ -100,29 +97,28 @@ private void InitializeComponent() this.panel2.Controls.Add(this.InstructionsLabel); this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(800, 84); + this.panel2.Size = new System.Drawing.Size(600, 68); this.panel2.TabIndex = 13; // // TitleLabel // this.TitleLabel.AutoSize = true; this.TitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.TitleLabel.Location = new System.Drawing.Point(20, 11); - this.TitleLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.TitleLabel.Location = new System.Drawing.Point(15, 9); this.TitleLabel.Name = "TitleLabel"; - this.TitleLabel.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.TitleLabel.Size = new System.Drawing.Size(128, 22); + this.TitleLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.TitleLabel.Size = new System.Drawing.Size(107, 19); this.TitleLabel.TabIndex = 2; this.TitleLabel.Text = "Extract Method"; // // InstructionsLabel // - this.InstructionsLabel.Location = new System.Drawing.Point(20, 30); + this.InstructionsLabel.Location = new System.Drawing.Point(15, 24); + this.InstructionsLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.InstructionsLabel.Name = "InstructionsLabel"; - this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.InstructionsLabel.Size = new System.Drawing.Size(549, 34); + this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(3, 3, 3, 3); + this.InstructionsLabel.Size = new System.Drawing.Size(412, 28); this.InstructionsLabel.TabIndex = 3; this.InstructionsLabel.Text = "Please specify method name, return type and/or parameters (if applicable), and ot" + "her options."; @@ -138,17 +134,15 @@ private void InitializeComponent() this.panel1.Controls.Add(this.AccessibilityLabel); this.panel1.Controls.Add(this.MethodNameBox); this.panel1.Controls.Add(this.NameLabel); - this.panel1.Location = new System.Drawing.Point(0, 87); - this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.panel1.Location = new System.Drawing.Point(0, 71); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(800, 458); + this.panel1.Size = new System.Drawing.Size(600, 372); this.panel1.TabIndex = 14; // // InvalidNameValidationIcon // this.InvalidNameValidationIcon.Image = global::Rubberduck.Properties.Resources.cross_circle; - this.InvalidNameValidationIcon.Location = new System.Drawing.Point(769, 1); - this.InvalidNameValidationIcon.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.InvalidNameValidationIcon.Location = new System.Drawing.Point(577, 1); this.InvalidNameValidationIcon.Name = "InvalidNameValidationIcon"; this.InvalidNameValidationIcon.Size = new System.Drawing.Size(16, 16); this.InvalidNameValidationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -161,13 +155,12 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.PreviewBox.BackColor = System.Drawing.Color.White; this.PreviewBox.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.PreviewBox.Location = new System.Drawing.Point(24, 254); - this.PreviewBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.PreviewBox.Location = new System.Drawing.Point(18, 206); this.PreviewBox.Multiline = true; this.PreviewBox.Name = "PreviewBox"; this.PreviewBox.ReadOnly = true; this.PreviewBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.PreviewBox.Size = new System.Drawing.Size(759, 181); + this.PreviewBox.Size = new System.Drawing.Size(570, 148); this.PreviewBox.TabIndex = 9; this.PreviewBox.TabStop = false; this.PreviewBox.WordWrap = false; @@ -175,10 +168,9 @@ private void InitializeComponent() // PreviewLabel // this.PreviewLabel.AutoSize = true; - this.PreviewLabel.Location = new System.Drawing.Point(20, 234); - this.PreviewLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.PreviewLabel.Location = new System.Drawing.Point(15, 190); this.PreviewLabel.Name = "PreviewLabel"; - this.PreviewLabel.Size = new System.Drawing.Size(61, 17); + this.PreviewLabel.Size = new System.Drawing.Size(48, 13); this.PreviewLabel.TabIndex = 8; this.PreviewLabel.Text = "Preview:"; // @@ -188,72 +180,66 @@ private void InitializeComponent() this.MethodParametersGrid.AllowUserToDeleteRows = false; this.MethodParametersGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.MethodParametersGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.MethodParametersGrid.Location = new System.Drawing.Point(24, 101); - this.MethodParametersGrid.Margin = new System.Windows.Forms.Padding(11, 4, 11, 4); + this.MethodParametersGrid.Location = new System.Drawing.Point(18, 82); + this.MethodParametersGrid.Margin = new System.Windows.Forms.Padding(8, 3, 8, 3); this.MethodParametersGrid.Name = "MethodParametersGrid"; - this.MethodParametersGrid.Size = new System.Drawing.Size(760, 119); + this.MethodParametersGrid.Size = new System.Drawing.Size(570, 97); this.MethodParametersGrid.TabIndex = 2; // // ParametersLabel // this.ParametersLabel.AutoSize = true; - this.ParametersLabel.Location = new System.Drawing.Point(20, 81); - this.ParametersLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.ParametersLabel.Location = new System.Drawing.Point(15, 66); this.ParametersLabel.Name = "ParametersLabel"; - this.ParametersLabel.Size = new System.Drawing.Size(85, 17); + this.ParametersLabel.Size = new System.Drawing.Size(63, 13); this.ParametersLabel.TabIndex = 6; this.ParametersLabel.Text = "Parameters:"; // // MethodAccessibilityCombo // this.MethodAccessibilityCombo.FormattingEnabled = true; - this.MethodAccessibilityCombo.Location = new System.Drawing.Point(573, 42); - this.MethodAccessibilityCombo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.MethodAccessibilityCombo.Location = new System.Drawing.Point(430, 34); this.MethodAccessibilityCombo.Name = "MethodAccessibilityCombo"; - this.MethodAccessibilityCombo.Size = new System.Drawing.Size(205, 24); + this.MethodAccessibilityCombo.Size = new System.Drawing.Size(155, 21); this.MethodAccessibilityCombo.TabIndex = 1; // // AccessibilityLabel // this.AccessibilityLabel.AutoSize = true; - this.AccessibilityLabel.Location = new System.Drawing.Point(475, 46); - this.AccessibilityLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.AccessibilityLabel.Location = new System.Drawing.Point(356, 37); this.AccessibilityLabel.Name = "AccessibilityLabel"; - this.AccessibilityLabel.Size = new System.Drawing.Size(88, 17); + this.AccessibilityLabel.Size = new System.Drawing.Size(67, 13); this.AccessibilityLabel.TabIndex = 4; this.AccessibilityLabel.Text = "Accessibility:"; // // MethodNameBox // - this.MethodNameBox.Location = new System.Drawing.Point(111, 9); - this.MethodNameBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.MethodNameBox.Location = new System.Drawing.Point(83, 7); this.MethodNameBox.Name = "MethodNameBox"; - this.MethodNameBox.Size = new System.Drawing.Size(667, 22); + this.MethodNameBox.Size = new System.Drawing.Size(501, 20); this.MethodNameBox.TabIndex = 0; // // NameLabel // this.NameLabel.AutoSize = true; - this.NameLabel.Location = new System.Drawing.Point(20, 12); - this.NameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.NameLabel.Location = new System.Drawing.Point(15, 10); this.NameLabel.Name = "NameLabel"; - this.NameLabel.Size = new System.Drawing.Size(49, 17); + this.NameLabel.Size = new System.Drawing.Size(38, 13); this.NameLabel.TabIndex = 0; this.NameLabel.Text = "Name:"; // // ExtractMethodDialog // this.AcceptButton = this.OkButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.CancelDialogButton; - this.ClientSize = new System.Drawing.Size(800, 592); + this.ClientSize = new System.Drawing.Size(600, 481); this.Controls.Add(this.panel1); this.Controls.Add(this.panel2); this.Controls.Add(this.flowLayoutPanel2); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ExtractMethodDialog"; diff --git a/RetailCoder.VBE/UI/Refactorings/ExtractMethodDialog.resx b/RetailCoder.VBE/UI/Refactorings/ExtractMethodDialog.resx index d3a1a2980d..0a0a5023e2 100644 --- a/RetailCoder.VBE/UI/Refactorings/ExtractMethodDialog.resx +++ b/RetailCoder.VBE/UI/Refactorings/ExtractMethodDialog.resx @@ -120,23 +120,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file diff --git a/RetailCoder.VBE/UI/Refactorings/RemoveParametersDialog.Designer.cs b/RetailCoder.VBE/UI/Refactorings/RemoveParametersDialog.Designer.cs index 2f3d83ddc5..d34f98c4a0 100644 --- a/RetailCoder.VBE/UI/Refactorings/RemoveParametersDialog.Designer.cs +++ b/RetailCoder.VBE/UI/Refactorings/RemoveParametersDialog.Designer.cs @@ -53,21 +53,19 @@ private void InitializeComponent() this.flowLayoutPanel2.Controls.Add(this.OkButton); this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 285); - this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(4); + this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 232); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(11, 10, 0, 10); - this.flowLayoutPanel2.Size = new System.Drawing.Size(536, 53); + this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(8, 8, 0, 8); + this.flowLayoutPanel2.Size = new System.Drawing.Size(402, 43); this.flowLayoutPanel2.TabIndex = 11; // // CancelDialogButton // this.CancelDialogButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.CancelDialogButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelDialogButton.Location = new System.Drawing.Point(421, 14); - this.CancelDialogButton.Margin = new System.Windows.Forms.Padding(4); + this.CancelDialogButton.Location = new System.Drawing.Point(316, 11); this.CancelDialogButton.Name = "CancelDialogButton"; - this.CancelDialogButton.Size = new System.Drawing.Size(100, 28); + this.CancelDialogButton.Size = new System.Drawing.Size(75, 23); this.CancelDialogButton.TabIndex = 4; this.CancelDialogButton.Text = "Cancel"; this.CancelDialogButton.UseVisualStyleBackColor = false; @@ -76,10 +74,9 @@ private void InitializeComponent() // this.OkButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.OkButton.Location = new System.Drawing.Point(313, 14); - this.OkButton.Margin = new System.Windows.Forms.Padding(4); + this.OkButton.Location = new System.Drawing.Point(235, 11); this.OkButton.Name = "OkButton"; - this.OkButton.Size = new System.Drawing.Size(100, 28); + this.OkButton.Size = new System.Drawing.Size(75, 23); this.OkButton.TabIndex = 3; this.OkButton.Text = "Ok"; this.OkButton.UseVisualStyleBackColor = false; @@ -91,20 +88,18 @@ private void InitializeComponent() this.panel1.Controls.Add(this.TitleLabel); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Margin = new System.Windows.Forms.Padding(4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(536, 87); + this.panel1.Size = new System.Drawing.Size(402, 71); this.panel1.TabIndex = 12; // // InstructionsLabel // this.InstructionsLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.InstructionsLabel.Location = new System.Drawing.Point(12, 37); - this.InstructionsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.InstructionsLabel.Location = new System.Drawing.Point(9, 30); this.InstructionsLabel.Name = "InstructionsLabel"; - this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(5); - this.InstructionsLabel.Size = new System.Drawing.Size(511, 42); + this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.InstructionsLabel.Size = new System.Drawing.Size(383, 34); this.InstructionsLabel.TabIndex = 6; this.InstructionsLabel.Text = "Select a parameter and double-click it or use buttons to remove or restore it."; // @@ -112,11 +107,10 @@ private void InitializeComponent() // this.TitleLabel.AutoSize = true; this.TitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.TitleLabel.Location = new System.Drawing.Point(16, 11); - this.TitleLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.TitleLabel.Location = new System.Drawing.Point(12, 9); this.TitleLabel.Name = "TitleLabel"; - this.TitleLabel.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.TitleLabel.Size = new System.Drawing.Size(166, 22); + this.TitleLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.TitleLabel.Size = new System.Drawing.Size(140, 19); this.TitleLabel.TabIndex = 4; this.TitleLabel.Text = "Remove parameters"; // @@ -128,8 +122,8 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.MethodParametersGrid.BackgroundColor = System.Drawing.Color.White; this.MethodParametersGrid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.MethodParametersGrid.Location = new System.Drawing.Point(12, 95); - this.MethodParametersGrid.Margin = new System.Windows.Forms.Padding(11, 4, 11, 4); + this.MethodParametersGrid.Location = new System.Drawing.Point(9, 77); + this.MethodParametersGrid.Margin = new System.Windows.Forms.Padding(8, 3, 8, 3); this.MethodParametersGrid.MultiSelect = false; this.MethodParametersGrid.Name = "MethodParametersGrid"; this.MethodParametersGrid.RowHeadersVisible = false; @@ -139,7 +133,7 @@ private void InitializeComponent() this.MethodParametersGrid.ShowCellToolTips = false; this.MethodParametersGrid.ShowEditingIcon = false; this.MethodParametersGrid.ShowRowErrors = false; - this.MethodParametersGrid.Size = new System.Drawing.Size(401, 183); + this.MethodParametersGrid.Size = new System.Drawing.Size(301, 149); this.MethodParametersGrid.TabIndex = 0; // // RemoveButton @@ -147,10 +141,9 @@ private void InitializeComponent() this.RemoveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.RemoveButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.RemoveButton.Image = global::Rubberduck.Properties.Resources.cross_script; - this.RemoveButton.Location = new System.Drawing.Point(421, 95); - this.RemoveButton.Margin = new System.Windows.Forms.Padding(4); + this.RemoveButton.Location = new System.Drawing.Point(316, 77); this.RemoveButton.Name = "RemoveButton"; - this.RemoveButton.Size = new System.Drawing.Size(100, 89); + this.RemoveButton.Size = new System.Drawing.Size(75, 72); this.RemoveButton.TabIndex = 1; this.RemoveButton.Text = "Remove"; this.RemoveButton.TextAlign = System.Drawing.ContentAlignment.BottomCenter; @@ -164,10 +157,9 @@ private void InitializeComponent() this.RestoreButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.RestoreButton.Image = global::Rubberduck.Properties.Resources.arrow_return_180_left; this.RestoreButton.ImageAlign = System.Drawing.ContentAlignment.TopCenter; - this.RestoreButton.Location = new System.Drawing.Point(421, 190); - this.RestoreButton.Margin = new System.Windows.Forms.Padding(4); + this.RestoreButton.Location = new System.Drawing.Point(316, 154); this.RestoreButton.Name = "RestoreButton"; - this.RestoreButton.Size = new System.Drawing.Size(100, 89); + this.RestoreButton.Size = new System.Drawing.Size(75, 72); this.RestoreButton.TabIndex = 2; this.RestoreButton.Text = "Restore"; this.RestoreButton.TextAlign = System.Drawing.ContentAlignment.BottomCenter; @@ -178,10 +170,10 @@ private void InitializeComponent() // RemoveParametersDialog // this.AcceptButton = this.OkButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.CancelDialogButton; - this.ClientSize = new System.Drawing.Size(536, 338); + this.ClientSize = new System.Drawing.Size(402, 275); this.Controls.Add(this.flowLayoutPanel2); this.Controls.Add(this.RestoreButton); this.Controls.Add(this.panel1); @@ -189,7 +181,7 @@ private void InitializeComponent() this.Controls.Add(this.RemoveButton); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "RemoveParametersDialog"; diff --git a/RetailCoder.VBE/UI/Refactorings/RemoveParametersDialog.resx b/RetailCoder.VBE/UI/Refactorings/RemoveParametersDialog.resx index d3a1a2980d..0a0a5023e2 100644 --- a/RetailCoder.VBE/UI/Refactorings/RemoveParametersDialog.resx +++ b/RetailCoder.VBE/UI/Refactorings/RemoveParametersDialog.resx @@ -120,23 +120,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file diff --git a/RetailCoder.VBE/UI/Refactorings/RenameDialog.Designer.cs b/RetailCoder.VBE/UI/Refactorings/RenameDialog.Designer.cs index c1bb88de85..12c742a48d 100644 --- a/RetailCoder.VBE/UI/Refactorings/RenameDialog.Designer.cs +++ b/RetailCoder.VBE/UI/Refactorings/RenameDialog.Designer.cs @@ -55,31 +55,28 @@ private void InitializeComponent() this.panel1.Controls.Add(this.InstructionsLabel); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Margin = new System.Windows.Forms.Padding(4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(684, 79); + this.panel1.Size = new System.Drawing.Size(513, 64); this.panel1.TabIndex = 0; // // TitleLabel // this.TitleLabel.AutoSize = true; this.TitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.TitleLabel.Location = new System.Drawing.Point(16, 11); - this.TitleLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.TitleLabel.Location = new System.Drawing.Point(12, 9); this.TitleLabel.Name = "TitleLabel"; - this.TitleLabel.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.TitleLabel.Size = new System.Drawing.Size(145, 22); + this.TitleLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.TitleLabel.Size = new System.Drawing.Size(126, 19); this.TitleLabel.TabIndex = 4; this.TitleLabel.Text = "Rename identifier"; // // InstructionsLabel // this.InstructionsLabel.AutoSize = true; - this.InstructionsLabel.Location = new System.Drawing.Point(12, 37); - this.InstructionsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.InstructionsLabel.Location = new System.Drawing.Point(9, 30); this.InstructionsLabel.Name = "InstructionsLabel"; - this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(5); - this.InstructionsLabel.Size = new System.Drawing.Size(230, 27); + this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.InstructionsLabel.Size = new System.Drawing.Size(174, 21); this.InstructionsLabel.TabIndex = 5; this.InstructionsLabel.Text = "Please specify new name for \'{0}\'."; // @@ -88,10 +85,9 @@ private void InitializeComponent() this.panel2.BackColor = System.Drawing.SystemColors.ControlDark; this.panel2.Controls.Add(this.flowLayoutPanel2); this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel2.Location = new System.Drawing.Point(0, 157); - this.panel2.Margin = new System.Windows.Forms.Padding(4); + this.panel2.Location = new System.Drawing.Point(0, 128); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(684, 52); + this.panel2.Size = new System.Drawing.Size(513, 42); this.panel2.TabIndex = 1; // // flowLayoutPanel2 @@ -102,20 +98,18 @@ private void InitializeComponent() this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; this.flowLayoutPanel2.Location = new System.Drawing.Point(0, -1); - this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(4); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(11, 10, 0, 10); - this.flowLayoutPanel2.Size = new System.Drawing.Size(684, 53); + this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(8, 8, 0, 8); + this.flowLayoutPanel2.Size = new System.Drawing.Size(513, 43); this.flowLayoutPanel2.TabIndex = 2; // // CancelDialogButton // this.CancelDialogButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.CancelDialogButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelDialogButton.Location = new System.Drawing.Point(569, 14); - this.CancelDialogButton.Margin = new System.Windows.Forms.Padding(4); + this.CancelDialogButton.Location = new System.Drawing.Point(427, 11); this.CancelDialogButton.Name = "CancelDialogButton"; - this.CancelDialogButton.Size = new System.Drawing.Size(100, 28); + this.CancelDialogButton.Size = new System.Drawing.Size(75, 23); this.CancelDialogButton.TabIndex = 2; this.CancelDialogButton.Text = "Cancel"; this.CancelDialogButton.UseVisualStyleBackColor = false; @@ -124,10 +118,9 @@ private void InitializeComponent() // this.OkButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.OkButton.Location = new System.Drawing.Point(461, 14); - this.OkButton.Margin = new System.Windows.Forms.Padding(4); + this.OkButton.Location = new System.Drawing.Point(346, 11); this.OkButton.Name = "OkButton"; - this.OkButton.Size = new System.Drawing.Size(100, 28); + this.OkButton.Size = new System.Drawing.Size(75, 23); this.OkButton.TabIndex = 1; this.OkButton.Text = "Ok"; this.OkButton.UseVisualStyleBackColor = false; @@ -135,8 +128,7 @@ private void InitializeComponent() // InvalidNameValidationIcon // this.InvalidNameValidationIcon.Image = global::Rubberduck.Properties.Resources.cross_circle; - this.InvalidNameValidationIcon.Location = new System.Drawing.Point(657, 86); - this.InvalidNameValidationIcon.Margin = new System.Windows.Forms.Padding(4); + this.InvalidNameValidationIcon.Location = new System.Drawing.Point(493, 70); this.InvalidNameValidationIcon.Name = "InvalidNameValidationIcon"; this.InvalidNameValidationIcon.Size = new System.Drawing.Size(16, 16); this.InvalidNameValidationIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -145,29 +137,27 @@ private void InitializeComponent() // // NewNameBox // - this.NewNameBox.Location = new System.Drawing.Point(76, 97); - this.NewNameBox.Margin = new System.Windows.Forms.Padding(4); + this.NewNameBox.Location = new System.Drawing.Point(57, 79); this.NewNameBox.Name = "NewNameBox"; - this.NewNameBox.Size = new System.Drawing.Size(592, 22); + this.NewNameBox.Size = new System.Drawing.Size(445, 20); this.NewNameBox.TabIndex = 0; // // NameLabel // this.NameLabel.AutoSize = true; - this.NameLabel.Location = new System.Drawing.Point(12, 101); - this.NameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.NameLabel.Location = new System.Drawing.Point(9, 82); this.NameLabel.Name = "NameLabel"; - this.NameLabel.Size = new System.Drawing.Size(49, 17); + this.NameLabel.Size = new System.Drawing.Size(38, 13); this.NameLabel.TabIndex = 11; this.NameLabel.Text = "Name:"; // // RenameDialog // this.AcceptButton = this.OkButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.CancelDialogButton; - this.ClientSize = new System.Drawing.Size(684, 209); + this.ClientSize = new System.Drawing.Size(513, 170); this.Controls.Add(this.InvalidNameValidationIcon); this.Controls.Add(this.NewNameBox); this.Controls.Add(this.NameLabel); @@ -175,7 +165,6 @@ private void InitializeComponent() this.Controls.Add(this.panel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(4); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "RenameDialog"; diff --git a/RetailCoder.VBE/UI/Refactorings/RenameDialog.resx b/RetailCoder.VBE/UI/Refactorings/RenameDialog.resx index d3a1a2980d..0a0a5023e2 100644 --- a/RetailCoder.VBE/UI/Refactorings/RenameDialog.resx +++ b/RetailCoder.VBE/UI/Refactorings/RenameDialog.resx @@ -120,23 +120,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file diff --git a/RetailCoder.VBE/UI/Refactorings/ReorderParametersDialog.Designer.cs b/RetailCoder.VBE/UI/Refactorings/ReorderParametersDialog.Designer.cs index 8f7e5f215c..7cada55d5f 100644 --- a/RetailCoder.VBE/UI/Refactorings/ReorderParametersDialog.Designer.cs +++ b/RetailCoder.VBE/UI/Refactorings/ReorderParametersDialog.Designer.cs @@ -51,10 +51,9 @@ private void InitializeComponent() this.MoveDownButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.MoveDownButton.Image = ((System.Drawing.Image)(resources.GetObject("MoveDownButton.Image"))); this.MoveDownButton.ImageAlign = System.Drawing.ContentAlignment.TopCenter; - this.MoveDownButton.Location = new System.Drawing.Point(421, 190); - this.MoveDownButton.Margin = new System.Windows.Forms.Padding(4); + this.MoveDownButton.Location = new System.Drawing.Point(316, 154); this.MoveDownButton.Name = "MoveDownButton"; - this.MoveDownButton.Size = new System.Drawing.Size(100, 89); + this.MoveDownButton.Size = new System.Drawing.Size(75, 72); this.MoveDownButton.TabIndex = 2; this.MoveDownButton.Text = "Move down"; this.MoveDownButton.TextAlign = System.Drawing.ContentAlignment.BottomCenter; @@ -69,21 +68,19 @@ private void InitializeComponent() this.flowLayoutPanel2.Controls.Add(this.OkButton); this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 285); - this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(4); + this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 232); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; - this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(11, 10, 0, 10); - this.flowLayoutPanel2.Size = new System.Drawing.Size(536, 53); + this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(8, 8, 0, 8); + this.flowLayoutPanel2.Size = new System.Drawing.Size(402, 43); this.flowLayoutPanel2.TabIndex = 3; // // CancelDialogButton // this.CancelDialogButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.CancelDialogButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelDialogButton.Location = new System.Drawing.Point(421, 14); - this.CancelDialogButton.Margin = new System.Windows.Forms.Padding(4); + this.CancelDialogButton.Location = new System.Drawing.Point(316, 11); this.CancelDialogButton.Name = "CancelDialogButton"; - this.CancelDialogButton.Size = new System.Drawing.Size(100, 28); + this.CancelDialogButton.Size = new System.Drawing.Size(75, 23); this.CancelDialogButton.TabIndex = 4; this.CancelDialogButton.Text = "Cancel"; this.CancelDialogButton.UseVisualStyleBackColor = false; @@ -92,10 +89,9 @@ private void InitializeComponent() // this.OkButton.BackColor = System.Drawing.SystemColors.ButtonFace; this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.OkButton.Location = new System.Drawing.Point(313, 14); - this.OkButton.Margin = new System.Windows.Forms.Padding(4); + this.OkButton.Location = new System.Drawing.Point(235, 11); this.OkButton.Name = "OkButton"; - this.OkButton.Size = new System.Drawing.Size(100, 28); + this.OkButton.Size = new System.Drawing.Size(75, 23); this.OkButton.TabIndex = 3; this.OkButton.Text = "Ok"; this.OkButton.UseVisualStyleBackColor = false; @@ -107,20 +103,18 @@ private void InitializeComponent() this.panel1.Controls.Add(this.TitleLabel); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Margin = new System.Windows.Forms.Padding(4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(536, 87); + this.panel1.Size = new System.Drawing.Size(402, 71); this.panel1.TabIndex = 4; // // InstructionsLabel // this.InstructionsLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.InstructionsLabel.Location = new System.Drawing.Point(12, 37); - this.InstructionsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.InstructionsLabel.Location = new System.Drawing.Point(9, 30); this.InstructionsLabel.Name = "InstructionsLabel"; - this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(5); - this.InstructionsLabel.Size = new System.Drawing.Size(511, 42); + this.InstructionsLabel.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.InstructionsLabel.Size = new System.Drawing.Size(383, 34); this.InstructionsLabel.TabIndex = 6; this.InstructionsLabel.Text = "Select a parameter and drag it or use buttons to move it up or down."; // @@ -128,11 +122,10 @@ private void InitializeComponent() // this.TitleLabel.AutoSize = true; this.TitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.TitleLabel.Location = new System.Drawing.Point(16, 11); - this.TitleLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.TitleLabel.Location = new System.Drawing.Point(12, 9); this.TitleLabel.Name = "TitleLabel"; - this.TitleLabel.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.TitleLabel.Size = new System.Drawing.Size(165, 22); + this.TitleLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.TitleLabel.Size = new System.Drawing.Size(140, 19); this.TitleLabel.TabIndex = 4; this.TitleLabel.Text = "Reorder parameters"; // @@ -144,8 +137,8 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.MethodParametersGrid.BackgroundColor = System.Drawing.Color.White; this.MethodParametersGrid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.MethodParametersGrid.Location = new System.Drawing.Point(12, 95); - this.MethodParametersGrid.Margin = new System.Windows.Forms.Padding(11, 4, 11, 4); + this.MethodParametersGrid.Location = new System.Drawing.Point(9, 77); + this.MethodParametersGrid.Margin = new System.Windows.Forms.Padding(8, 3, 8, 3); this.MethodParametersGrid.MultiSelect = false; this.MethodParametersGrid.Name = "MethodParametersGrid"; this.MethodParametersGrid.RowHeadersVisible = false; @@ -155,17 +148,16 @@ private void InitializeComponent() this.MethodParametersGrid.ShowCellToolTips = false; this.MethodParametersGrid.ShowEditingIcon = false; this.MethodParametersGrid.ShowRowErrors = false; - this.MethodParametersGrid.Size = new System.Drawing.Size(401, 183); + this.MethodParametersGrid.Size = new System.Drawing.Size(301, 149); this.MethodParametersGrid.TabIndex = 0; // // MoveUpButton // this.MoveUpButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.MoveUpButton.Image = ((System.Drawing.Image)(resources.GetObject("MoveUpButton.Image"))); - this.MoveUpButton.Location = new System.Drawing.Point(421, 95); - this.MoveUpButton.Margin = new System.Windows.Forms.Padding(4); + this.MoveUpButton.Location = new System.Drawing.Point(316, 77); this.MoveUpButton.Name = "MoveUpButton"; - this.MoveUpButton.Size = new System.Drawing.Size(100, 89); + this.MoveUpButton.Size = new System.Drawing.Size(75, 72); this.MoveUpButton.TabIndex = 1; this.MoveUpButton.Text = "Move up"; this.MoveUpButton.TextAlign = System.Drawing.ContentAlignment.BottomCenter; @@ -176,10 +168,10 @@ private void InitializeComponent() // ReorderParametersDialog // this.AcceptButton = this.OkButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.CancelDialogButton; - this.ClientSize = new System.Drawing.Size(536, 338); + this.ClientSize = new System.Drawing.Size(402, 275); this.Controls.Add(this.MethodParametersGrid); this.Controls.Add(this.panel1); this.Controls.Add(this.flowLayoutPanel2); @@ -187,7 +179,7 @@ private void InitializeComponent() this.Controls.Add(this.MoveUpButton); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ReorderParametersDialog"; diff --git a/RetailCoder.VBE/UI/Refactorings/ReorderParametersDialog.resx b/RetailCoder.VBE/UI/Refactorings/ReorderParametersDialog.resx index 885f8871f0..b81f9c2d9c 100644 --- a/RetailCoder.VBE/UI/Refactorings/ReorderParametersDialog.resx +++ b/RetailCoder.VBE/UI/Refactorings/ReorderParametersDialog.resx @@ -148,23 +148,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file diff --git a/RetailCoder.VBE/UI/RegexAssistant/RegexAssistantDialog.Designer.cs b/RetailCoder.VBE/UI/RegexAssistant/RegexAssistantDialog.Designer.cs index e1f92c6068..c77c8e2b21 100644 --- a/RetailCoder.VBE/UI/RegexAssistant/RegexAssistantDialog.Designer.cs +++ b/RetailCoder.VBE/UI/RegexAssistant/RegexAssistantDialog.Designer.cs @@ -90,7 +90,7 @@ private void InitializeComponent() this.flowLayoutPanel2.Controls.Add(this.CloseButton); this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.flowLayoutPanel2.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 398); + this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 399); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; this.flowLayoutPanel2.Padding = new System.Windows.Forms.Padding(8, 8, 0, 8); this.flowLayoutPanel2.Size = new System.Drawing.Size(464, 43); @@ -102,7 +102,7 @@ private void InitializeComponent() this.ElementHost.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.ElementHost.Location = new System.Drawing.Point(0, 64); this.ElementHost.Name = "ElementHost"; - this.ElementHost.Size = new System.Drawing.Size(464, 334); + this.ElementHost.Size = new System.Drawing.Size(464, 335); this.ElementHost.TabIndex = 4; this.ElementHost.Child = this.RegexAssistant; // @@ -111,7 +111,7 @@ private void InitializeComponent() this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.CloseButton; - this.ClientSize = new System.Drawing.Size(464, 441); + this.ClientSize = new System.Drawing.Size(464, 442); this.Controls.Add(this.ElementHost); this.Controls.Add(this.flowLayoutPanel2); this.Controls.Add(this.panel1); diff --git a/RetailCoder.VBE/UI/RegexAssistant/RegexAssistantDialog.resx b/RetailCoder.VBE/UI/RegexAssistant/RegexAssistantDialog.resx index d3a1a2980d..0a0a5023e2 100644 --- a/RetailCoder.VBE/UI/RegexAssistant/RegexAssistantDialog.resx +++ b/RetailCoder.VBE/UI/RegexAssistant/RegexAssistantDialog.resx @@ -120,23 +120,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file diff --git a/RetailCoder.VBE/UI/Settings/SettingsForm.Designer.cs b/RetailCoder.VBE/UI/Settings/SettingsForm.Designer.cs index 9dcb154532..84b8e5ce85 100644 --- a/RetailCoder.VBE/UI/Settings/SettingsForm.Designer.cs +++ b/RetailCoder.VBE/UI/Settings/SettingsForm.Designer.cs @@ -38,9 +38,9 @@ private void InitializeComponent() this.ElementHost.Dock = System.Windows.Forms.DockStyle.Fill; this.ElementHost.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.ElementHost.Location = new System.Drawing.Point(0, 0); - this.ElementHost.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.ElementHost.Margin = new System.Windows.Forms.Padding(2); this.ElementHost.Name = "ElementHost"; - this.ElementHost.Size = new System.Drawing.Size(624, 473); + this.ElementHost.Size = new System.Drawing.Size(904, 582); this.ElementHost.TabIndex = 0; this.ElementHost.Child = this.SettingsControl; // @@ -48,10 +48,10 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(624, 473); + this.ClientSize = new System.Drawing.Size(904, 582); this.Controls.Add(this.ElementHost); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Margin = new System.Windows.Forms.Padding(2); this.MaximizeBox = false; this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(920, 620); diff --git a/RetailCoder.VBE/UI/Settings/SettingsForm.resx b/RetailCoder.VBE/UI/Settings/SettingsForm.resx index d3a1a2980d..0a0a5023e2 100644 --- a/RetailCoder.VBE/UI/Settings/SettingsForm.resx +++ b/RetailCoder.VBE/UI/Settings/SettingsForm.resx @@ -120,23 +120,26 @@ - AAABAAEAEA4AAAEAIADgAwAAFgAAACgAAAAQAAAAHAAAAAEAIAAAAAAAuAMAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAB4AAABxAAEBtQEYGOMCLCz3AzEx/AIhIewABwfFAAAAiQAAADYAAAABAAAAAAAA - AAAAAAAAAAAAAQAAAJIDODj5CJqa/wzh4f8O/f3/Dv///w7///8O////De/v/wq0tP8ES0v/AAAAewAA - AAAAAAAAAAAAAAAAAEcFWlr/Dv///w7///8O////Dv///w7///8O////Dv///w7///8O////Dvv7/wMw - MPkAAAAgAAAAAAAAAAAAAQGpC8zM/w7///8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8JoKD/AAAAfAAAAAAAAAAAARMT4g78/P8O////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////DNzc/wAAALAAAAAAAAAAAAImJvcO////Dv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w3o6P8AAAC8AAAAAAAAAAACHh7vDv///w7///8O////Dv///w7///8O////Dv///w7/ - //8O////Dv///w7///8LxMT/AAAAngAAAAAAAAAAAAQExg3o6P8O////Dv///wmnp/8GZ2f/B3l5/wZ1 - df8Kr6//Dv///w7///8O////Bmxs/wAAAFIAAAAAAAAAAAAAAGwHgoL/Dv///wq+vv8BDAzTAAAAOQAA - AE8BDQ3yDNLS/w7///8O////Dv///wZlZf8AABS4AAAPgQAAAA0AAAAIAQwM1AVjY/8ABwfEAAAAGAAA - AAAAAABNBnJy/w7///8O////Dv///w7///8N5ub/AAM+/wAA4P8AAC62AAAAAAAAACAAAABLAAAAAgAA - AAAAAAAAAAAAaAiUlP8O////Dv///wvKyv8Lvr7/Dvv7/wEQMf8AAP//AACF/wAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAADkFV1f/Dv///w7///8HdHT/Blxc/wvMzP8AAAXWAAAoogAAF58AAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAEBrwiQkP8O+/v/Dv///wzY2P8CLCz1AAAAMQAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACHARkZ4wIpKfQABga8AAAANgAAAAAAAAAAAAAAAMAH - AAAABwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAQAAACMAAAA/AAAAP4DAAD+BwAA + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAEAAAAAAAAABwAAAAgAAAAGAAAABwAAAAgAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAABAwNEAAAA/zpkZP8uXmP/LGBl/y9hY/80ZGP/OWlo/0t2dP8AAAD/AAAAxwEC + AogAAAAAAAAAAAAAAAAAAQGTCicr/zTk+f9U3v//RtX//0rV//9P3f//Ve3//y/p//855/v/Qv3//1T/ + //8MLS/+AAAA0QAAAAAAAQGRBBMW/zXn/f846v//SNz9/0jL/v8xvv//OMv//0DU//8/3v3/L+j//zTo + //8r4/z/Svr//0mAf/4BAgKIISko/ynQ5v8x6P//Men//y7Z7v9ApLn/LrH4/y+y9f84vfT/K57K/y/l + +v8x5///L+j//0v2//+M////AAAAihIsLf8w7f//MOr//zXq//8x6f//JK6+/yeIp/8gZoL/LYyq/ynF + 2f8w5/7/MOj//zTq//9K9P//g////wAAAJUAAADSROX//1LK//9E5f//OO7//zLr//8w4ff/L+X7/y/j + +v8x6P//N+z//zHo//8s5v//gv3//7j///4AAACcAAAAlD+Cof87c4z/RGNj/zRdY/8xoK7+LfX//xrm + //8c2v//IeD//zDx//9G+P//Vvr//9z///8kKir/AAAAAAAAAFYAAABtAAAAGgAAAAgAAAALAAAA2yTb + +v8Y0f//HNr//xzf//8z+///Yv///2y8vP4qMjL/BAUFMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3Cac + r/8t0/7/Icn//x7Y//8o+P7/Sv///wAAAP8AAACgAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEwwh + I/873P//JMj//xS8//8Wyv//Gpi2/wIADv8LCgC5AAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + ACUqYWT/Mtb//xy6//8Gt/7/Htr//xlhbP8fRvX/O1Hs/jlCctsAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAaSGpo/0vZ//4Zs///n+z//wAAAP9FVFz/E0Gh/z1G//9AS2j/AAAAAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAABAAAAKiS8/7MOr3//pLc/v/v////Pmxs/zBBPcIAAAD/ISEv/wAAAAQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAABNAAAAtqXk8shM0v//Ppac/wAAAP8AAAA2AAAAAAAAAAcAAAABAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAACfAAAAlAAAAIAAAAA3AAAAAQAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAOADAACAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAD4AwAA8AcAAPAPAADwBwAA8AcAAPAH + AAD4PwAA/H8AAA== \ No newline at end of file