Inheritance: UIViewController
		public ExampleListViewController () : base (UITableViewStyle.Grouped, null)
		{

			Root = new RootElement ("Examples");

			var indexList = Path.Combine (NSBundle.MainBundle.BundlePath, "IndexList.json");

			//var json = JArray.Parse (File.ReadAllText (indexList));
			var json = JsonArray.Parse (File.ReadAllText (indexList));

			var titleList = new string[] {
				"ImageRecognition",
				"3dAndImageRecognition",
				"PointOfInterest",
				"ObtainPoiData",
				"BrowsingPois",
				"Video",
				"Demo"
			};


			for (int i = 0; i < titleList.Length; i++)
			{
				var title = titleList [i];

				var indexArr = (JsonArray)json [i];

				var section = new Section (title);

				foreach (var jobj in indexArr)
				{
					var elem = new StyledStringElement (jobj["Title"].ToString().Trim('"'), () =>
					{
						var path = jobj["Path"].ToString().Trim('"');
						var vc = jobj["ViewController"].ToString().Trim('"');
					
						arController = new ARViewController(path, false);
						NavigationController.PushViewController(arController, true);
					});
					section.Add (elem);
				}

				Root.Add (section);
			}
		}
Example #2
0
        void Reload()
        {
            var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "recenturls.json");

            var urls = new List <string> ();

            try { urls.AddRange(File.ReadAllLines(path)); }
            catch { }

            foreach (var url in urls)
            {
                Root [0].Add(new StyledStringElement(url, () =>
                {
                    arController = new ARViewController(url, true);
                    NavigationController.PushViewController(arController, true);
                }));
            }
        }
		void Reload()
		{
			var path = Path.Combine (Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "recenturls.json");

			var urls = new List<string> ();

			try { urls.AddRange (File.ReadAllLines (path)); }
			catch { }

			foreach (var url in urls)
			{
				Root [0].Add (new StyledStringElement (url, () =>
				{
					arController = new ARViewController (url, true);
					NavigationController.PushViewController (arController, true);
				}));
			}
		}
        public ExampleListViewController() : base(UITableViewStyle.Grouped, null)
        {
            Root = new RootElement("Examples");

            var indexList = Path.Combine(NSBundle.MainBundle.BundlePath, "IndexList.json");

            //var json = JArray.Parse (File.ReadAllText (indexList));
            var json = JsonArray.Parse(File.ReadAllText(indexList));

            var titleList = new string[] {
                "ImageRecognition",
                "3dAndImageRecognition",
                "PointOfInterest",
                "ObtainPoiData",
                "BrowsingPois",
                "Video",
                "Demo"
            };


            for (int i = 0; i < titleList.Length; i++)
            {
                var title = titleList [i];

                var indexArr = (JsonArray)json [i];

                var section = new Section(title);

                foreach (var jobj in indexArr)
                {
                    var elem = new StyledStringElement(jobj["Title"].ToString().Trim('"'), () =>
                    {
                        var path = jobj["Path"].ToString().Trim('"');
                        var vc   = jobj["ViewController"].ToString().Trim('"');

                        arController = new ARViewController(path, false);
                        NavigationController.PushViewController(arController, true);
                    });
                    section.Add(elem);
                }

                Root.Add(section);
            }
        }
Example #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            buttonAdd          = new UIBarButtonItem(UIBarButtonSystemItem.Add);
            buttonAdd.Clicked += (sender, e) => {
                var arAdd = new UIAlertView("Load Url", "Enter a Wikitude World URL to Load:", null, "Cancel", "Load");
                arAdd.AlertViewStyle = UIAlertViewStyle.PlainTextInput;

                arAdd.Clicked += (sender2, e2) => {
                    var tf = arAdd.GetTextField(0);

                    var url = tf.Text;

                    var isOk = true;

                    try { var uri = new Uri(url); }
                    catch { isOk = false; }

                    if (isOk)
                    {
                        AddUrl(url);
                        Reload();

                        arController = new ARViewController(url, true);
                        NavigationController.PushViewController(arController, true);
                    }
                };

                arAdd.Show();
            };

            NavigationItem.RightBarButtonItem = buttonAdd;

            Reload();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            buttonAdd = new UIBarButtonItem (UIBarButtonSystemItem.Add);
            buttonAdd.Clicked += (sender, e) => {
                var arAdd = new UIAlertView("Load Url", "Enter a Wikitude World URL to Load:", null, "Cancel", "Load");
                arAdd.AlertViewStyle = UIAlertViewStyle.PlainTextInput;

                arAdd.Clicked += (sender2, e2) => {
                    var tf = arAdd.GetTextField(0);

                    var url = tf.Text;

                    var isOk = true;

                    try { var uri = new Uri(url); }
                    catch { isOk = false; }

                    if (isOk)
                    {
                        AddUrl(url);
                        Reload();

                        arController = new ARViewController (url, true);
                        NavigationController.PushViewController (arController, true);
                    }
                };

                arAdd.Show();
            };

            NavigationItem.RightBarButtonItem = buttonAdd;

            Reload ();
        }