示例#1
0
 private void UserNavigateToAddress(Address addrFrom, Address addrTo)
 {
     if (!program.ImageMap.IsValidAddress(addrTo))
     {
         return;
     }
     navInteractor.RememberAddress(addrFrom);
     control.CurrentAddress = addrTo;        // ...and move to the new position.
 }
 private void UserNavigateToAddress(Address addrFrom, Address addrTo)
 {
     if (!program.SegmentMap.IsValidAddress(addrTo))
     {
         return;
     }
     navInteractor.RememberAddress(addrTo);
     this.SelectedAddress = addrTo;        // ...and move to the new position.
 }
示例#3
0
        void textView_Navigate(object sender, EditorNavigationArgs e)
        {
            var procDst = e.Destination as Procedure;

            if (procDst == null)
            {
                return;
            }
            navInteractor.RememberAddress(this.proc);
            DisplayProcedure(this.program, procDst);    // ...and move to the new position.

            //$REVIEW: should this fire an event on a ISelectionService interface
            // and let interested parties track that?
            var pbSvc = services.GetService <IProjectBrowserService>();

            if (pbSvc != null)
            {
                pbSvc.SelectedObject = procDst;
            }
        }
        public void Ni_Back()
        {
            ni = new NavigationInteractor<Address>();
            mr.ReplayAll();

            When_Attached();
            navControl.CurrentAddress = addr42;
            ni.RememberAddress(addr43);
            btnBack.Raise(b => b.Click += null, btnBack, EventArgs.Empty);

            Assert.IsFalse(btnBack.Enabled);
            Assert.IsTrue(btnForward.Enabled);
        }
        public void Ni_UserNavigateTo()
        {
            ni = new NavigationInteractor<Address>();
            mr.ReplayAll();


            When_Attached();
            navControl.CurrentAddress = addr42;
            Assert.IsFalse(btnBack.Enabled);
            ni.RememberAddress(addr43);
            Assert.IsTrue(btnBack.Enabled);
            Assert.IsFalse(btnForward.Enabled);

            mr.VerifyAll();
        }
示例#6
0
        public void Ni_Back2_Then_Forward2_Distinct()
        {
            ni = new NavigationInteractor<Address>();
            mr.ReplayAll();

            When_Attached();

            Assert.IsFalse(btnBack.Enabled);
            Assert.IsFalse(btnForward.Enabled);

            navControl.CurrentAddress = addr42;
            ni.RememberAddress(addr43);
            navControl.CurrentAddress = addr45;
            ni.RememberAddress(addr44);

            Assert.IsTrue(btnBack.Enabled);
            Assert.IsFalse(btnForward.Enabled);

            btnBack.Raise(b => b.Click += null, btnBack, EventArgs.Empty);
            Assert.AreEqual("0000002D", navControl.CurrentAddress.ToString());
            btnBack.Raise(b => b.Click += null, btnBack, EventArgs.Empty);
            Assert.AreEqual("0000002B", navControl.CurrentAddress.ToString());
            btnBack.Raise(b => b.Click += null, btnBack, EventArgs.Empty);
            Assert.AreEqual("0000002A", navControl.CurrentAddress.ToString());

            Assert.IsFalse(btnBack.Enabled);
            Assert.IsTrue(btnForward.Enabled);

            btnForward.Raise(b => b.Click += null, btnForward, EventArgs.Empty);
            Assert.AreEqual("0000002B", navControl.CurrentAddress.ToString());
            btnForward.Raise(b => b.Click += null, btnForward, EventArgs.Empty);
            Assert.AreEqual("0000002D", navControl.CurrentAddress.ToString());
            btnForward.Raise(b => b.Click += null, btnForward, EventArgs.Empty);
            Assert.AreEqual("0000002C", navControl.CurrentAddress.ToString());

            Assert.IsTrue(btnBack.Enabled);
            Assert.IsFalse(btnForward.Enabled);
        }