diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8ce6e5a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,25 @@ +# Road map + +- [x] A feature that has been completed +- [ ] A feature that has NOT yet been completed + +Features that have a checkmark are complete and available for +download in the +[CI build](http://vsixgallery.com/extension/6aae52ac-8840-421f-bb35-60b52ab431e2/). + +# Change log + +These are the changes to each version that has been released +on the official Visual Studio extension gallery. + +## 1.1 + +- [x] Feature 3 +- [x] Feature 4 + +## 1.0 + +- [x] Initial release +- [x] Feature 1 +- [x] Feature 2 + - [x] Sub feature \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..bbd835f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,160 @@ +# Contributing + +Looking to contribute something? **Here's how you can help.** + +Please take a moment to review this document in order to make the contribution +process easy and effective for everyone involved. + +Following these guidelines helps to communicate that you respect the time of +the developers managing and developing this open source project. In return, +they should reciprocate that respect in addressing your issue or assessing +patches and features. + + +## Using the issue tracker + +The issue tracker is the preferred channel for [bug reports](#bug-reports), +[features requests](#feature-requests) and +[submitting pull requests](#pull-requests), but please respect the +following restrictions: + +* Please **do not** use the issue tracker for personal support requests. Stack + Overflow is a better place to get help. + +* Please **do not** derail or troll issues. Keep the discussion on topic and + respect the opinions of others. + +* Please **do not** open issues or pull requests which *belongs to* third party + components. + + +## Bug reports + +A bug is a _demonstrable problem_ that is caused by the code in the repository. +Good bug reports are extremely helpful, so thanks! + +Guidelines for bug reports: + +1. **Use the GitHub issue search** — check if the issue has already been + reported. + +2. **Check if the issue has been fixed** — try to reproduce it using the + latest `master` or development branch in the repository. + +3. **Isolate the problem** — ideally create an + [SSCCE](http://www.sscce.org/) and a live example. + Uploading the project on cloud storage (OneDrive, DropBox, et el.) + or creating a sample GitHub repository is also helpful. + + +A good bug report shouldn't leave others needing to chase you up for more +information. Please try to be as detailed as possible in your report. What is +your environment? What steps will reproduce the issue? What browser(s) and OS +experience the problem? Do other browsers show the bug differently? What +would you expect to be the outcome? All these details will help people to fix +any potential bugs. + +Example: + +> Short and descriptive example bug report title +> +> A summary of the issue and the Visual Studio, browser, OS environments +> in which it occurs. If suitable, include the steps required to reproduce the bug. +> +> 1. This is the first step +> 2. This is the second step +> 3. Further steps, etc. +> +> `` - a link to the project/file uploaded on cloud storage or other publicly accessible medium. +> +> Any other information you want to share that is relevant to the issue being +> reported. This might include the lines of code that you have identified as +> causing the bug, and potential solutions (and your opinions on their +> merits). + + +## Feature requests + +Feature requests are welcome. But take a moment to find out whether your idea +fits with the scope and aims of the project. It's up to *you* to make a strong +case to convince the project's developers of the merits of this feature. Please +provide as much detail and context as possible. + + +## Pull requests + +Good pull requests, patches, improvements and new features are a fantastic +help. They should remain focused in scope and avoid containing unrelated +commits. + +**Please ask first** before embarking on any significant pull request (e.g. +implementing features, refactoring code, porting to a different language), +otherwise you risk spending a lot of time working on something that the +project's developers might not want to merge into the project. + +Please adhere to the [coding guidelines](#code-guidelines) used throughout the +project (indentation, accurate comments, etc.) and any other requirements +(such as test coverage). + +Adhering to the following process is the best way to get your work +included in the project: + +1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, + and configure the remotes: + + ```bash + # Clone your fork of the repo into the current directory + git clone https://github.com//.git + # Navigate to the newly cloned directory + cd + # Assign the original repo to a remote called "upstream" + git remote add upstream https://github.com/madskristensen/.git + ``` + +2. If you cloned a while ago, get the latest changes from upstream: + + ```bash + git checkout master + git pull upstream master + ``` + +3. Create a new topic branch (off the main project development branch) to + contain your feature, change, or fix: + + ```bash + git checkout -b + ``` + +4. Commit your changes in logical chunks. Please adhere to these [git commit + message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) + or your code is unlikely be merged into the main project. Use Git's + [interactive rebase](https://help.github.com/articles/interactive-rebase) + feature to tidy up your commits before making them public. Also, prepend name of the feature + to the commit message. For instance: "SCSS: Fixes compiler results for IFileListener.\nFixes `#123`" + +5. Locally merge (or rebase) the upstream development branch into your topic branch: + + ```bash + git pull [--rebase] upstream master + ``` + +6. Push your topic branch up to your fork: + + ```bash + git push origin + ``` + +7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) + with a clear title and description against the `master` branch. + + +## Code guidelines + +- Always use proper indentation. +- In Visual Studio under `Tools > Options > Text Editor > C# > Advanced`, make sure + `Place 'System' directives first when sorting usings` option is enabled (checked). +- Before committing, organize usings for each updated C# source file. Either you can + right-click editor and select `Organize Usings > Remove and sort` OR use extension + like [BatchFormat](http://visualstudiogallery.msdn.microsoft.com/a7f75c34-82b4-4357-9c66-c18e32b9393e). +- Before committing, run Code Analysis in `Debug` configuration and follow the guidelines + to fix CA issues. Code Analysis commits can be made separately. diff --git a/ClippyVSPackage/Clippy.cs b/ClippyVSPackage/Clippy.cs index 3b5181a..00064e8 100644 --- a/ClippyVSPackage/Clippy.cs +++ b/ClippyVSPackage/Clippy.cs @@ -34,7 +34,7 @@ public class Clippy /// /// The sprite with all the animation stages for Clippy /// - public BitmapSource Sprite; + private BitmapSource Sprite; /// /// The actual Clippy container that works as a clipping mask @@ -44,27 +44,30 @@ public class Clippy /// /// The image that holds the sprite /// - public Image clippedImage; + private Image clippedImage; /// /// The with of the frame /// - public static int ClipWidth = 124; + private static int ClipWidth = 124; /// /// The height of the frame /// - public static int ClipHeight = 93; + private static int ClipHeight = 93; /// /// Seconds between a random idle animation and another /// - private static int IdleAnimationTimeout = 45; + private const int IdleAnimationTimeout = 45; /// /// When is true it means an animation is actually running /// public bool IsAnimating { get; set; } + public static int ClipHeight1 { get => ClipHeight; set => ClipHeight = value; } + public static int ClipWidth1 { get => ClipWidth; set => ClipWidth = value; } + public List AllAnimations1 { get => AllAnimations; set => AllAnimations = value; } /// /// The list of couples of Columns/Rows double animations @@ -87,7 +90,7 @@ public class Clippy /// /// The list of all the available animations /// - public List AllAnimations = new List(); + private List AllAnimations = new List(); /// /// The time dispatcher to perform the animations in a random way @@ -101,9 +104,13 @@ public Clippy(Canvas canvas) { this.Sprite = new BitmapImage(new Uri(spriteResourceUri, UriKind.RelativeOrAbsolute)); - clippedImage = new System.Windows.Controls.Image(); - clippedImage.Source = Sprite; - clippedImage.Stretch = Stretch.None; + clippedImage = new Image + { + Source = Sprite, + Stretch = Stretch.None + }; + + if (canvas == null) return; canvas.Children.Clear(); canvas.Children.Add(clippedImage); @@ -111,14 +118,10 @@ public Clippy(Canvas canvas) if (Animations == null) RegisterAnimations(); - this.AllAnimations = new List(); - + AllAnimations1 = new List(); var values = Enum.GetValues(typeof(ClippyAnimations)); - foreach (ClippyAnimations val in values) - { - this.AllAnimations.Add(val); - } + AllAnimations1.Add(val); RegisterIdleRandomAnimations(); } @@ -131,11 +134,11 @@ private void RegisterAnimations() Uri uri = new Uri(animationsResourceUri, UriKind.RelativeOrAbsolute); StreamResourceInfo info = Application.GetResourceStream(uri); - List storedAnimations = Newtonsoft.Json.JsonConvert.DeserializeObject>(StreamToString(info.Stream)); + List storedAnimations = Newtonsoft.Json.JsonConvert.DeserializeObject>(StreamToString(info.Stream)); Animations = new Dictionary>(); - foreach (Animation animation in storedAnimations) + foreach (ClippyAnimation animation in storedAnimations) { DoubleAnimationUsingKeyFrames xDoubleAnimation = new DoubleAnimationUsingKeyFrames(); xDoubleAnimation.FillBehavior = FillBehavior.HoldEnd; @@ -156,10 +159,10 @@ private void RegisterAnimations() } // X - DiscreteDoubleKeyFrame xKeyFrame = new DiscreteDoubleKeyFrame(ClipWidth * -lastCol, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(timeOffset))); + DiscreteDoubleKeyFrame xKeyFrame = new DiscreteDoubleKeyFrame(ClipWidth1 * -lastCol, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(timeOffset))); // Y - DiscreteDoubleKeyFrame yKeyFrame = new DiscreteDoubleKeyFrame(ClipHeight * -lastRow, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(timeOffset))); + DiscreteDoubleKeyFrame yKeyFrame = new DiscreteDoubleKeyFrame(ClipHeight1 * -lastRow, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(timeOffset))); timeOffset += ((double)frame.Duration / 1000); @@ -227,7 +230,7 @@ public async System.Threading.Tasks.Task StartAnimationAsync(ClippyAnimations an } - + /// /// Reads the content of a stream into a string diff --git a/ClippyVSPackage/ClippyVSPackage.cs b/ClippyVSPackage/ClippyVSPackage.cs index c258045..3b5cd8c 100644 --- a/ClippyVSPackage/ClippyVSPackage.cs +++ b/ClippyVSPackage/ClippyVSPackage.cs @@ -25,14 +25,15 @@ namespace Recoding.ClippyVSPackage [Guid(Constants.guidClippyVSPkgString)] [ProvideOptionPageAttribute(typeof(OptionsPage), "Clippy VS", "General", 0, 0, supportsAutomation: true)] - public sealed class ClippyVSPackage : AsyncPackage + public sealed class ClippyVisualStudioPackage : AsyncPackage { /// /// Default ctor /// - public ClippyVSPackage() + public ClippyVisualStudioPackage() { Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString())); + } #region Package Members @@ -68,6 +69,7 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke { MessageBox.Show("Exception !"); } + await Recoding.ClippyVSPackage.Command1.InitializeAsync(this); } async void MainWindow_ContentRendered(object sender, EventArgs e) diff --git a/ClippyVSPackage/ClippyVSPackage.csproj b/ClippyVSPackage/ClippyVSPackage.csproj index 57f6262..100de96 100644 --- a/ClippyVSPackage/ClippyVSPackage.csproj +++ b/ClippyVSPackage/ClippyVSPackage.csproj @@ -1,5 +1,12 @@  + + + + + + + 15.0 12.0 @@ -62,6 +69,7 @@ DEBUG;TRACE prompt 4 + False pdbonly @@ -178,6 +186,127 @@ + + + + + + + + + + + + + + + + + + + + + ..\packages\EnvDTE.8.0.2\lib\net10\EnvDTE.dll + False + + + ..\packages\EnvDTE80.8.0.3\lib\net10\EnvDTE80.dll + True + + + + ..\packages\Microsoft.ServiceHub.Framework.2.0.66\lib\netstandard2.0\Microsoft.ServiceHub.Framework.dll + + + ..\packages\Microsoft.VisualStudio.ComponentModelHost.16.2.45\lib\net46\Microsoft.VisualStudio.ComponentModelHost.dll + + + ..\packages\Microsoft.VisualStudio.CoreUtility.16.0.428\lib\net472\Microsoft.VisualStudio.CoreUtility.dll + + + ..\packages\Microsoft.VisualStudio.ImageCatalog.16.3.29316.127\lib\net45\Microsoft.VisualStudio.ImageCatalog.dll + + + ..\packages\Microsoft.VisualStudio.Imaging.16.3.29318.209\lib\net45\Microsoft.VisualStudio.Imaging.dll + + + ..\packages\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.14.3.26930\lib\net20\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll + True + + + ..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6071\lib\Microsoft.VisualStudio.OLE.Interop.dll + + + ..\packages\Microsoft.VisualStudio.Shell.15.0.16.3.29318.209\lib\net45\Microsoft.VisualStudio.Shell.15.0.dll + + + ..\packages\Microsoft.VisualStudio.Shell.Framework.16.3.29318.209\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6072\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30320\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll + True + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61031\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll + True + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30111\lib\net20\Microsoft.VisualStudio.Shell.Interop.12.0.dll + True + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.14.3.26929\lib\net20\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.dll + True + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.15.0.26929\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.dll + False + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.15.6.27413\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.dll + True + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30730\lib\net11\Microsoft.VisualStudio.Shell.Interop.9.0.dll + + + ..\packages\Microsoft.VisualStudio.Text.Data.16.0.428\lib\net472\Microsoft.VisualStudio.Text.Data.dll + + + ..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6071\lib\net11\Microsoft.VisualStudio.TextManager.Interop.dll + + + ..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.TextManager.Interop.8.0.dll + + + ..\packages\Microsoft.VisualStudio.Threading.16.3.13\lib\net472\Microsoft.VisualStudio.Threading.dll + + + ..\packages\Microsoft.VisualStudio.Utilities.16.3.29318.209\lib\net46\Microsoft.VisualStudio.Utilities.dll + + + ..\packages\Microsoft.VisualStudio.Validation.15.3.15\lib\net45\Microsoft.VisualStudio.Validation.dll + + + ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + True + True + + + ..\packages\Microsoft.Win32.Registry.4.5.0\lib\net461\Microsoft.Win32.Registry.dll + + + ..\packages\Nerdbank.Streams.2.3.26\lib\netstandard2.0\Nerdbank.Streams.dll + + + ..\packages\Newtonsoft.Json.12.0.3-beta2\lib\net45\Newtonsoft.Json.dll + @@ -236,6 +365,24 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + + + + +