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 async void SaveDocument() | |
| { | |
| if (IsWorking) return; | |
| var doc = MDI.ActiveItem as DocumentViewModel; | |
| if (doc != null) | |
| { | |
| using (DoingWork(string.Format("Saving {0}", doc.MarkpadDocument.Title))) | |
| { | |
| await doc.Save(); | |
| await TaskEx.Delay(5000); |
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
| <Window.InputBindings> | |
| <KeyBinding Modifiers="Ctrl" Key="S" Command="{Binding SaveDocumentCommand}" /> | |
| <KeyBinding Modifiers="Ctrl+Shift" Key="S" Command="{Binding SaveAllDocumentsCommand}" /> | |
| <KeyBinding Modifiers="Ctrl" Key="N" Command="{Binding NewDocumentCommand}" /> | |
| <KeyBinding Modifiers="Ctrl+Shift" Key="P" Command="{Binding PublishDocumentCommand}" /> | |
| <KeyBinding Modifiers="Ctrl" Key="O" Command="{Binding OpenDocumentCommand}" /> | |
| <KeyBinding Modifiers="Ctrl+Shift" Key="O" Command="{Binding OpenFromWebCommand}" /> | |
| <KeyBinding Modifiers="Ctrl" Key="W" Command="{Binding CloseDocumentCommand}" /> | |
| <KeyBinding Key="Escape" Command="commands:ShellCommands.Esc" /> |
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 static void ReturnsValueAsTask<T>(this Task<T> value, T returnThis, params T[] returnThese) | |
| { | |
| Returns(MatchArgs.AsSpecifiedInCall, ToCompletedTask(returnThis), returnThese.Select(ToCompletedTask).ToArray()); | |
| } | |
| public static void ReturnsValueAsTask<T>(this Task<T> value, Func<CallInfo, T> returnThis) | |
| { | |
| Returns(MatchArgs.AsSpecifiedInCall, c => ToCompletedTask(returnThis(c))); | |
| } |
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 SomeScreen | |
| { | |
| public string Text {get;set;} // Will look for a UI element called Text and return it's value | |
| public void Ok() { } // Finds a control called ok, and clicks it | |
| // Other conventions | |
| public string Text2 | |
| { |
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.Collections.Generic; | |
| using System.Net.Http; | |
| using System.Threading.Tasks; | |
| using Xunit; | |
| public class Fixture | |
| { | |
| [Fact] | |
| public void Should_FactMethodName() |
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 abstract class nsw_police_files : IntegrationTestBase | |
| { | |
| protected abstract void RunTests(); | |
| [Fact] | |
| public void Automate() | |
| { | |
| RunTest(Setup, Jurisdictions.NSW); | |
| RunTests(); | |
| } |
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
| void Main() | |
| { | |
| DoShiz(); | |
| } | |
| public async void DoShiz() | |
| { | |
| var worker = new Worker(); | |
| var ex = await ThrowsExceptionAsync<ArgumentException>(async () => await worker.GetMessage(" ")); | |
| var ex2 = await ThrowsExceptionAsync<ArgumentException>(() => worker.GetMessage(" ")); |
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
| Windows Registry Editor Version 5.00 | |
| [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Windows] | |
| "ErrorMode"="2" | |
| [HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting] | |
| "DontShowUI"="1" |
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 interface IRaiseCanExecuteChanged | |
| { | |
| void RaiseCanExecuteChanged(); | |
| } | |
| // And an extension method to make it easy to raise changed events | |
| public static class CommandExtensions | |
| { | |
| public static void RaiseCanExecuteChanged(this ICommand command) | |
| { |
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 DelegateCommand : DelegateCommand<object> | |
| { | |
| public DelegateCommand(Action executeMethod) | |
| : base(o => executeMethod()) | |
| { | |
| } | |
| public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod) | |
| : base(o => executeMethod(), o => canExecuteMethod()) | |
| { |