0 Comments

GrazeDocs is a new open source static documentation site generator. GrazeDocs converts your Markdown files into full-blown static HTML-pages which you can host anywhere. GrazeDocs uses Razor for themes and it is available as a .NET Core Global Tool.

Project home site: https://grazedocs.io

Project repository: https://github.com/mikoskinen/GrazeDocs

Features

Here’s a list of few interesting features provided by GrazeDocs:

  • Clean and light default theme
  • Automatically generated table of contents
  • Live preview

Live previews is one of the standout features: Live Preview automatically opens a browser with your published documentation site. Every time you update the documentation, the site is automatically updated. You don’t have to manually publish your site to make sure your site looks correct. The Live Preview is done using SignalR.

Getting started

GrazeDocs aims to make it easy to get started by using conventions but it also tries to offer customization options if you aren’t happy with the defaults. For more thorough guides, please visit the documentation available at https://grazedocs.io or the samples at https://github.com/mikoskinen/GrazeDocs/tree/master/samples

GrazeDocs is available as a global tool for .NET Core. To install:

1
dotnet tool install -g GrazeDocs

To start creating your documentation, use GrazeDocs -i . to initialize documentation into the current folder:

1
GrazeDocs -i .

After your happy with the documentation, use GrazeDocs -p to publish your complete site:

1
GrazeDocs –p

Examples and more information

GrazeDocs home page is created using GrazeDocs. You can find the site’s source code from https://github.com/mikoskinen/GrazeDocs/tree/master/docs

For more information, GrazeDocs samples are good starting point as is https://GrazeDocs.io.

0 Comments

Alias engine is a new MIT-licensed open source C# & .NET Standard based engine for creating aliases for your commands. It's inspired by the alias support which mIRC provides.

Example: Alias “ae” can be used to execute command “Alias Engine”.

The project can be found from GitHub and the engine is available through Nuget https://www.nuget.org/packages/AliasEngine/.

Background

What is an alias and what you can do with them? Aliases can be used to shorten commands. If your application provides a “help” command, you can provide a shorter alias “h” for running it.

Alias Engine can also be used to provide alias feature for the end user. Your application can provide a fixed set of commands like “help”, “show”, “create” and the user of your application can create aliases for executing the commands.

Features

Alias Engine supports these features:

  • Multi-Command aliases
  • Multi-Parameter aliases
  • Multi-Word parameters

Here’s a quick example of using the engine:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var converter =new AliasConverter(new InMemoryAliasStore(),new NullLogger<AliasConverter>());
converter.AddAlias("/x multiple return words");
converter.AddAlias("/j /join {0}");
...
[Test]
[TestCase("/x", ExpectedResult ="multiple return words")]
public string CanRunAlias(string alias)
{
var result = converter.Convert(alias);
return result[0];
}
...
[Test]
[TestCase("/j hello", ExpectedResult ="/join hello")]
public string CanRunAliasWithParameters(string alias)
{
var result = _converter.Convert(alias);
return result[0];
}

For more examples, the best place is to check Alias Engine tests: https://github.com/mikoskinen/AliasEngine/blob/master/src/AliasEngine.Tests/AliasEngineTests.cs

0 Comments

imageLast week I introduced UWP.MDI, a new library for building MDI applications in UWP.

The open source library has been updated this week to support automatic arrangement of child windows. The library now contains three built-in layouts:

Cascade

image

Tile vertical

image

Tile horizontal

image

Usage

To apply layout, call MDIContainer.LayoutMdi(desired layout). Built-in layouts are available from LayoutMdi:

        private void CascadeMenuItem_OnClick(object sender, RoutedEventArgs e)
        {
            Mdi.LayoutMdi(MdiLayout.Cascade);
        }

        private void TileVerticalMenuItem_OnClick(object sender, RoutedEventArgs e)
        {
            Mdi.LayoutMdi(MdiLayout.TileVertical);
        }

        private void TileHorizontalMenuItem_OnClick(object sender, RoutedEventArgs e)
        {
            Mdi.LayoutMdi(MdiLayout.TileHorizontal);
        }

Custom layouts

You can implement custom MDI layouts by inheriting abstract class MdiLayout and implementing the RunLayout-method.

Good starting point for an example is Cascade layout.

Note

Layouts are not continuous. Meaning, they only arrange windows when run, after which user can again move and resize windows as they desire.

Sample

Repository contains a new “samples”-folder which currently includes two samples: Getting started and Layouts. You can check out the layouts-sample for more concrete guidance.

NuGet

The layout support isn’t included in the current 1.0.0.1 package but it will be included in version 1.1.0.0, which is coming out later this week.

You can get the latest bits from GitHub and start working with the feature.

0 Comments

UWP.MDI_faster

UWP.MDI is a new library which provides MDI (Multiple document interface) support for UWP applications. The library is completely open source and available with MIT license.

Background

MDI (Multiple Document Interface) was popular user interface paradigm in Windows Forms era. MDI allows one window to host multiple child windows. Each window can be resized and moved around.

When WPF was released, it didn't contain support for MDI interfaces and the situation didn't change when WinRT and UWP were released.

UWP.MDI has two targets:

  1. To provide comprehensive MDI support for UWP applications.
  2. To provide MDI support in such a way that those familiar with Windows Forms' MDI support feel at home.

Getting started

Getting started with UWP.MDI aims to be simple:

  1. Create a blank uwp application
  2. Add MDIContainer into the MainForm
  3. Add UserControl
  4. Show UserControl by creating a new instance of it and calling MyUserControl.Show()

The easiest way to get learn more is to clone the project repository (https://github.com/mikoskinen/UWP.MDI) and to launch the sample application. The sample contains the MDI container and couple child windows.

Known issues

The library has few known issues. Main thing is making sure that everything works nicely with your MVVM framework of choice. The UWP.MDI library is implemented in such a way that you can continue using for example Caliburn.Micro, but there’s currently no available sample for that.

Links

UWP.MDI is available from GitHub: https://github.com/mikoskinen/UWP.MDI

0 Comments

I released NSQLFormatter few years ago (actually it’s more than few years ago, back in 2011.). As a reminder, NSQLFormatter is "an open-source SQL Beautifier written with C#".

In 2015 the library was released as a Portable Class Libray. There's now a new version which targets .NET Standard 1.3. This version is supported by about every currently supported .NET platform, including .NET Core, Mono and .NET Framework 4.6.1.

Let me know if you encounter any issues with the project.

GitHub: https://github.com/mikoskinen/NSQLFormatter-dotnet

NuGet: https://www.nuget.org/packages/NSQLFormatter/