Example #1
0
 public void Verify_Remove()
 {
     _testMap.Add(_testInvoker, TestHandler);
     Assert.AreEqual(_testMap.GetInvokerHandlerCount(_testInvoker), 2);
     _testMap.Remove(_testInvoker, TestHandler);
     Assert.AreEqual(_testMap.GetInvokerHandlerCount(_testInvoker), 1);
 }
Example #2
0
 public void Init()
 {
     _testMap        = new InvokerMap();
     _testInvoker    = new Invoker();
     _invokerHandled = false;
     _testMap.Add(_testInvoker, (sender, e) => _invokerHandled = true);
 }
        public override void Register()
        {
//			InvokerMap.Add (Target.Filter, HandleFilter);
            InvokerMap.Add(Target.OnPaperSelected, HandlerPaperSelected);
            InvokerMap.Add(PapersReceived, (object sender, EventArgs e) => SetPapers(e as PapersReceivedInvokerArgs));

//			Target.SearchPlaceHolderText = "Search Papers";

//			if([appDelegate isUserLoggedIn]){
//				self.navigationItem.rightBarButtonItem = self.editButtonItem;
//				[HRRestModel setDelegate:self];
//				[HRRestModel getPath:@"/favorite/index/?caller=wpb-iPhone" withOptions:nil object:self];
//				[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
//			}
//			else{
//				NotLoggedInViewController *notLoggedInViewController = [[NotLoggedInViewController alloc] initWithNibName:@"NotLoggedInViewController"  bundle:[NSBundle mainBundle]];
//				[self presentModalViewController:notLoggedInViewController animated:YES];
//				[notLoggedInViewController release];
//			}

            if (AppModel.IsLoggedIn)
            {
                SetPapers(null);
            }
            else
            {
                Target.PromptForLogin();
            }
        }
        public override void Register()
        {
            InvokerMap.Add(Target.Filter, HandleFilter);
            InvokerMap.Add(Target.OnTagSelected, HandlerPaperSelected);
            InvokerMap.Add(TagsReceived, (object sender, EventArgs e) => SetTags());

            Target.SearchPlaceHolderText = "Search Tags";

            SetTags();
        }
        public override void Register()
        {
            InvokerMap.Add(PaperDetailsReceived, (object sender, EventArgs e) => SetPaper());

            GetPaperDetails.Invoke();
        }
 public override void Register()
 {
     InvokerMap.Add(Target.OnPaperSelected, HandlerPaperSelected);
     InvokerMap.Add(PapersReceived, (object sender, EventArgs e) => SetPapers(e as PapersReceivedInvokerArgs));
     GetPapersByTag.Invoke(new GetPapersByTagInvokerArgs(Target.SelectedTag));
 }