예제 #1
0
        /// <summary>
        /// Attachs to purchase manager.
        /// </summary>
        /// <param name="purchaseManager">Purchase manager.</param>
        public void AttachToPurchaseManager(UIStoryboard Storyboard, InAppPurchaseManager purchaseManager)
        {
            // Save connection to purchase manager
            _Storyboard     = Storyboard;
            PurchaseManager = purchaseManager;

            // Scan sub view controllers
            foreach (UIViewController controller in ChildViewControllers)
            {
                //Console.WriteLine (controller.ToString ());

                // Wireup sub views to the master purchase controller
                if (controller is PurchaseTableViewController)
                {
                    // Found the previous purchase table, save and initialize
                    _purchaseTable = (PurchaseTableViewController)controller;
                    _purchaseTable.AttachToPurchaseManager(_Storyboard, purchaseManager);
                }
                else if (controller is StoreTableViewController)
                {
                    // Found the available products for sale table, save and initialize
                    _storeTable = (StoreTableViewController)controller;
                    _storeTable.AttachToPurchaseManager(_Storyboard, purchaseManager);
                }
                //else if (controller is FeaturesController)
                //{
                //    //// Found special features, save and initialize
                //    //_featuresController = (FeaturesController)controller;
                //    //_featuresController.AttachToPurchaseManager(_Storyboard, purchaseManager);
                //}
                //else if (controller is SettingsController)
                //{
                //    // Found settings, save and initialize
                //    _settingsController = (SettingsController)controller;
                //    _settingsController.AttachToPurchaseManager(_Storyboard, purchaseManager);
                //}
            }
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InAppPurchaseTest.PurchaseTableSource"/> class.
 /// </summary>
 /// <param name="controller">Controller.</param>
 public StoreTableSource(StoreTableViewController controller)
 {
     // Initialize
     _controller = controller;
 }