Inheritance: BusinessEntityBase, IComparable
Example #1
0
        public FrontView(Verse verse)
        {
            UserInteractionEnabled = true;
            Data = verse;

               	var memorizedImage = Images.HeartRedButton;
                var notMemorizedImage = Images.HeartGreyButton;

            TextArea = new UILabel {
                AutoresizingMask = UIViewAutoresizing.FlexibleWidth,
                BackgroundColor =  UIColor.Clear,
                Font = UIFont.FromName("SourceSansPro-Bold", 22.5f),
                Frame = new RectangleF (0, 0, 475, 300),
                Text = Data.Title,
                TextAlignment = UITextAlignment.Center,
                TextColor = UIColor.DarkGray,
            };

            ImageView = new UIImageView {
                Frame = new RectangleF (430, 260, 30f, 30f),
                UserInteractionEnabled = true
            };

            if (UIScreen.MainScreen.Bounds.Height >= 568f) {
                TextArea.Frame = new RectangleF (0, 0, 568, 300);
                ImageView.Frame = new RectangleF (523, 260, 30f, 30f);
            }

            ImageView.Image = Data.Memorized ? UIImage.FromFile (memorizedImage) : UIImage.FromFile (notMemorizedImage);

            Add (TextArea);
            Add (ImageView);
        }
Example #2
0
 public void RemoveVerse(Verse v)
 {
     database.RemoveItem<Verse> (v);
 }
Example #3
0
 public Verse GetVerse(Verse v)
 {
     return database.GetItem<Verse> (v, v.Id);
 }
Example #4
0
 public void AddVerse(Verse v)
 {
     database.AddItem<Verse> (v);
 }
Example #5
0
 public bool VerseExists(Verse v)
 {
     return database.ItemExists<Verse> (v.Id);
 }
Example #6
0
 public VerseEditDialog(Verse verseToEdit)
     : base("Edit")
 {
     verse = verseToEdit;
 }
		private async void SaveButtonClicked ()
		{
			controller.FirstTourStepCompleted ();

			var nonEmptyVerseReferenceTextField = verseReference.Text.Length != 0;
			if (nonEmptyVerseReferenceTextField) {
				var verse = new Verse {
					Category = Category.Queue,
					Content = "Verse downloading...",
					Memorized = false,
					Title = verseReference.Text,
					Comments = verseComments.Text == "Comments" ? "" : verseComments.Text
				};

				if (Reachability.IsHostReachable ("www.google.com")) {
					try {
						UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;

						if (VersesTableViewController.Current.Verses.Any (item => item.Title == verse.Title))
						{
							new UIAlertView ("Verse Already Exists", "Whoops, this verse is already in your library.", null, "Okay", null).Show();
						}
						else 
						{
							VersesTableViewController.Current.Locked = true;
							var translation = TranslationHelper.GetCurrentTranslationForDownload ();
							verse.Translation = translation;
							verse.Content = await BiblesDotOrg.GetVerseTextWithoutHtmlOrDigitsAsync (verseReference.Text, translation);
							controller.AddVerse (verse);
							VersesTableViewController.Current.Locked = false;
							LocalyticsSession.Shared.TagEvent ("Verse Saved");
						}
					} catch (InvalidVerseException) {
						new UIAlertView ("Invalid Input", "Oops! That verse was not found!", null, "Okay", null).Show ();
					} finally {
						UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
					}
				} else {
					new UIAlertView ("Network Failure", "Oops! Please connect to the internet to download verses.", null, "Okay", null).Show ();
				}
			} else {
				new UIAlertView ("Invalid Input", "Oops! Don't forget to add a verse reference!", null, "Okay", null).Show ();
			}
		}
 public void RemoveVerse(Verse verse)
 {
     Verses.Remove (verse);
     AppDelegate.Current.Database.RemoveVerse (verse);
 }
Example #9
0
 public VerseDetailDialog(Verse data)
     : base(data.Title)
 {
     verse = data;
 }
Example #10
0
 public Verse GetVerse(Verse v)
 {
     return(database.GetItem <Verse> (v, v.Id));
 }
Example #11
0
 public bool VerseExists(Verse v)
 {
     return(database.ItemExists <Verse> (v.Id));
 }
Example #12
0
 public void RemoveVerse(Verse v)
 {
     database.RemoveItem <Verse> (v);
 }
Example #13
0
 public void UpdateVerse(Verse v)
 {
     database.UpdateItem <Verse> (v);
 }
Example #14
0
 public void AddVerse(Verse v)
 {
     database.AddItem <Verse> (v);
 }
Example #15
0
 public void UpdateVerse(Verse v)
 {
     database.UpdateItem<Verse> (v);
 }
 public VerseEditActionSheetDelegate(UIViewController managingController, Verse verse)
 {
     controller = managingController;
     data = verse;
 }
 public void AddVerse(Verse verse)
 {
     Verses.Add (verse);
     AppDelegate.Current.Database.AddVerse (verse);
 }
Example #18
0
 public void PopulateCell(Verse verse)
 {
     VerseReference.Text = verse.Title.ToUpper ();
     VerseContent.Text = verse.Content;
 }
Example #19
0
        public void PopulateCell(Verse v)
        {
            Verse = v;

            TextLabel.Text = v.Title;
        }
Example #20
0
 public static void ShareVerse(UIViewController presentingViewController, Verse verse)
 {
     var text = string.Format ("{0} - {1} via @getversesapp", verse.Content, verse.Title);
     Share (presentingViewController, text);
 }