Exemplo n.º 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);
                }
            });
        }
Exemplo n.º 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);
			});
		}