Esempio n. 1
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Populate Source List
			SourceList.Initialize ();

			var TableViews = new SourceListItem ("Data Binding Type");
			TableViews.AddItem ("Simple Binding", "shoebox.png", () => {
				ViewType = SubviewType.SimpleBinding;
				PerformSegue("SimpleSegue", this);
			});
			TableViews.AddItem ("Table Binding", "shoebox.png", () => {
				ViewType = SubviewType.TableBinding;
				PerformSegue("TableSegue", this);
			});
			TableViews.AddItem ("Outline Binding", "shoebox.png", () => {
				ViewType = SubviewType.OutlineBinging;
				PerformSegue("OutlineSegue", this);
			});
			TableViews.AddItem ("Collection View", "shoebox.png", () => {
				ViewType = SubviewType.CollectionView;
				PerformSegue("CollectionSegue", this);
			});
			SourceList.AddItem (TableViews);

			// Display Source List
			SourceList.ReloadData();
			SourceList.ExpandItem (null, true);
		}
Esempio n. 2
0
		public override void AwakeFromNib ()
		{
			base.AwakeFromNib ();

			// Populate Source List
			SourceList.Initialize ();

			var TableViews = new SourceListItem ("Control Type");
			TableViews.AddItem ("Buttons", "tag.png", () => {
				DisplaySubview(SubviewType.Buttons);
			});
			TableViews.AddItem ("Checkboxes & Radio Buttons", "tag.png", () => {
				DisplaySubview(SubviewType.CheckAndRadioButtons);
			});
			TableViews.AddItem ("Menu Controls", "tag.png", () => {
				DisplaySubview(SubviewType.MenuControls);
			});
			TableViews.AddItem ("Selection Controls", "tag.png", () => {
				DisplaySubview(SubviewType.SelectionControls);
			});
			TableViews.AddItem ("Indicator Controls", "tag.png", () => {
				DisplaySubview(SubviewType.IndicatorControls);
			});
			TableViews.AddItem ("Text Controls", "tag.png", () => {
				DisplaySubview(SubviewType.TextControls);
			});
			TableViews.AddItem ("Content Views", "tag.png", () => {
				DisplaySubview(SubviewType.ContentViews);
			});
			SourceList.AddItem (TableViews);

			// Display Source List
			SourceList.ReloadData();
			SourceList.ExpandItem (null, true);
		}
Esempio n. 3
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Populate Source List
			SourceList.Initialize ();

			var TableViews = new SourceListItem ("Table Based Views");
			TableViews.AddItem ("Table View", "calendar.png", () => {
				PerformSegue("TableSegue", this);
			});
			TableViews.AddItem ("Outline View", "calendar.png", () => {
				PerformSegue("OutlineSegue", this);
			});
			SourceList.AddItem (TableViews);

			var ImageViews = new SourceListItem ("Photos");
			ImageViews.AddItem ("First Person", "film-roll.png", () => {
				Picture = NSImage.ImageNamed("person01.jpg");
				PerformSegue("PictureSegue", this);
			});
			ImageViews.AddItem ("Second Person", "film-roll.png", () => {
				Picture = NSImage.ImageNamed("person02.jpg");
				PerformSegue("PictureSegue", this);
			});
			ImageViews.AddItem ("Third Person", "film-roll.png", () => {
				Picture = NSImage.ImageNamed("person03.jpg");
				PerformSegue("PictureSegue", this);
			});
			SourceList.AddItem (ImageViews);

			// Display Source List
			SourceList.ReloadData();
			SourceList.ExpandItem (null, true);
		}
