This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ResourceDictionary | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"> | |
| <Style TargetType="UserControl"> | |
| <Setter Property="Background" Value="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBackgroundBrushKey}}" /> | |
| <Setter Property="Foreground" Value="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowTextBrushKey}}"/> | |
| </Style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace Preconditions | |
| { | |
| /// <summary> | |
| /// Preconditions for checking method arguments, state etc. | |
| /// </summary> | |
| public static class Preconditions | |
| { | |
| /// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using AnyStatus.API; | |
| using System.ComponentModel; | |
| using System.ComponentModel.DataAnnotations; | |
| [DisplayName("Health Check Example")] | |
| [DisplayColumn("My Category")] | |
| [Description("My health check description.")] | |
| public class MyHealthCheck : Widget, IHealthCheck, IWebPage, ISchedulable, IStartable, IStoppable, IRestartable | |
| { | |
| [Required] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using AnyStatus.API; | |
| using System.Threading.Tasks; | |
| public class MyHealthChecker : ICheckHealth<MyHealthCheck> | |
| { | |
| public async Task Handle(HealthCheckRequest<MyHealthCheck> request, CancellationToken cancellationToken) | |
| { | |
| var myHealthCheck = request.DataContext; | |
| await Task.Delay(1).ConfigureAwait(false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using System.Runtime.InteropServices; | |
| using System.Text; | |
| using System.Windows; | |
| using System.Windows.Interop; | |
| using System.Xml; | |
| using System.Xml.Serialization; | |
| namespace WindowPlacementExample |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <configuration> | |
| <configSections> | |
| <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/> | |
| </configSections> | |
| <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| <targets> | |
| <target name="default" xsi:type="File" | |
| fileName="C:\logs\app-log.txt" | |
| archiveFileName="C:\logs\archives\app-log.{#}.txt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Random ID generation --> | |
| {% assign min = 0 %} | |
| {% assign max = 1000 %} | |
| {% assign diff = max | minus: min %} | |
| {% assign randomNumber = "now" | date: "%N" | modulo: diff | plus: min %} | |
| <!-- /Random ID generation --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using AnyStatus.API; | |
| using System.ComponentModel; | |
| using System.ComponentModel.DataAnnotations; | |
| [DisplayName("My Widget")] | |
| [DisplayColumn("My Category")] | |
| [Description("My widget description.")] | |
| public class MyWidget : Widget, IHealthCheck, ISchedulable, IStartable, IStoppable | |
| { | |
| [Required] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using AnyStatus.API; | |
| using System.Threading.Tasks; | |
| public class MyWidgetHealthCheck : ICheckHealth<MyWidget> | |
| { | |
| public async Task Handle(HealthCheckRequest<MyWidget> request, CancellationToken cancellationToken) | |
| { | |
| var myWidget = request.DataContext; | |
| await Task.Delay(1).ConfigureAwait(false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CollectionSynchronizer<TSource, TDestination> | |
| { | |
| public Action<TSource> Add { get; set; } | |
| public Action<TDestination> Remove { get; set; } | |
| public Action<TSource, TDestination> Update { get; set; } | |
| public Func<TSource, TDestination, bool> Compare { get; set; } | |
| /// <summary> | |
| /// Synchronize changes from source to destination collection. | |
| /// Source collection is not changed. |