Exemplo n.º 1
0
 private void MirrorError(MirrorEventArgs args)
 {
     if (mirrorErrorChk.Checked)
     {
         _ctrl_MirrorError(args);
     }
 }
Exemplo n.º 2
0
 private void MirrorEvent(MirrorEventArgs args)
 {
     if (mirrorActivityChk.Checked)
     {
         _ctrl_MirrorEvent(args);
     }
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
            }
        }