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.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Diagnostics.Contracts; | |
namespace System.Runtime.InteropServices | |
{ | |
/// <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
public static class StringExtensions | |
{ | |
public static bool TryParseInt16(this string source, Func<short, bool> condition) | |
{ | |
short result = 0; | |
if (short.TryParse(source, out result)) | |
return condition(result); | |
else | |
return 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
<ItemGroup> | |
<!-- Specify the folder, or files we want to include --> | |
<AdditionalPublishFiles Include="ListAndLabel\*.*"> | |
<Visible>False</Visible> | |
</AdditionalPublishFiles> | |
<!-- Alternative syntax, for individual files --> | |
<!-- | |
<AdditionalPublishFiles Include="ListAndLabel\cmbr15.dll;ListAndLabel\Cmct15.dll"> | |
<Visible>False</Visible> |
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
Example XAML: | |
<ListBox.ItemTemplate> | |
<DataTemplate> | |
<StackPanel> | |
<ProgressBar x:Name="PART_ProgressBar" /> | |
<Image> | |
<Image.Source> | |
<BitmapImage behaviors:ImageDownloadProgress.ProgressBar="{Binding ElementName=PART_ProgressBar}" UriSource="{Binding Image}" /> | |
</Image.Source> |
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 CRUFL_MT; | |
using MTool.Framework; | |
namespace MTool.Report | |
{ | |
public partial class MeterReportForm : MToolFormBase | |
{ | |
public MeterReportForm() | |
{ |
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
[TestMethod] | |
public void ExecuteTest() | |
{ | |
var acceptanceTestRepository = new Mock<IAcceptanceTestRepository>(); | |
var testPointRepository = new Mock<ITestPointRepository>(); | |
var dialogService = new Mock<IDialogService>(); | |
var eventAggregator = new Mock<IEventAggregator>(); | |
eventAggregator.Setup(x => x.GetEvent<TestPointUpdatedEvent>()).Returns(new TestPointUpdatedEvent()); | |
eventAggregator.Setup(x => x.GetEvent<AcceptanceTestUpdatedEvent>()).Returns(new AcceptanceTestUpdatedEvent()); |
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
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'ChangePasswordMenuItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment') | |
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'ChangePasswordMenuItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment') | |
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=AreRowDetailsFrozen; DataItem=null; target element is 'DataGridDetailsPrese |
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 int TestTimeWithSampling | |
{ | |
get | |
{ | |
return CalculateTestTimeWithSampling(); | |
} | |
} | |
private int CalculateTestTimeWithSampling() | |
{ |
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
var assembly = typeof(MeterCommunicator).Assembly; | |
var commands = assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(CommandBase))); | |
var output = new StringBuilder(); | |
foreach (var command in commands) | |
{ | |
string test = | |
@"[TestMethod] | |
public void {0}Test() |
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
private void IsAlive() | |
{ | |
int counter = 0; | |
int threadId = Thread.CurrentThread.ManagedThreadId; | |
while (keepCheckingConnection) | |
{ | |
Thread.Sleep(1000); | |
if (counter != 60) |