├── src
├── Audio
│ ├── Deep.mp3
│ ├── Echo.mp3
│ ├── Flute.mp3
│ ├── Quick.mp3
│ ├── Ripper.mp3
│ ├── Sharp.mp3
│ ├── Sweet.mp3
│ ├── Trumpet.mp3
│ ├── WetOne.mp3
│ ├── Windy.mp3
│ ├── Constant.mp3
│ ├── Extended.mp3
│ ├── LawnMower.mp3
│ ├── RealQuick.mp3
│ ├── Romantic.mp3
│ ├── Straining.mp3
│ ├── WetEnding.mp3
│ ├── Continious.mp3
│ ├── DoubleTake.mp3
│ ├── HighPressure.mp3
│ └── ShortRipper.mp3
├── Resources
│ ├── icon.png
│ ├── logo.png
│ └── License.txt
├── source.extension.vsixmanifest
├── App
│ ├── FartEnum.cs
│ ├── FartOptions.cs
│ └── FartPlayer.cs
├── source.extension.cs
├── Properties
│ └── AssemblyInfo.cs
├── Farticus.cs
├── Farticus.vsct
├── FarticusPackage.cs
└── Farticus.csproj
├── nuget.config
├── README.md
├── appveyor.yml
├── Farticus.sln
├── .gitattributes
└── .gitignore
/src/Audio/Deep.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Deep.mp3
--------------------------------------------------------------------------------
/src/Audio/Echo.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Echo.mp3
--------------------------------------------------------------------------------
/src/Audio/Flute.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Flute.mp3
--------------------------------------------------------------------------------
/src/Audio/Quick.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Quick.mp3
--------------------------------------------------------------------------------
/src/Audio/Ripper.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Ripper.mp3
--------------------------------------------------------------------------------
/src/Audio/Sharp.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Sharp.mp3
--------------------------------------------------------------------------------
/src/Audio/Sweet.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Sweet.mp3
--------------------------------------------------------------------------------
/src/Audio/Trumpet.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Trumpet.mp3
--------------------------------------------------------------------------------
/src/Audio/WetOne.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/WetOne.mp3
--------------------------------------------------------------------------------
/src/Audio/Windy.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Windy.mp3
--------------------------------------------------------------------------------
/src/Audio/Constant.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Constant.mp3
--------------------------------------------------------------------------------
/src/Audio/Extended.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Extended.mp3
--------------------------------------------------------------------------------
/src/Audio/LawnMower.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/LawnMower.mp3
--------------------------------------------------------------------------------
/src/Audio/RealQuick.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/RealQuick.mp3
--------------------------------------------------------------------------------
/src/Audio/Romantic.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Romantic.mp3
--------------------------------------------------------------------------------
/src/Audio/Straining.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Straining.mp3
--------------------------------------------------------------------------------
/src/Audio/WetEnding.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/WetEnding.mp3
--------------------------------------------------------------------------------
/src/Resources/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Resources/icon.png
--------------------------------------------------------------------------------
/src/Resources/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Resources/logo.png
--------------------------------------------------------------------------------
/src/Audio/Continious.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/Continious.mp3
--------------------------------------------------------------------------------
/src/Audio/DoubleTake.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/DoubleTake.mp3
--------------------------------------------------------------------------------
/src/Audio/HighPressure.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/HighPressure.mp3
--------------------------------------------------------------------------------
/src/Audio/ShortRipper.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/Audio/ShortRipper.mp3
--------------------------------------------------------------------------------
/src/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/madskristensen/Farticus/master/src/source.extension.vsixmanifest
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Farticus for Visual Studio #
2 |
3 | The original Visual Studio fart app
4 |
5 | [](https://ci.appveyor.com/project/madskristensen/farticus-v5jb2)
6 |
7 | ----------------
8 |
9 | Created by:
10 |
11 | **Sayed Ibrahim Hashimi**
12 | http://sedodream.com
13 | @sayedihashimi
14 |
15 | **Mads Kristensen**
16 | http://madskristensen.net
17 | @mkristensen
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | image: Visual Studio 2019
2 |
3 | install:
4 | - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex
5 |
6 | before_build:
7 | - ps: Vsix-IncrementVsixVersion | Vsix-UpdateBuildVersion
8 | - ps: Vsix-TokenReplacement src\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"'
9 |
10 | build_script:
11 | - nuget restore -Verbosity quiet
12 | - msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
13 |
14 | after_test:
15 | - ps: Vsix-PushArtifacts | Vsix-PublishToGallery
16 |
--------------------------------------------------------------------------------
/src/App/FartEnum.cs:
--------------------------------------------------------------------------------
1 | namespace LigerShark.Farticus
2 | {
3 | /// The list of farts available.
4 | ///
5 | /// This is used by the options page to provide the dropdown.
6 | /// Must match the file names in the "audio" folder.
7 | ///
8 | enum Farts
9 | {
10 | RandomFart = 0,
11 | Sweet,
12 | HighPressure,
13 | Romantic,
14 | WetEnding,
15 | Windy,
16 | Ripper,
17 | Flute,
18 | LawnMower,
19 | Constant,
20 | Quick,
21 | Trumpet,
22 | DoubleTake,
23 | Continious,
24 | Deep,
25 | Echo,
26 | Extended,
27 | RealQuick,
28 | Sharp,
29 | ShortRipper,
30 | Straining,
31 | WetOne,
32 | SilentButDeadly
33 | }
34 | }
--------------------------------------------------------------------------------
/src/source.extension.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This file was generated by VSIX Synchronizer 1.0.44
4 | // Available from https://marketplace.visualstudio.com/items?itemName=MadsKristensen.VsixSynchronizer64
5 | //
6 | // ------------------------------------------------------------------------------
7 | namespace LigerShark.Farticus
8 | {
9 | internal sealed partial class Vsix
10 | {
11 | public const string Id = "1324ce08-8b25-440c-1234-07e1fa0cce4a";
12 | public const string Name = "Farticus";
13 | public const string Description = @"The original Visual Studio fart app! Farticus let's you configure Visual Studio to give you audio warnings when the build breaks. ";
14 | public const string Language = "en-US";
15 | public const string Version = "2.0";
16 | public const string Author = "Sayed Hashimi & Mads Kristensen";
17 | public const string Tags = "fart, sound";
18 | public const bool IsPreview = false;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Resources;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("Farticus")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("LigerShark")]
13 | [assembly: AssemblyProduct("Farticus")]
14 | [assembly: AssemblyCopyright("")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 | [assembly: CLSCompliant(false)]
19 | [assembly: NeutralResourcesLanguage("en-US")]
20 |
21 | // Version information for an assembly consists of the following four values:
22 | //
23 | // Major Version
24 | // Minor Version
25 | // Build Number
26 | // Revision
27 | //
28 | // You can specify all the values or you can default the Revision and Build Numbers
29 | // by using the '*' as shown below:
30 |
31 | [assembly: AssemblyVersion("1.0.0.0")]
32 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/src/Farticus.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This file was generated by VSIX Synchronizer
4 | //
5 | // ------------------------------------------------------------------------------
6 | namespace LigerShark.Farticus
7 | {
8 | using System;
9 |
10 | ///
11 | /// Helper class that exposes all GUIDs used across VS Package.
12 | ///
13 | internal sealed partial class PackageGuids
14 | {
15 | public const string guidFarticusPkgString = "1324ce08-8b25-440c-8d5c-07e1fa0cce4a";
16 | public static Guid guidFarticusPkg = new Guid(guidFarticusPkgString);
17 |
18 | public const string guidFarticusCmdSetString = "7a332164-9846-4bc6-a00f-bc7e6132f29a";
19 | public static Guid guidFarticusCmdSet = new Guid(guidFarticusCmdSetString);
20 |
21 | public const string guidImagesString = "24680110-4ff3-4a12-9819-981cf55f73f1";
22 | public static Guid guidImages = new Guid(guidImagesString);
23 | }
24 | ///
25 | /// Helper class that encapsulates all CommandIDs uses across VS Package.
26 | ///
27 | internal sealed partial class PackageIds
28 | {
29 | public const int MyMenuGroup = 0x1020;
30 | public const int cmdidRandomFart = 0x0100;
31 | public const int logo = 0x0001;
32 | }
33 | }
--------------------------------------------------------------------------------
/Farticus.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29627.11
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Farticus", "src\Farticus.csproj", "{7A55CBDD-CA18-4619-A80E-9F6E409D8A15}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{86FFBD68-5040-407A-B51F-68ED2550F1CB}"
9 | ProjectSection(SolutionItems) = preProject
10 | appveyor.yml = appveyor.yml
11 | README.md = README.md
12 | EndProjectSection
13 | EndProject
14 | Global
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 | Debug|Any CPU = Debug|Any CPU
17 | Release|Any CPU = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {7A55CBDD-CA18-4619-A80E-9F6E409D8A15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {7A55CBDD-CA18-4619-A80E-9F6E409D8A15}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {7A55CBDD-CA18-4619-A80E-9F6E409D8A15}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {7A55CBDD-CA18-4619-A80E-9F6E409D8A15}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {76B65AFC-5AB4-4760-8642-FE6D14E5A97E}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/src/App/FartOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using Microsoft.VisualStudio.Shell;
4 |
5 | namespace LigerShark.Farticus
6 | {
7 | internal class FartOptions : DialogPage
8 | {
9 | private bool _enabled = true;
10 | private Farts _errorFart = Farts.HighPressure;
11 | private bool _hasLoaded = false;
12 |
13 | [LocDisplayName("On build error")]
14 | [Description("Select which fart to play when the build has errors")]
15 | [Category("Farticus")]
16 | public Farts SelectedErrorFart
17 | {
18 | get { return _errorFart; }
19 | set
20 | {
21 | _errorFart = value;
22 |
23 | if (_hasLoaded)
24 | {
25 | FartPlayer.PlayFart(value);
26 | }
27 | }
28 | }
29 |
30 | [LocDisplayName("Enable auto-farts")]
31 | [Description("When enabled, farts are played when the build fails or has warnings")]
32 | [Category("Farticus")]
33 | public bool Enabled
34 | {
35 | get { return _enabled; }
36 | set { _enabled = value; }
37 | }
38 |
39 | public override void LoadSettingsFromStorage()
40 | {
41 | try
42 | {
43 | base.LoadSettingsFromStorage();
44 | }
45 | catch (FormatException)
46 | {
47 | // If the enum changes, the settings will display an error unless we fix the enum values.
48 | SelectedErrorFart = _errorFart;
49 | }
50 |
51 | _hasLoaded = true;
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/src/App/FartPlayer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using System.Reflection;
5 | using System.Windows.Media;
6 |
7 | namespace LigerShark.Farticus
8 | {
9 | internal class FartPlayer
10 | {
11 | private static readonly MediaPlayer _player = new MediaPlayer();
12 | private static readonly string[] _files;
13 |
14 | static FartPlayer()
15 | {
16 | var folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
17 | var audio = Path.Combine(folder, "audio");
18 |
19 | _files = Directory.GetFiles(audio, "*.mp3", SearchOption.TopDirectoryOnly);
20 | _player.MediaEnded += (s, e) => _player.Close();
21 | }
22 |
23 | public static void PlayFart(Farts fart)
24 | {
25 | if (fart == Farts.SilentButDeadly)
26 | {
27 | return;
28 | }
29 |
30 | if (fart == Farts.RandomFart)
31 | {
32 | var rn = new Random();
33 | var index = rn.Next(0, _files.Length);
34 |
35 | PlayFart(_files[index]);
36 | }
37 | else
38 | {
39 | var fileName = _files.FirstOrDefault(f => f.EndsWith("\\" + fart + ".mp3", StringComparison.OrdinalIgnoreCase));
40 |
41 | if (!string.IsNullOrEmpty(fileName))
42 | {
43 | PlayFart(fileName);
44 | }
45 | }
46 | }
47 |
48 | private static void PlayFart(string fileName)
49 | {
50 | _player.Open(new Uri(fileName, UriKind.Absolute));
51 | _player.Play();
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/src/Farticus.vsct:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/src/Resources/License.txt:
--------------------------------------------------------------------------------
1 | Microsoft Reciprocal License (Ms-RL)
2 |
3 | This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
4 |
5 | 1. Definitions
6 |
7 | The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
8 |
9 | A "contribution" is the original software, or any additions or changes to the software.
10 |
11 | A "contributor" is any person that distributes its contribution under this license.
12 |
13 | "Licensed patents" are a contributor's patent claims that read directly on its contribution.
14 |
15 | 2. Grant of Rights
16 |
17 | (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
18 |
19 | (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
20 |
21 | 3. Conditions and Limitations
22 |
23 | (A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose.
24 |
25 | (B) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
26 |
27 | (C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
28 |
29 | (D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
30 |
31 | (E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
32 |
33 | (F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
--------------------------------------------------------------------------------
/src/FarticusPackage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.Design;
4 | using System.Runtime.InteropServices;
5 | using System.Threading;
6 | using Community.VisualStudio.Toolkit;
7 | using Microsoft.VisualStudio.Shell;
8 | using Microsoft.VisualStudio.Shell.Interop;
9 |
10 | namespace LigerShark.Farticus
11 | {
12 | [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
13 | [InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)]
14 | [ProvideMenuResource("Menus.ctmenu", 1)]
15 | [ProvideBindingPath()]
16 | [Guid(PackageGuids.guidFarticusPkgString)]
17 | [ProvideAutoLoad(UIContextGuids80.SolutionHasSingleProject, PackageAutoLoadFlags.BackgroundLoad)]
18 | [ProvideAutoLoad(UIContextGuids80.SolutionHasMultipleProjects, PackageAutoLoadFlags.BackgroundLoad)]
19 | [ProvideOptionPage(typeof(FartOptions), "Farticus", "General", 101, 101, true, new[] { "The original Visual Studio fart app" })]
20 | public sealed class FarticusPackage : AsyncPackage
21 | {
22 | private int _successfulBuilds;
23 | private bool _hasBuildFailed;
24 |
25 | private readonly List _messages = new List()
26 | {
27 | "Yes! This is my favorite sound in the whole world",
28 | "Excellent. Don't hold back!",
29 | "Great job! It smells like roses in here now",
30 | "Sometimes you just have to let 'em rip",
31 | "Ahhh, that felt right",
32 | "Ooops, I'm not sure about that one",
33 | "Wow, someone has been practicing",
34 | "You might want to be a little careful",
35 | "What a stinker. The paint is coming off the walls"
36 | };
37 |
38 | protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress progress)
39 | {
40 | await JoinableTaskFactory.SwitchToMainThreadAsync();
41 |
42 | VS.Events.BuildEvents.ProjectBuildDone += OnBuildDone;
43 |
44 | if (await GetServiceAsync(typeof(IMenuCommandService)) is OleMenuCommandService mcs)
45 | {
46 | var fartCmd = new CommandID(PackageGuids.guidFarticusCmdSet, PackageIds.cmdidRandomFart);
47 | var menuItem = new MenuCommand(OnFartButtonClick, fartCmd);
48 | mcs.AddCommand(menuItem);
49 | }
50 | }
51 |
52 | private void OnFartButtonClick(object sender, EventArgs e)
53 | {
54 | FartPlayer.PlayFart(Farts.RandomFart);
55 |
56 | var rn = new Random();
57 | var index = rn.Next(0, _messages.Count);
58 |
59 | VS.StatusBar.ShowMessageAsync(_messages[index]).FireAndForget();
60 | }
61 |
62 | private void OnBuildDone(ProjectBuildDoneEventArgs e)
63 | {
64 | JoinableTaskFactory.Run(async () =>
65 | {
66 |
67 | await JoinableTaskFactory.SwitchToMainThreadAsync();
68 | var options = (FartOptions)GetDialogPage(typeof(FartOptions));
69 |
70 | if (options.Enabled)
71 | {
72 | if (e.IsSuccessful)
73 | {
74 | _successfulBuilds++;
75 |
76 | if (_hasBuildFailed)
77 | {
78 | SetBuildMessage();
79 | }
80 | }
81 | else
82 | {
83 | FartPlayer.PlayFart(options.SelectedErrorFart);
84 | _hasBuildFailed = true;
85 | _successfulBuilds = 0;
86 | }
87 | }
88 |
89 | });
90 | }
91 |
92 | private void SetBuildMessage()
93 | {
94 | var message = string.Format(" - {0} successful build since last fart", _successfulBuilds);
95 |
96 | if (_successfulBuilds > 1)
97 | {
98 | // Pluralize
99 | message = string.Format(" - {0} successful builds since last fart", _successfulBuilds);
100 | }
101 |
102 | VS.StatusBar.ShowMessageAsync(message).FireAndForget();
103 | }
104 | }
105 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | [Aa][Rr][Mm]/
24 | [Aa][Rr][Mm]64/
25 | bld/
26 | [Bb]in/
27 | [Oo]bj/
28 | [Ll]og/
29 |
30 | # Visual Studio 2015/2017 cache/options directory
31 | .vs/
32 | # Uncomment if you have tasks that create the project's static files in wwwroot
33 | #wwwroot/
34 |
35 | # Visual Studio 2017 auto generated files
36 | Generated\ Files/
37 |
38 | # MSTest test Results
39 | [Tt]est[Rr]esult*/
40 | [Bb]uild[Ll]og.*
41 |
42 | # NUNIT
43 | *.VisualState.xml
44 | TestResult.xml
45 |
46 | # Build Results of an ATL Project
47 | [Dd]ebugPS/
48 | [Rr]eleasePS/
49 | dlldata.c
50 |
51 | # Benchmark Results
52 | BenchmarkDotNet.Artifacts/
53 |
54 | # .NET Core
55 | project.lock.json
56 | project.fragment.lock.json
57 | artifacts/
58 |
59 | # StyleCop
60 | StyleCopReport.xml
61 |
62 | # Files built by Visual Studio
63 | *_i.c
64 | *_p.c
65 | *_h.h
66 | *.ilk
67 | *.meta
68 | *.obj
69 | *.iobj
70 | *.pch
71 | *.pdb
72 | *.ipdb
73 | *.pgc
74 | *.pgd
75 | *.rsp
76 | *.sbr
77 | *.tlb
78 | *.tli
79 | *.tlh
80 | *.tmp
81 | *.tmp_proj
82 | *_wpftmp.csproj
83 | *.log
84 | *.vspscc
85 | *.vssscc
86 | .builds
87 | *.pidb
88 | *.svclog
89 | *.scc
90 |
91 | # Chutzpah Test files
92 | _Chutzpah*
93 |
94 | # Visual C++ cache files
95 | ipch/
96 | *.aps
97 | *.ncb
98 | *.opendb
99 | *.opensdf
100 | *.sdf
101 | *.cachefile
102 | *.VC.db
103 | *.VC.VC.opendb
104 |
105 | # Visual Studio profiler
106 | *.psess
107 | *.vsp
108 | *.vspx
109 | *.sap
110 |
111 | # Visual Studio Trace Files
112 | *.e2e
113 |
114 | # TFS 2012 Local Workspace
115 | $tf/
116 |
117 | # Guidance Automation Toolkit
118 | *.gpState
119 |
120 | # ReSharper is a .NET coding add-in
121 | _ReSharper*/
122 | *.[Rr]e[Ss]harper
123 | *.DotSettings.user
124 |
125 | # JustCode is a .NET coding add-in
126 | .JustCode
127 |
128 | # TeamCity is a build add-in
129 | _TeamCity*
130 |
131 | # DotCover is a Code Coverage Tool
132 | *.dotCover
133 |
134 | # AxoCover is a Code Coverage Tool
135 | .axoCover/*
136 | !.axoCover/settings.json
137 |
138 | # Visual Studio code coverage results
139 | *.coverage
140 | *.coveragexml
141 |
142 | # NCrunch
143 | _NCrunch_*
144 | .*crunch*.local.xml
145 | nCrunchTemp_*
146 |
147 | # MightyMoose
148 | *.mm.*
149 | AutoTest.Net/
150 |
151 | # Web workbench (sass)
152 | .sass-cache/
153 |
154 | # Installshield output folder
155 | [Ee]xpress/
156 |
157 | # DocProject is a documentation generator add-in
158 | DocProject/buildhelp/
159 | DocProject/Help/*.HxT
160 | DocProject/Help/*.HxC
161 | DocProject/Help/*.hhc
162 | DocProject/Help/*.hhk
163 | DocProject/Help/*.hhp
164 | DocProject/Help/Html2
165 | DocProject/Help/html
166 |
167 | # Click-Once directory
168 | publish/
169 |
170 | # Publish Web Output
171 | *.[Pp]ublish.xml
172 | *.azurePubxml
173 | # Note: Comment the next line if you want to checkin your web deploy settings,
174 | # but database connection strings (with potential passwords) will be unencrypted
175 | *.pubxml
176 | *.publishproj
177 |
178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
179 | # checkin your Azure Web App publish settings, but sensitive information contained
180 | # in these scripts will be unencrypted
181 | PublishScripts/
182 |
183 | # NuGet Packages
184 | *.nupkg
185 | # The packages folder can be ignored because of Package Restore
186 | **/[Pp]ackages/*
187 | # except build/, which is used as an MSBuild target.
188 | !**/[Pp]ackages/build/
189 | # Uncomment if necessary however generally it will be regenerated when needed
190 | #!**/[Pp]ackages/repositories.config
191 | # NuGet v3's project.json files produces more ignorable files
192 | *.nuget.props
193 | *.nuget.targets
194 |
195 | # Microsoft Azure Build Output
196 | csx/
197 | *.build.csdef
198 |
199 | # Microsoft Azure Emulator
200 | ecf/
201 | rcf/
202 |
203 | # Windows Store app package directories and files
204 | AppPackages/
205 | BundleArtifacts/
206 | Package.StoreAssociation.xml
207 | _pkginfo.txt
208 | *.appx
209 |
210 | # Visual Studio cache files
211 | # files ending in .cache can be ignored
212 | *.[Cc]ache
213 | # but keep track of directories ending in .cache
214 | !?*.[Cc]ache/
215 |
216 | # Others
217 | ClientBin/
218 | ~$*
219 | *~
220 | *.dbmdl
221 | *.dbproj.schemaview
222 | *.jfm
223 | *.pfx
224 | *.publishsettings
225 | orleans.codegen.cs
226 |
227 | # Including strong name files can present a security risk
228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
229 | #*.snk
230 |
231 | # Since there are multiple workflows, uncomment next line to ignore bower_components
232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
233 | #bower_components/
234 |
235 | # RIA/Silverlight projects
236 | Generated_Code/
237 |
238 | # Backup & report files from converting an old project file
239 | # to a newer Visual Studio version. Backup files are not needed,
240 | # because we have git ;-)
241 | _UpgradeReport_Files/
242 | Backup*/
243 | UpgradeLog*.XML
244 | UpgradeLog*.htm
245 | ServiceFabricBackup/
246 | *.rptproj.bak
247 |
248 | # SQL Server files
249 | *.mdf
250 | *.ldf
251 | *.ndf
252 |
253 | # Business Intelligence projects
254 | *.rdl.data
255 | *.bim.layout
256 | *.bim_*.settings
257 | *.rptproj.rsuser
258 | *- Backup*.rdl
259 |
260 | # Microsoft Fakes
261 | FakesAssemblies/
262 |
263 | # GhostDoc plugin setting file
264 | *.GhostDoc.xml
265 |
266 | # Node.js Tools for Visual Studio
267 | .ntvs_analysis.dat
268 | node_modules/
269 |
270 | # Visual Studio 6 build log
271 | *.plg
272 |
273 | # Visual Studio 6 workspace options file
274 | *.opt
275 |
276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
277 | *.vbw
278 |
279 | # Visual Studio LightSwitch build output
280 | **/*.HTMLClient/GeneratedArtifacts
281 | **/*.DesktopClient/GeneratedArtifacts
282 | **/*.DesktopClient/ModelManifest.xml
283 | **/*.Server/GeneratedArtifacts
284 | **/*.Server/ModelManifest.xml
285 | _Pvt_Extensions
286 |
287 | # Paket dependency manager
288 | .paket/paket.exe
289 | paket-files/
290 |
291 | # FAKE - F# Make
292 | .fake/
293 |
294 | # JetBrains Rider
295 | .idea/
296 | *.sln.iml
297 |
298 | # CodeRush personal settings
299 | .cr/personal
300 |
301 | # Python Tools for Visual Studio (PTVS)
302 | __pycache__/
303 | *.pyc
304 |
305 | # Cake - Uncomment if you are using it
306 | # tools/**
307 | # !tools/packages.config
308 |
309 | # Tabs Studio
310 | *.tss
311 |
312 | # Telerik's JustMock configuration file
313 | *.jmconfig
314 |
315 | # BizTalk build output
316 | *.btp.cs
317 | *.btm.cs
318 | *.odx.cs
319 | *.xsd.cs
320 |
321 | # OpenCover UI analysis results
322 | OpenCover/
323 |
324 | # Azure Stream Analytics local run output
325 | ASALocalRun/
326 |
327 | # MSBuild Binary and Structured Log
328 | *.binlog
329 |
330 | # NVidia Nsight GPU debugger configuration file
331 | *.nvuser
332 |
333 | # MFractors (Xamarin productivity tool) working folder
334 | .mfractor/
335 |
336 | # Local History for Visual Studio
337 | .localhistory/
338 |
339 | # BeatPulse healthcheck temp database
340 | healthchecksdb
--------------------------------------------------------------------------------
/src/Farticus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
5 | Program
6 | $(DevEnvDir)devenv.exe
7 | /rootsuffix Exp
8 |
9 |
10 |
11 |
12 | Debug
13 | AnyCPU
14 | 2.0
15 | {7A55CBDD-CA18-4619-A80E-9F6E409D8A15}
16 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
17 | Library
18 | Properties
19 | LigerShark.Farticus
20 | Farticus
21 | v4.6
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\Debug\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 |
32 |
33 | pdbonly
34 | true
35 | bin\Release\
36 | TRACE
37 | prompt
38 | 4
39 | true
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | Component
53 |
54 |
55 |
56 | True
57 | True
58 | Farticus.vsct
59 |
60 |
61 |
62 |
63 | True
64 | True
65 | source.extension.vsixmanifest
66 |
67 |
68 |
69 |
70 | Designer
71 | VsixManifestGenerator
72 | source.extension.cs
73 |
74 |
75 |
76 |
77 | Menus.ctmenu
78 | Designer
79 | VsctGenerator
80 | Farticus.cs
81 |
82 |
83 |
84 |
85 | true
86 |
87 |
88 | true
89 |
90 |
91 | true
92 |
93 |
94 | true
95 |
96 |
97 | true
98 |
99 |
100 | true
101 |
102 |
103 | true
104 |
105 |
106 | true
107 |
108 |
109 | true
110 |
111 |
112 | true
113 |
114 |
115 | true
116 |
117 |
118 | true
119 |
120 |
121 | true
122 |
123 |
124 | true
125 |
126 |
127 | true
128 |
129 |
130 | true
131 |
132 |
133 | true
134 |
135 |
136 | true
137 |
138 |
139 | true
140 |
141 |
142 | true
143 |
144 |
145 | true
146 |
147 |
148 | Always
149 | true
150 |
151 |
152 |
153 | Always
154 | true
155 |
156 |
157 |
158 |
159 | 15.0.75.245-pre
160 | compile; build; native; contentfiles; analyzers; buildtransitive
161 |
162 |
163 | 17.13.2126
164 | runtime; build; native; contentfiles; analyzers; buildtransitive
165 | all
166 |
167 |
168 |
169 | true
170 |
171 |
172 |
173 |
180 |
192 |
193 |
202 |
203 |
238 |
--------------------------------------------------------------------------------