Esempio n. 4
0
 /// <summary>
 /// Adds the item.
 /// </summary>
 /// <param name="item">Item.</param>
 public void AddItem(SourceListItem item)
 {
     if (Data != null)
     {
         Data.Items.Add(item);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Raises the item selected.
 /// </summary>
 /// <param name="item">Item.</param>
 internal void RaiseItemSelected(SourceListItem item)
 {
     // Inform caller
     if (this.ItemSelected != null)
     {
         this.ItemSelected(item);
     }
 }
Esempio n. 6
0
		public override void AwakeFromNib ()
		{
			base.AwakeFromNib ();

			// Populate Source List
			SourceList.Initialize ();

			var TableViews = new SourceListItem ("Table Based Views");
			TableViews.AddItem ("Table View", "calendar.png", () => {
				DisplaySubview(new SubviewTableController(), SubviewType.TableView);
			});
			TableViews.AddItem ("Outline View", "calendar.png", () => {
				DisplaySubview(new SubviewOutlineController(), SubviewType.OutlineView);
			});
			SourceList.AddItem (TableViews);

			var ImageViews = new SourceListItem ("Photos");
			ImageViews.AddItem ("First Person", "film-roll.png", () => {
				if (ViewType== SubviewType.ImageView) {
					var Photo = Subview as SubviewImage ;
					Photo.Image = NSImage.ImageNamed("person01.jpg");
				} else {
					var Photo = new SubviewImageController();
					Photo.View.Image = NSImage.ImageNamed("person01.jpg");
					DisplaySubview(Photo, SubviewType.ImageView);
				}
			});
			ImageViews.AddItem ("Second Person", "film-roll.png", () => {
				if (ViewType== SubviewType.ImageView) {
					var Photo = Subview as SubviewImage ;
					Photo.Image = NSImage.ImageNamed("person02.jpg");
				} else {
					var Photo = new SubviewImageController();
					Photo.View.Image = NSImage.ImageNamed("person02.jpg");
					DisplaySubview(Photo, SubviewType.ImageView);
				}
			});
			ImageViews.AddItem ("Third Person", "film-roll.png", () => {
				if (ViewType== SubviewType.ImageView) {
					var Photo = Subview as SubviewImage ;
					Photo.Image = NSImage.ImageNamed("person03.jpg");
				} else {
					var Photo = new SubviewImageController();
					Photo.View.Image = NSImage.ImageNamed("person03.jpg");
					DisplaySubview(Photo, SubviewType.ImageView);
				}
			});
			SourceList.AddItem (ImageViews);

			// Display Source List
			SourceList.ReloadData();
			SourceList.ExpandItem (null, true);
		}
Esempio n. 7
0
		public override void AwakeFromNib ()
		{
			base.AwakeFromNib ();

			// Get access to database
			DatabaseConnection = GetDatabaseConnection ();

			// Wire-up controls
			AddButton.Active = false;
			AddButton.Activated += (sender, e) => {
				// Take action based on type
				switch(ViewType) {
				case SubviewType.TableBinding:
					var controller = SubviewController as SubviewTableBindingController;
					var person = new PersonModel("Unknown","Unknown");
					var sheet = new PersonEditorSheetController(person, true);

					// Wire-up
					sheet.PersonModified += (p) => {
						// Save person to database
						p.Create(DatabaseConnection);
						controller.AddPerson(p);
					};

					// Display sheet
					sheet.ShowSheet(this);
					break;
				case SubviewType.CollectionView:
					var collection = SubviewController as SubviewCollectionViewController;
					var collectionPerson = new PersonModel("Unknown","Unknown");
					var collectionSheet = new PersonEditorSheetController(collectionPerson, true);

					// Wire-up
					collectionSheet.PersonModified += (p) => {
						// Save person to database
						p.Create(DatabaseConnection);
						collection.AddPerson(p);
					};

					// Display sheet
					collectionSheet.ShowSheet(this);
					break;
				}
			};

			EditButton.Active = false;
			EditButton.Activated += (sender, e) => {
				// Take action based on type
				switch(ViewType) {
				case SubviewType.TableBinding:
					var controller = SubviewController as SubviewTableBindingController;
					controller.EditPerson(this);
					break;
				case SubviewType.CollectionView:
					var collection = SubviewController as SubviewCollectionViewController;
					collection.EditPerson(this);
					break;
				}
			};

			DeleteButton.Active = false;
			DeleteButton.Activated += (sender, e) => {
				// Take action based on type
				switch(ViewType) {
				case SubviewType.TableBinding:
					var controller = SubviewController as SubviewTableBindingController;
					controller.DeletePerson(this);
					break;
				case SubviewType.CollectionView:
					var collection = SubviewController as SubviewCollectionViewController;
					collection.DeletePerson(this);
					break;
				}
			};

			Search.Enabled = false;
			Search.EditingEnded += (sender, e) => {
				// Take action based on type
				switch(ViewType) {
				case SubviewType.TableBinding:
					var controller = SubviewController as SubviewTableBindingController;
					controller.FindPerson(Search.StringValue);
					break;
				case SubviewType.CollectionView:
					var collection = SubviewController as SubviewCollectionViewController;
					collection.FindPerson(Search.StringValue);
					break;
				}
			};

			// Populate Source List
			SourceList.Initialize ();

			var TableViews = new SourceListItem ("Direct SQLite");
			TableViews.AddItem ("Simple Binding", "shoebox.png", () => {
				DisplaySubview(new SubviewSimpleBindingController(DatabaseConnection), SubviewType.SimpleBinding);
			});
			TableViews.AddItem ("Table Binding", "shoebox.png", () => {
				DisplaySubview(new SubviewTableBindingController(DatabaseConnection), SubviewType.TableBinding);
			});
			TableViews.AddItem ("Outline Binding", "shoebox.png", () => {
				DisplaySubview(new SubviewOutlineBindingController(DatabaseConnection), SubviewType.OutlineBinging);
			});
			TableViews.AddItem ("Collection View", "shoebox.png", () => {
				DisplaySubview(new SubviewCollectionViewController(DatabaseConnection), SubviewType.CollectionView);
			});
			SourceList.AddItem (TableViews);

			var ORMViews = new SourceListItem ("SQLite.Net ORM");
			ORMViews.AddItem ("Table Binding", "shoebox.png", () => {
				DisplaySubview(new SubviewTableORMController(), SubviewType.TableORM);
			});
			SourceList.AddItem (ORMViews);

			// Display Source List
			SourceList.ReloadData();
			SourceList.ExpandItem (null, true);
		}
Esempio n. 8
0
		/// <summary>
		/// Removes the item.
		/// </summary>
		/// <param name="item">Item.</param>
		public void RemoveItem(SourceListItem item) {
			_items.Remove (item);
		}
Esempio n. 9
0
		/// <summary>
		/// Insert the specified n and item.
		/// </summary>
		/// <param name="n">N.</param>
		/// <param name="item">Item.</param>
		public void Insert(int n, SourceListItem item) {
			_items.Insert (n, item);
		}
Esempio n. 10
0
		/// <summary>
		/// Adds the item.
		/// </summary>
		/// <param name="item">Item.</param>
		public void AddItem(SourceListItem item) {
			_items.Add (item);
		}
Esempio n. 11
0
 /// <summary>
 /// Removes the item.
 /// </summary>
 /// <param name="item">Item.</param>
 public void RemoveItem(SourceListItem item)
 {
     _items.Remove(item);
 }
Esempio n. 12
0
 /// <summary>
 /// Insert the specified n and item.
 /// </summary>
 /// <param name="n">N.</param>
 /// <param name="item">Item.</param>
 public void Insert(int n, SourceListItem item)
 {
     _items.Insert(n, item);
 }
Esempio n. 13
0
 /// <summary>
 /// Adds the item.
 /// </summary>
 /// <param name="item">Item.</param>
 public void AddItem(SourceListItem item)
 {
     _items.Add(item);
 }
Esempio n. 14
0
		/// <summary>
		/// Adds the item.
		/// </summary>
		/// <param name="item">Item.</param>
		public void AddItem(SourceListItem item) {
			if (Data != null) {
				Data.Items.Add (item);
			}
		}
Esempio n. 15
0
		/// <summary>
		/// Raises the item selected.
		/// </summary>
		/// <param name="item">Item.</param>
		internal void RaiseItemSelected(SourceListItem item) {
			// Inform caller
			if (this.ItemSelected != null) {
				this.ItemSelected (item);
			}
		}