Ejemplo n.º 1
0
			public MapViewDelegate (StatsLoggMap controller):base()
		   {
				_controller = controller;
		   }
		public StatsFrontpageTableSource(StatsFrontpage controller)
		{
			_controller = controller;
			var section1 = new SectionMapping("", "");
			sections.Add(section1);
			
			section1.Rows.Add(new RowItemMapping {
				Label = Utils.Translate("stats.kills"),
				GetValue = () => {
					return "";
				},
				RowSelected = () => {
					var statScreen = new StatsArter(); 
					_controller.NavigationController.PushViewController(statScreen, true);
				}
			});
			
			section1.Rows.Add(new RowItemMapping {
				Label = Utils.Translate("stats.observed"),
				GetValue = () => {
					return "";
				},
				RowSelected = () => {
					var statScreen = new StatsArter(); 
					statScreen.Tittel =Utils.Translate("stats.observed");
					statScreen.Mode = "Sett";
					_controller.NavigationController.PushViewController(statScreen, true);
				}
			});
			
			section1.Rows.Add(new RowItemMapping {
				Label = Utils.Translate("stats.besthunters"),
				GetValue = () => {
					return "";
				},
				RowSelected = () => {
					var statScreen = new StatsBesteJegere(); 
					_controller.NavigationController.PushViewController(statScreen, true);
				}
			});
			
			section1.Rows.Add(new RowItemMapping {
				Label = Utils.Translate("stats.hitcount"),
				GetValue = () => {
					return "";
				},
				RowSelected = () => {
					var statScreen = new StatsHitrate(); 
					_controller.NavigationController.PushViewController(statScreen, true);
				}
			});
			
			section1.Rows.Add(new RowItemMapping {
				Label = Utils.Translate("stats.map"),
				GetValue = () => {
					return "";
				},
				RowSelected = () => {
					var statScreen = new StatsLoggMap(JaktLoggApp.instance.LoggList); 
					_controller.NavigationController.PushViewController(statScreen, true);
				}
			});
			
			section1.Rows.Add(new RowItemMapping {
				Label = Utils.Translate("stats.timeofday"),
				GetValue = () => {
					return "";
				},
				RowSelected = () => {
					var statScreen = new StatsTimeOfDay(); 
					_controller.NavigationController.PushViewController(statScreen, true);
				}
			});
			
			/*section1.Rows.Add(new RowItemMapping {
				Label = "Treffprosent",
				GetValue = () => {
					return "";
				},
				RowSelected = () => {
					var list = JaktLoggApp.instance.LoggList;
					var shots = list.Sum(l=> l.Skudd);
					var hits = list.Sum(l=> l.Treff);
					var percent = shots > 0 ? Decimal.Round(hits*100/shots) : 0;
						
					var f = string.Format("{0} treff, {1} skudd : {2}% treff", hits, shots, percent);
					var img = string.Format("http://chart.apis.google.com/chart?chs="+graphWidth+"x"+graphHeight+"&cht=p3&chd=t:{0},{1}&chdl=Skudd|Treff", shots, hits);
					var webView = new StatsGenericWebView("Treffprosent", f, "<img src=\""+img+"\" />");
					webView.Title = "Treffprosent";
					_controller.NavigationController.PushViewController(webView, true);
				}
			});*/
			

			
		}
Ejemplo n.º 3
0
		public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
		{
			var row = indexPath.Row;
			var section = indexPath.Section;
			
			if(datelist.Count() <= section)
			{
				var mapView = new StatsLoggMap(_logger);
				_controller.NavigationController.PushViewController(mapView, true);
			}
			else
			{
				var currentLogs = _logger.Where(l => l.Dato.ToNorwegianDateString() == datelist.ElementAt(section));
				var logg = currentLogs.ElementAt(row);
				var loggItemScreen = new LoggItemScreen(logg, screen => {
					_controller.TableView.ReloadData();
				});
				_controller.NavigationController.PushViewController(loggItemScreen, true);
			
			}
		}