Skip to content

Instantly share code, notes, and snippets.

@Lakritzator
Created November 19, 2020 21:31
Show Gist options
  • Save Lakritzator/d6d51260ee0422ccefd51a8615c78802 to your computer and use it in GitHub Desktop.
Save Lakritzator/d6d51260ee0422ccefd51a8615c78802 to your computer and use it in GitHub Desktop.

Work in progress

Greenshot is a Windows desktop application written in C#. Up to now, with version 1.x we target the .NET Framework. We used to be very strict with using dependencies, most code was written by us. In fact, Greenshot 1.x is pretty much targeting .NET Framework 2.0. We weren't able to much of the newer functionality as a lot of our customers were against updating the .NET Framework. But the end result is an application which only takes around 2MB of disk space, pretty lean right?

Probably you are asking yourself why we would do this, well Greenshot was organically grown, not designed up front. This means that due to many changes there is a lot of spaghetti code, and it's in fact hard to understand how this all works together.

Some time ago we decided that we need to rewrite the application, with the following objectives:

  • Following clean code principles
  • Make functionality test-able
  • Make things modular, so it's easier to hook into this
  • Don't write what others provide
  • Don't keep generic stuff to ourselves
  • Don't write what isn't needed
  • Don't have too much restrictions, do what brings us joy (don't stay at lower .NET versions)

In the end we started using:

  • MahApps.Metro for the look and feel
  • Caliburn.Micro, a MVVM framework to manage our windows
  • Dependency injection for a more modular approach
  • The newest C# language version
  • dotnet core 3.1, later .NET 5

We extracted generic / core logic, which are more indirectly used in the screenshot domain, to their own open source projects:

  • Dapplo.Windows
  • Dapplo.HttpExtensions
  • Dapplo....

Planed are:

  • Avi
  • WPF Notify icon
  • ImageSharp We supported these open source libraries, by investing time to make them better. Not just in our interest, but as we like to contribute to the community.

We are currently in a bit of a picle, due to multiple issues:

  • Caliburn.Micro is currently without maintainer, the planed 4.0 version was delayed idefinitely.
  • .NET 5.0 doesn't have a good desktop app deployment model, more later
  • My development gear is really not motivating me to develop
  • COVID19 and working from home, suck all the energy away.

What about this .NET 5.0 desktop deployment? I'll write a gist about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment