Skip to content

Commit

Permalink
mergo master
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Abt committed May 12, 2021
2 parents b9c3c67 + b11a605 commit 9bdc8c3
Show file tree
Hide file tree
Showing 15 changed files with 427 additions and 43 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
160 changes: 160 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
>
> `<url>` - 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/<your-username>/<this-repro-name>.git
# Navigate to the newly cloned directory
cd <folder-name>
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/madskristensen/<this-repro-name>.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 <topic-branch-name>
```

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 <topic-branch-name>
```

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.
43 changes: 23 additions & 20 deletions ClippyVSPackage/Clippy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Clippy
/// <summary>
/// The sprite with all the animation stages for Clippy
/// </summary>
public BitmapSource Sprite;
private BitmapSource Sprite;

/// <summary>
/// The actual Clippy container that works as a clipping mask
Expand All @@ -44,27 +44,30 @@ public class Clippy
/// <summary>
/// The image that holds the sprite
/// </summary>
public Image clippedImage;
private Image clippedImage;

/// <summary>
/// The with of the frame
/// </summary>
public static int ClipWidth = 124;
private static int ClipWidth = 124;

/// <summary>
/// The height of the frame
/// </summary>
public static int ClipHeight = 93;
private static int ClipHeight = 93;

/// <summary>
/// Seconds between a random idle animation and another
/// </summary>
private static int IdleAnimationTimeout = 45;
private const int IdleAnimationTimeout = 45;

/// <summary>
/// When is true it means an animation is actually running
/// </summary>
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<ClippyAnimations> AllAnimations1 { get => AllAnimations; set => AllAnimations = value; }

/// <summary>
/// The list of couples of Columns/Rows double animations
Expand All @@ -87,7 +90,7 @@ public class Clippy
/// <summary>
/// The list of all the available animations
/// </summary>
public List<ClippyAnimations> AllAnimations = new List<ClippyAnimations>();
private List<ClippyAnimations> AllAnimations = new List<ClippyAnimations>();

/// <summary>
/// The time dispatcher to perform the animations in a random way
Expand All @@ -101,24 +104,24 @@ 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);

if (Animations == null)
RegisterAnimations();

this.AllAnimations = new List<ClippyAnimations>();

AllAnimations1 = new List<ClippyAnimations>();
var values = Enum.GetValues(typeof(ClippyAnimations));

foreach (ClippyAnimations val in values)
{
this.AllAnimations.Add(val);
}
AllAnimations1.Add(val);

RegisterIdleRandomAnimations();
}
Expand All @@ -131,11 +134,11 @@ private void RegisterAnimations()
Uri uri = new Uri(animationsResourceUri, UriKind.RelativeOrAbsolute);
StreamResourceInfo info = Application.GetResourceStream(uri);

List<Animation> storedAnimations = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Animation>>(StreamToString(info.Stream));
List<ClippyAnimation> storedAnimations = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClippyAnimation>>(StreamToString(info.Stream));

Animations = new Dictionary<string, Tuple<DoubleAnimationUsingKeyFrames, DoubleAnimationUsingKeyFrames>>();

foreach (Animation animation in storedAnimations)
foreach (ClippyAnimation animation in storedAnimations)
{
DoubleAnimationUsingKeyFrames xDoubleAnimation = new DoubleAnimationUsingKeyFrames();
xDoubleAnimation.FillBehavior = FillBehavior.HoldEnd;
Expand All @@ -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);

Expand Down Expand Up @@ -227,7 +230,7 @@ public async System.Threading.Tasks.Task StartAnimationAsync(ClippyAnimations an

}



/// <summary>
/// Reads the content of a stream into a string
Expand Down
6 changes: 4 additions & 2 deletions ClippyVSPackage/ClippyVSPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/// <summary>
/// Default ctor
/// </summary>
public ClippyVSPackage()
public ClippyVisualStudioPackage()
{
Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));

}

#region Package Members
Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 9bdc8c3

Please sign in to comment.