private void MirrorError(MirrorEventArgs args) { if (mirrorErrorChk.Checked) { _ctrl_MirrorError(args); } }
private void MirrorEvent(MirrorEventArgs args) { if (mirrorActivityChk.Checked) { _ctrl_MirrorEvent(args); } }
public void Run_DestinationDoesNotHaveDirectory_CorrectSituationInEvent() { var path = CreateSourceDirectoriesAndGenericFile("fruit"); MirrorEventArgs gotArgs = null; _maker.StartingDirectory += ((o, args) => gotArgs = args); _maker.Run(); Assert.AreEqual(MirrorSituation.DirectoryMissing, gotArgs.Situation); AssertCorrespondingFileExists(path); }
public void Run_DestinationAlreadyHasFile_CorrectSituationInEvent() { var path = CreateSourceDirectoriesAndGenericFile("fruit", "apple.txt"); _maker.Run(); MirrorEventArgs gotArgs = null; _maker.StartingFile += ((o, args) => gotArgs = args); _maker.Run(); Assert.AreEqual(MirrorSituation.FileIsSame, gotArgs.Situation); AssertCorrespondingFileExists(path); }
private void _ctrl_MirrorEvent(MirrorEventArgs mirrorEventArgs) { var row = (DataGridViewRow)mirrorGrid.Rows[0].Clone(); row.Cells[0].Value = mirrorEventArgs.FSWname; row.Cells[1].Value = mirrorEventArgs.TimeStamp.ToLongTimeString(); row.Cells[2].Value = mirrorEventArgs.Action; row.Cells[3].Value = mirrorEventArgs.Info; if (mirrorGrid.InvokeRequired) { SetMirrorEventCallback d = _ctrl_MirrorEvent; Invoke(d, new object[] { mirrorEventArgs }); } else { mirrorGrid.Rows.Insert(0, row); } }