Skip to content

Commit

Permalink
cleanup: run code formatter and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
natemcmaster committed Jan 30, 2021
1 parent 7d673f3 commit bef2ef2
Show file tree
Hide file tree
Showing 72 changed files with 281 additions and 132 deletions.
5 changes: 4 additions & 1 deletion samples/aspnetcore-mvc/MvcApp/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Microsoft.AspNetCore.Mvc;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore.Mvc;

namespace MvcWebApp.Controllers
{
Expand Down
5 changes: 4 additions & 1 deletion samples/aspnetcore-mvc/MvcApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Microsoft.AspNetCore;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace MvcWebApp
Expand Down
5 changes: 4 additions & 1 deletion samples/aspnetcore-mvc/MvcApp/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
Expand Down
5 changes: 4 additions & 1 deletion samples/aspnetcore-mvc/MvcAppPlugin1/MyPluginController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Microsoft.AspNetCore.Mvc;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore.Mvc;

namespace MvcAppPlugin1
{
Expand Down
6 changes: 4 additions & 2 deletions samples/aspnetcore/Abstractions/IPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using Microsoft.Extensions.DependencyInjection;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace Plugin.Abstractions
{
Expand Down
3 changes: 3 additions & 0 deletions samples/aspnetcore/Abstractions/IPluginLink.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

namespace Plugin.Abstractions
{
public interface IPluginLink
Expand Down
6 changes: 3 additions & 3 deletions samples/aspnetcore/MainWebApp/Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Plugin.Abstractions;

Expand Down
10 changes: 3 additions & 7 deletions samples/aspnetcore/MainWebApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace MainWebApp
{
Expand Down
11 changes: 6 additions & 5 deletions samples/aspnetcore/MainWebApp/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading.Tasks;
using System.Linq;
using McMaster.NETCore.Plugins;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Plugin.Abstractions;

namespace MainWebApp
{
public class Startup
{
private List<IWebPlugin> _plugins = new List<IWebPlugin>();
private readonly List<IWebPlugin> _plugins = new();

public Startup()
{
Expand Down
4 changes: 3 additions & 1 deletion samples/aspnetcore/WebAppPlugin1/WebPlugin1.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
Expand Down
4 changes: 3 additions & 1 deletion samples/aspnetcore/WebAppPlugin2/WebPlugin2.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
Expand Down
7 changes: 5 additions & 2 deletions samples/dependency-injection/DI.HostApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
using McMaster.NETCore.Plugins;
using Microsoft.Extensions.DependencyInjection;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using McMaster.NETCore.Plugins;
using Microsoft.Extensions.DependencyInjection;

namespace DependencyInjection
{
Expand Down
5 changes: 4 additions & 1 deletion samples/dependency-injection/DI.SharedAbstractions/Fruit.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace DependencyInjection
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

namespace DependencyInjection
{
public class Fruit
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace DependencyInjection
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

namespace DependencyInjection
{
public interface IFruitConsumer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;

namespace DependencyInjection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.Extensions.DependencyInjection;

namespace DependencyInjection
{
Expand Down
4 changes: 3 additions & 1 deletion samples/dependency-injection/MyPlugin1/MyFruitProducer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;
using DependencyInjection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using DependencyInjection;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

namespace MyPlugin1
Expand Down
5 changes: 4 additions & 1 deletion samples/dependency-injection/MyPlugin2/MyFruitConsumer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using DependencyInjection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using DependencyInjection;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

namespace MyPlugin2
Expand Down
7 changes: 5 additions & 2 deletions samples/dynamic-implementation/Contracts/Fruit.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace Contracts
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

namespace Contracts
{
public class Fruit
{
public string Name { get; set; }
public string? Name { get; set; }
}
}
5 changes: 4 additions & 1 deletion samples/dynamic-implementation/Contracts/IFruitService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Collections.Generic;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;

namespace Contracts
{
Expand Down
5 changes: 4 additions & 1 deletion samples/dynamic-implementation/Contracts/IMixerService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace Contracts
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

namespace Contracts
{
public interface IMixerService
{
Expand Down
5 changes: 4 additions & 1 deletion samples/dynamic-implementation/Contracts/IPluginFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.Extensions.DependencyInjection;

namespace Contracts
{
Expand Down
11 changes: 7 additions & 4 deletions samples/dynamic-implementation/Host/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -8,9 +11,9 @@

namespace Host
{
class Program
internal class Program
{
static void Main(string[] args)
public static void Main(string[] args)
{
var services = new ServiceCollection();
var loaders = GetPluginLoaders();
Expand All @@ -20,7 +23,7 @@ static void Main(string[] args)
var serviceProvider = services.BuildServiceProvider();

var mixer = serviceProvider.GetRequiredService<IMixerService>();
var result = mixer.MixIt();
mixer.MixIt();
}

private static List<PluginLoader> GetPluginLoaders()
Expand Down
5 changes: 4 additions & 1 deletion samples/dynamic-implementation/Mixer/MixerPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Contracts;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Contracts;
using Microsoft.Extensions.DependencyInjection;

namespace Mixer
Expand Down
5 changes: 4 additions & 1 deletion samples/dynamic-implementation/Mixer/MixerService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Linq;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Linq;
using Contracts;

namespace Mixer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Collections.Generic;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;
using Contracts;

namespace Mixer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Collections.Generic;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Generic;
using Contracts;

namespace ServiceImplementation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Contracts;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Contracts;
using Microsoft.Extensions.DependencyInjection;

namespace ServiceImplementation
Expand Down
6 changes: 4 additions & 2 deletions samples/hello-world/HostApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using McMaster.NETCore.Plugins;

namespace HelloWorld
Expand Down
4 changes: 3 additions & 1 deletion samples/hello-world/MyPlugin/MyPlugin1.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using HelloWorld;

namespace MyPlugin
Expand Down
3 changes: 3 additions & 0 deletions samples/hello-world/PluginContract/IPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

namespace HelloWorld
{
/// <summary>
Expand Down
9 changes: 6 additions & 3 deletions samples/hot-reload/HotReloadApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Threading;
using System.Threading.Tasks;
using McMaster.NETCore.Plugins;

namespace HostApp
{
class Program
internal class Program
{
static async Task Main(string[] args)
public static async Task Main(string[] args)
{
var pluginPath = args[0];
var loader = PluginLoader.CreateFromAssemblyFile(pluginPath,
Expand Down
5 changes: 4 additions & 1 deletion samples/hot-reload/TimestampedPlugin/InfoDisplayer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Linq;
using System.Reflection;
using Microsoft.Data.Sqlite;
Expand Down
7 changes: 5 additions & 2 deletions src/Plugins/Internal/Debouncer.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
using System;
// Copyright (c) Nate McMaster.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Threading;
using System.Threading.Tasks;

namespace McMaster.NETCore.Plugins.Internal
{
internal class Debouncer : IDisposable
{
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
private readonly CancellationTokenSource _cts = new();
private readonly TimeSpan _waitTime;
private int _counter;

Expand Down
Loading

0 comments on commit bef2ef2

Please sign in to comment.