// use task to open app http://www.windowsphonegeek.com/articles/6-how-to-use-marketplace-tasks-in-a-wp7-app

        public AppInfoPage()
        {
            InitializeComponent();
            MainPivot.Title = PhoneHelper.GetAppAttribute("Title").ToUpper();
            // txtHelp.Text = "We will continue to roll out new features and your suggestions.";
            txtAppName.Text = PhoneHelper.GetAppAttribute("Title") + " v" + PhoneHelper.GetAppAttribute("Version");
            //" by " + PhoneHelper.GetAppAttribute("Author");
            //   txtVersion.Text = "version " + PhoneHelper.GetAppAttribute("Version");
            txtDescription.Text = PhoneHelper.GetAppAttribute("Description");

            if (App.isPaidVersion == true)
            {
                adControl.Visibility = System.Windows.Visibility.Collapsed;
                //HelpScrollViewer.Height = 535;
                AppsListBox.Height       = 535;
                AboutScrollViewer.Height = 535;
            }
            else
            {
                AdvertiseInfo adInfo = new AdvertiseInfo();
                adControl = new Microsoft.Advertising.Mobile.UI.AdControl(adInfo.ApplicationID, adInfo.AdUnitID, true);
                //HelpScrollViewer.Height = 454;
                AppsListBox.Height       = 454;
                AboutScrollViewer.Height = 454;
            }
        }
Example #2
0
            /**
             * The constructor
             */
            public Ad()
            {
                mAd = new Microsoft.Advertising.Mobile.UI.AdControl();

                //add the event handlers
                mAd.ErrorOccurred += new EventHandler<Microsoft.Advertising.AdErrorEventArgs>(adControlErrorOccurred);
                mAd.IsEngagedChanged += new EventHandler(adControlEngagedChanged);
                mAd.AdRefreshed += new EventHandler(adControlRefreshed);

                mAd.HorizontalAlignment = HorizontalAlignment.Left;
                mAd.VerticalAlignment = VerticalAlignment.Top;
                View = mAd;
            }
Example #3
0
 void desktop_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(APPLICATION_ID) && !string.IsNullOrEmpty(AD_UNIT_ID))
         {
             adControl1 = new Microsoft.Advertising.Mobile.UI.AdControl(APPLICATION_ID, AD_UNIT_ID, true);
         }
         else
         {
             adControl1.Visibility = Visibility.Collapsed;
         }
         try
         {
             IsolatedStorageFile       myIsolatedStorageink = IsolatedStorageFile.GetUserStoreForApplication();
             IsolatedStorageFileStream inkfileStream        = myIsolatedStorageink.OpenFile("myink.txt", FileMode.Open, FileAccess.Read);
             using (StreamReader inkreader = new StreamReader(inkfileStream))
             {
                 this.inkpresentertextbox.Text = inkreader.ReadLine();
             }
         }
         catch
         {
         }
         try
         {
             IsolatedStorageFile       myIsolatedStoragesetting = IsolatedStorageFile.GetUserStoreForApplication();
             IsolatedStorageFileStream fileStream = myIsolatedStoragesetting.OpenFile("mysett2.txt", FileMode.Open, FileAccess.Read);
             using (StreamReader reader = new StreamReader(fileStream))
             {
                 this.settingstextbox.Text = reader.ReadLine();
             }
         }
         catch
         {
         }
     }
     catch
     {
     }
 }
Example #4
0
        public AdControl()
        {
            var ad = new Microsoft.Advertising.Mobile.UI.AdControl(
                Environment.DeviceType == DeviceType.Emulator ? "test_client" : "87589d46-a90e-4053-a2b1-1f9a025b96a1",
                Environment.DeviceType == DeviceType.Emulator ? "Image480_80" : "108107",
                true)
            {
                Width = 480,
                Height = 80,
                IsAutoCollapseEnabled = true,
                CountryOrRegion = RegionInfo.CurrentRegion.TwoLetterISORegionName
            };
            Content = ad;

            #if DEBUG
            if (DesignerProperties.IsInDesignTool) return;
            ad.ErrorOccurred += (sender, args) => { };
            ad.AdRefreshed += (sender, args) => { };
            ad.Loaded += (sender, args) => { };
            #endif
        }
Example #5
0
        private object CreatePubCentertAdControl()
        {
            try
            {
                var pubCenterAdControl = new Microsoft.Advertising.Mobile.UI.AdControl(
                    PubCenterAppId,
                    PubCenterAdUnitId,
                    true); // isAutoRefreshEnabled
                pubCenterAdControl.Width = AdWidth;
                pubCenterAdControl.Height = AdHeight;
                pubCenterAdControl.IsEnabled = !ApplyIsEnabledFix;
                return pubCenterAdControl;
            }
            catch (Exception)
            {
                return new Model.NoneProvider();
            }

        }