├── .gitattributes
├── .gitignore
├── CollapseAndSync.sln
├── CollapseAndSync
├── CollapseAndSync.csproj
├── CollapseAndSync.vsct
├── CollapseAndSyncPackage.cs
├── GlobalSuppressions.cs
├── Guids.cs
├── Icon.png
├── PkgCmdID.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Resources
│ ├── CollapseAndSync16.png
│ ├── Package.ico
│ └── Preview.png
├── VSPackage.resx
├── VisualStudioHelperMethods.cs
├── license.txt
├── packages.config
└── source.extension.vsixmanifest
├── appveyor.yml
└── buildhelpers.ps1
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 | storage.ide
44 |
45 | # Build results
46 | [Dd]ebug/
47 | [Rr]elease/
48 | *_i.c
49 | *_p.c
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.vspscc
64 | .builds
65 | *.dotCover
66 |
67 | ## TODO: If you have NuGet Package Restore enabled, uncomment this
68 | packages/
69 |
70 | # Visual C++ cache files
71 | ipch/
72 | *.aps
73 | *.ncb
74 | *.opensdf
75 | *.sdf
76 |
77 | # Visual Studio profiler
78 | *.psess
79 | *.vsp
80 |
81 | # ReSharper is a .NET coding add-in
82 | _ReSharper*
83 |
84 | # Installshield output folder
85 | [Ee]xpress
86 |
87 | # DocProject is a documentation generator add-in
88 | DocProject/buildhelp/
89 | DocProject/Help/*.HxT
90 | DocProject/Help/*.HxC
91 | DocProject/Help/*.hhc
92 | DocProject/Help/*.hhk
93 | DocProject/Help/*.hhp
94 | DocProject/Help/Html2
95 | DocProject/Help/html
96 |
97 | # Click-Once directory
98 | publish
99 |
100 | # Others
101 | [Bb]in
102 | [Oo]bj
103 | sql
104 | TestResults
105 | *.Cache
106 | ClientBin
107 | stylecop.*
108 | ~$*
109 | *.dbmdl
110 | Generated_Code #added for RIA/Silverlight projects
111 |
112 | # Backup & report files from converting an old project file to a newer
113 | # Visual Studio version. Backup files are not needed, because we have git ;-)
114 | _UpgradeReport_Files/
115 | Backup*/
116 | UpgradeLog*.XML
117 |
118 |
119 |
120 | ############
121 | ## Windows
122 | ############
123 |
124 | # Windows image file caches
125 | Thumbs.db
126 |
127 | # Folder config file
128 | Desktop.ini
129 |
130 |
131 | #############
132 | ## Python
133 | #############
134 |
135 | *.py[co]
136 |
137 | # Packages
138 | *.egg
139 | *.egg-info
140 | dist
141 | build
142 | eggs
143 | parts
144 | bin
145 | var
146 | sdist
147 | develop-eggs
148 | .installed.cfg
149 |
150 | # Installer logs
151 | pip-log.txt
152 |
153 | # Unit test / coverage reports
154 | .coverage
155 | .tox
156 |
157 | #Translations
158 | *.mo
159 |
160 | #Mr Developer
161 | .mr.developer.cfg
162 |
163 | # Mac crap
164 | .DS_Store
165 |
--------------------------------------------------------------------------------
/CollapseAndSync.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.25909.2
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CollapseAndSync", "CollapseAndSync\CollapseAndSync.csproj", "{92496092-9174-4FB6-830B-39819646BF21}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {92496092-9174-4FB6-830B-39819646BF21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {92496092-9174-4FB6-830B-39819646BF21}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {92496092-9174-4FB6-830B-39819646BF21}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {92496092-9174-4FB6-830B-39819646BF21}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/CollapseAndSync/CollapseAndSync.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 15.0
5 | 11.0
6 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
7 |
8 |
9 |
10 |
11 | 4.0
12 |
13 |
14 |
15 | Debug
16 | AnyCPU
17 | 2.0
18 | {92496092-9174-4FB6-830B-39819646BF21}
19 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
20 | Library
21 | Properties
22 | cpmcgrath.CollapseAndSync
23 | CollapseAndSync
24 | false
25 | Key.snk
26 | v4.5
27 |
28 |
29 | true
30 | full
31 | false
32 | bin\Debug\
33 | DEBUG;TRACE
34 | prompt
35 | 4
36 |
37 |
38 | pdbonly
39 | true
40 | bin\Release\
41 | TRACE
42 | prompt
43 | 4
44 | true
45 | False
46 |
47 |
48 |
49 | False
50 | ..\packages\EnvDTE.8.0.0\lib\net10\EnvDTE.dll
51 | True
52 |
53 |
54 | True
55 | ..\packages\EnvDTE80.8.0.0\lib\net10\EnvDTE80.dll
56 | True
57 |
58 |
59 |
60 | ..\packages\VSSDK.GraphModel.11.0.4\lib\net45\Microsoft.VisualStudio.GraphModel.dll
61 | True
62 |
63 |
64 | ..\packages\VSSDK.OLE.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.OLE.Interop.dll
65 | True
66 | False
67 |
68 |
69 | ..\packages\VSSDK.Shell.11.11.0.4\lib\net45\Microsoft.VisualStudio.Shell.11.0.dll
70 | True
71 |
72 |
73 | ..\packages\VSSDK.Shell.Immutable.10.10.0.4\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll
74 | True
75 | False
76 |
77 |
78 | ..\packages\VSSDK.Shell.Immutable.11.11.0.4\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll
79 | True
80 | False
81 |
82 |
83 | ..\packages\VSSDK.Shell.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.dll
84 | True
85 | False
86 |
87 |
88 | False
89 | ..\packages\VSSDK.Shell.Interop.10.10.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll
90 | True
91 |
92 |
93 | False
94 | ..\packages\VSSDK.Shell.Interop.11.11.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll
95 | True
96 |
97 |
98 | ..\packages\VSSDK.Shell.Interop.8.8.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.8.0.dll
99 | True
100 | False
101 |
102 |
103 | ..\packages\VSSDK.Shell.Interop.9.9.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.9.0.dll
104 | True
105 | False
106 |
107 |
108 | ..\packages\VSSDK.TextManager.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.TextManager.Interop.dll
109 | True
110 | False
111 |
112 |
113 | ..\packages\VSSDK.TextManager.Interop.8.8.0.4\lib\net20\Microsoft.VisualStudio.TextManager.Interop.8.0.dll
114 | True
115 | False
116 |
117 |
118 |
119 |
120 | True
121 | ..\packages\stdole.7.0.3300\lib\net10\stdole.dll
122 | True
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 | True
140 | True
141 | Resources.resx
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 | ResXFileCodeGenerator
152 | Resources.Designer.cs
153 | Designer
154 |
155 |
156 | true
157 | VSPackage
158 |
159 |
160 |
161 |
162 |
163 | Designer
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 | Menus.ctmenu
172 | Designer
173 |
174 |
175 |
176 |
177 | Always
178 | true
179 |
180 |
181 | Always
182 | true
183 |
184 |
185 | Always
186 | true
187 |
188 |
189 |
190 | Always
191 | true
192 |
193 |
194 |
195 | true
196 |
197 |
198 |
199 |
206 |
--------------------------------------------------------------------------------
/CollapseAndSync/CollapseAndSync.vsct:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/CollapseAndSync/CollapseAndSyncPackage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Globalization;
4 | using System.ComponentModel.Design;
5 | using Microsoft.VisualStudio.Shell;
6 | using System.Runtime.InteropServices;
7 | using Microsoft.VisualStudio.Shell.Interop;
8 |
9 | namespace cpmcgrath.CollapseAndSync
10 | {
11 | [PackageRegistration(UseManagedResourcesOnly = true)]
12 | [InstalledProductRegistration("#110", "#112", "6.0", IconResourceID = 400)]
13 | [ProvideMenuResource("Menus.ctmenu", 1)]
14 | [Guid(GuidList.guidCollapseAndSyncPkgString)]
15 | public sealed class CollapseAndSyncPackage : Package
16 | {
17 | protected override void Initialize()
18 | {
19 | base.Initialize();
20 |
21 | var mcs = GetService(typeof(IMenuCommandService)) as IMenuCommandService;
22 | if (mcs == null)
23 | return;
24 |
25 | mcs.Register(GuidList.guidCollapseAndSyncCmdSet, PkgCmdIDList.cmdCollapseSync, CollapseAndSync);
26 | }
27 |
28 | void CollapseAndSync(object sender, EventArgs e)
29 | {
30 | var dte = (EnvDTE80.DTE2)GetService(typeof(SDTE));
31 | dte.Windows.Item(EnvDTE.Constants.vsWindowKindSolutionExplorer).Activate();
32 |
33 | try
34 | {
35 | CollapseAll(dte);
36 | SyncWithActiveDocument(dte);
37 | }
38 | catch (COMException)
39 | {
40 | }
41 | }
42 |
43 | void CollapseAll(EnvDTE80.DTE2 dte)
44 | {
45 | int cmdidSolutionExplorerCollapseAll = 29;
46 | Guid guidCMDSETID_StandardCommandSet11 = new Guid("D63DB1F0-404E-4B21-9648-CA8D99245EC3");
47 | dte.Commands.Raise(guidCMDSETID_StandardCommandSet11.ToString("B"), cmdidSolutionExplorerCollapseAll, null, null);
48 | }
49 |
50 | void SyncWithActiveDocument(EnvDTE80.DTE2 dte)
51 | {
52 | dte.ExecuteCommand("SolutionExplorer.SyncWithActiveDocument");
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/CollapseAndSync/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project. Project-level
3 | // suppressions either have no target or are given a specific target
4 | // and scoped to a namespace, type, member, etc.
5 | //
6 | // To add a suppression to this file, right-click the message in the
7 | // Error List, point to "Suppress Message(s)", and click "In Project
8 | // Suppression File". You do not need to add suppressions to this
9 | // file manually.
10 |
11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
12 |
--------------------------------------------------------------------------------
/CollapseAndSync/Guids.cs:
--------------------------------------------------------------------------------
1 | // Guids.cs
2 | // MUST match guids.h
3 | using System;
4 |
5 | namespace cpmcgrath.CollapseAndSync
6 | {
7 | static class GuidList
8 | {
9 | public const string guidCollapseAndSyncPkgString = "8a270170-a54e-4815-86b6-9c0a93963640";
10 | public const string guidCollapseAndSyncCmdSetString = "b042a405-501f-49bf-9732-124b654eaa8e";
11 |
12 | public static readonly Guid guidCollapseAndSyncCmdSet = new Guid(guidCollapseAndSyncCmdSetString);
13 | };
14 | }
--------------------------------------------------------------------------------
/CollapseAndSync/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cpmcgrath/CollapseAndSync/f6f55f30f7f74b05a91e06ce2d22f6ff3fa1d08b/CollapseAndSync/Icon.png
--------------------------------------------------------------------------------
/CollapseAndSync/PkgCmdID.cs:
--------------------------------------------------------------------------------
1 | // PkgCmdID.cs
2 | // MUST match PkgCmdID.h
3 | using System;
4 |
5 | namespace cpmcgrath.CollapseAndSync
6 | {
7 | static class PkgCmdIDList
8 | {
9 | public const uint cmdCollapseSync = 0x100;
10 |
11 |
12 | };
13 | }
--------------------------------------------------------------------------------
/CollapseAndSync/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Resources;
4 | using System.Runtime.CompilerServices;
5 | using System.Runtime.InteropServices;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("CollapseAndSync")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("cpmcgrath")]
14 | [assembly: AssemblyProduct("CollapseAndSync")]
15 | [assembly: AssemblyCopyright("")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 | [assembly: ComVisible(false)]
19 | [assembly: CLSCompliant(false)]
20 | [assembly: NeutralResourcesLanguage("en-US")]
21 |
22 | // Version information for an assembly consists of the following four values:
23 | //
24 | // Major Version
25 | // Minor Version
26 | // Build Number
27 | // Revision
28 | //
29 | // You can specify all the values or you can default the Revision and Build Numbers
30 | // by using the '*' as shown below:
31 |
32 | [assembly: AssemblyVersion("6.0.0.0")]
33 | [assembly: AssemblyFileVersion("6.0.0.0")]
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/CollapseAndSync/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace cpmcgrath.CollapseAndSync {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("cpmcgrath.CollapseAndSync.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/CollapseAndSync/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | text/microsoft-resx
119 |
120 |
121 | 2.0
122 |
123 |
124 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
125 |
126 |
127 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
128 |
129 |
--------------------------------------------------------------------------------
/CollapseAndSync/Resources/CollapseAndSync16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cpmcgrath/CollapseAndSync/f6f55f30f7f74b05a91e06ce2d22f6ff3fa1d08b/CollapseAndSync/Resources/CollapseAndSync16.png
--------------------------------------------------------------------------------
/CollapseAndSync/Resources/Package.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cpmcgrath/CollapseAndSync/f6f55f30f7f74b05a91e06ce2d22f6ff3fa1d08b/CollapseAndSync/Resources/Package.ico
--------------------------------------------------------------------------------
/CollapseAndSync/Resources/Preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cpmcgrath/CollapseAndSync/f6f55f30f7f74b05a91e06ce2d22f6ff3fa1d08b/CollapseAndSync/Resources/Preview.png
--------------------------------------------------------------------------------
/CollapseAndSync/VSPackage.resx:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | text/microsoft-resx
120 |
121 |
122 | 2.0
123 |
124 |
125 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
126 |
127 |
128 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
129 |
130 |
131 |
132 | CollapseAndSync
133 |
134 |
135 | Information about my package
136 |
137 |
138 | Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
139 |
140 |
--------------------------------------------------------------------------------
/CollapseAndSync/VisualStudioHelperMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.Design;
5 |
6 | namespace cpmcgrath.CollapseAndSync
7 | {
8 | public static class VisualStudioHelperMethods
9 | {
10 | public static void Register(this IMenuCommandService instance, Guid guid, uint cmd, EventHandler method)
11 | {
12 | var menuCommandID = new CommandID(guid, (int)cmd);
13 | instance.AddCommand(new MenuCommand(method, menuCommandID));
14 | }
15 |
16 | public static IEnumerable UpTo(this int start, int end)
17 | {
18 | for (int i = start; i <= end; i++)
19 | yield return i;
20 | }
21 |
22 | public const string SolutionFolder = "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}";
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/CollapseAndSync/license.txt:
--------------------------------------------------------------------------------
1 | Provided "AS IS". No Warranties or condition.
--------------------------------------------------------------------------------
/CollapseAndSync/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/CollapseAndSync/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Solution Explorer Collapse And Sync
6 | Combines the "Collapse All" and "Sync with Active Document" into one command.
7 | http://visualstudiogallery.msdn.microsoft.com/en-us/ef4ac3e9-d056-4383-8ca2-11721bd879b4
8 | license.txt
9 | Icon.png
10 | Resources\Preview.png
11 | Navigation, Solution Explorer
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 7.0.{build}.0
2 | image: Visual Studio 2017
3 |
4 | platform:
5 | - All
6 |
7 | configuration:
8 | - Release
9 |
10 | environment:
11 | LOGDLL: '"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"'
12 |
13 | install:
14 | - cd "%APPVEYOR_BUILD_FOLDER%"
15 | - nuget restore CollapseAndSync\packages.config -PackagesDirectory packages
16 |
17 | build_script:
18 | - cd "%APPVEYOR_BUILD_FOLDER%"
19 | - ps: >-
20 | . .\buildhelpers.ps1
21 |
22 | UpdateVsVersion CollapseAndSync $env:appveyor_build_version
23 | - msbuild CollapseAndSync.sln /m /p:configuration="Release" /p:platform="Any CPU" /logger:%LOGDLL%
24 |
25 | after_build:
26 | - cd "%APPVEYOR_BUILD_FOLDER%"
27 | - ps: >-
28 | Push-AppveyorArtifact "CollapseAndSync\bin\$env:CONFIGURATION\CollapseAndSync.vsix" -FileName CollapseAndSync.vsix
29 |
30 | deploy:
31 | provider: GitHub
32 | auth_token:
33 | secure: TA1/2G21wUBPSWRbmBul7xGvE3YpX8n8AEooMuwkiqhxGhD2bLJ0Y//rS7+qwIN1
34 | draft: true
35 | prerelease: false
36 | force_update: true
37 | on:
38 | branch: master
39 | appveyor_repo_tag: true
40 |
--------------------------------------------------------------------------------
/buildhelpers.ps1:
--------------------------------------------------------------------------------
1 | function Replace($file, $before, $after)
2 | {
3 | $content = Get-Content $file | Foreach-Object {$_ -replace $before, $after }
4 | $content | Set-Content $file -Encoding UTF8
5 | }
6 |
7 | function UpdateVersion($project, $version)
8 | {
9 | $file = "./$project/Properties/AssemblyInfo.cs"
10 | Replace $file "AssemblyVersion\s*\([^\)]+\)" "AssemblyVersion (`"$version`")"
11 | Replace $file "AssemblyFileVersion\s*\([^\)]+\)" "AssemblyFileVersion(`"$version`")"
12 | }
13 |
14 | function UpdateVsVersion($project, $version)
15 | {
16 | UpdateVersion $project $version
17 |
18 | Replace "./$project/CollapseAndSyncPackage.cs" `
19 | "\[InstalledProductRegistration\(`"#110`", `"#112`", `"[^`"]+`", IconResourceID = 400\)\]" `
20 | "[InstalledProductRegistration(`"#110`", `"#112`", `"$version`", IconResourceID = 400)]"
21 |
22 | Replace "./$project/source.extension.vsixmanifest" `
23 | "Id=`"8a270170-a54e-4815-86b6-9c0a93963640`" Version=`"[^`"]+`"" `
24 | "Id=`"8a270170-a54e-4815-86b6-9c0a93963640`" Version=`"$version`""
25 | }
--------------------------------------------------------------------------------