Skip to content

Instantly share code, notes, and snippets.

View clausjoergensen's full-sized avatar

Claus Jørgensen clausjoergensen

View GitHub Profile
public override void Execute(object parameter)
{
var oldViewItem = meterTestViewModel.SelectedTestPointSequence;
if (oldViewItem == null)
{
return;
}
var testPointSequenceCopy = oldViewItem.Save();
Code:
internal static byte CalculateByteStuffingLength(byte[] dataLinkLayerFrame)
{
byte resultat = 0;
foreach (byte b in dataLinkLayerFrame)
{
if ((b == WriteStartByte) || (b == ReadStartByte) || (b == Stop) || (b == Acknowledgement) || (b == Stuff))
public override byte[] Create()
{
var stream = new MemoryStream();
using (var writer = new BinaryWriter(stream))
{
writer.Write(CommunicationAddress);
writer.Write(CommandId);
unchecked
{
VSIXInstaller.SignatureMismatchException: The signature on the update version of 'NuGet Package Manager' does not match the signature on the installed version. Therefore, Extension Manager cannot install the update.
private void IsAlive()
{
int counter = 0;
int threadId = Thread.CurrentThread.ManagedThreadId;
while (keepCheckingConnection)
{
Thread.Sleep(1000);
if (counter != 60)
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()
public int TestTimeWithSampling
{
get
{
return CalculateTestTimeWithSampling();
}
}
private int CalculateTestTimeWithSampling()
{
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
[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());
using System;
using CRUFL_MT;
using MTool.Framework;
namespace MTool.Report
{
public partial class MeterReportForm : MToolFormBase
{
public MeterReportForm()
{