Exemple #1
0
		public PatronForm (IEnumerable<Tuple<int, string>> monthlyPrices)
		{
			var bundleId = Foundation.NSBundle.MainBundle.BundleIdentifier;
			prices = monthlyPrices.Select (x => new PatronSubscriptionPrice (bundleId + ".patron.cons." + x.Item1 + "month", x.Item1, x.Item2)).ToArray ();

			var appdel = DocumentAppDelegate.Shared;
			var appName = appdel.App.Name;
			Title = "Support " + appName;

			aboutSection = new PatronAboutSection (appName);
			buySection = new PatronBuySection (prices);

			Sections.Add (aboutSection);
			Sections.Add (buySection);
			#if DEBUG
			Sections.Add (new PatronRestoreSection ());
			Sections.Add (new PatronDeleteSection ());
			#endif
			forceSection = new PatronForceSubscriptionSection (prices);

			isPatron = appdel.Settings.IsPatron;
			endDate = appdel.Settings.PatronEndDate;
			aboutSection.SetPatronage ();
			buySection.SetPatronage ();

			RefreshPatronDataAsync ().ContinueWith (t => {
				if (t.IsFaulted)
					Log.Error (t.Exception);
			});
		}
Exemple #2
0
        public PatronForm(IEnumerable <Tuple <int, string> > monthlyPrices)
        {
            var bundleId = Foundation.NSBundle.MainBundle.BundleIdentifier;

            prices = monthlyPrices.Select(x => new PatronSubscriptionPrice(bundleId + ".patron.cons." + x.Item1 + "month", x.Item1, x.Item2)).ToArray();

            var appdel  = DocumentAppDelegate.Shared;
            var appName = appdel.App.Name;

            Title = "Support " + appName;

            aboutSection = new PatronAboutSection(appName);
            buySection   = new PatronBuySection(prices);

            Sections.Add(aboutSection);
            Sections.Add(buySection);
                        #if DEBUG
            Sections.Add(new PatronRestoreSection());
            Sections.Add(new PatronDeleteSection());
                        #endif
            forceSection = new PatronForceSubscriptionSection(prices);

            isPatron = appdel.Settings.IsPatron;
            endDate  = appdel.Settings.PatronEndDate;
            aboutSection.SetPatronage();
            buySection.SetPatronage();

            RefreshPatronDataAsync().ContinueWith(t => {
                if (t.IsFaulted)
                {
                    Log.Error(t.Exception);
                }
            });
        }
Exemple #3
0
        public TipJarForm(IEnumerable <string> names)
        {
            var bundleId = Foundation.NSBundle.MainBundle.BundleIdentifier;

            prices = names.Select(x => new TipJarPrice(bundleId + ".tip." + x.Replace(' ', '_').ToLowerInvariant(), x)).ToArray();

            var appdel  = DocumentAppDelegate.Shared;
            var appName = appdel.App.Name;

            Title = "Support " + appName;

            aboutSection = new PatronAboutSection(appName);
            buySection   = new PatronBuySection(prices);

            Sections.Add(aboutSection);
            Sections.Add(buySection);
#if DEBUG
            Sections.Add(new TipRestoreSection());
            Sections.Add(new TipDeleteSection());
#endif

            hasTipped = appdel.Settings.HasTipped;
            tipDate   = appdel.Settings.TipDate;
            aboutSection.SetPatronage();
            buySection.SetPatronage();

            RefreshPatronDataAsync().ContinueWith(t => {
                if (t.IsFaulted)
                {
                    Log.Error(t.Exception);
                }
            });
        }