void IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.mContentGrid = (Grid)target; break; case 2: this.mBackground = (CustomPictureBox)target; break; case 3: this.mFrontendPopupControl = (FrontendPopupControl)target; break; case 4: this.mPromotionGrid = (Grid)target; break; case 5: this.mPromotionControl = (PromotionControl)target; break; default: this._contentLoaded = true; break; } }
public PromotionControl() { this.InitializeComponent(); this.PromoControl = this; if (DesignerProperties.GetIsInDesignMode((DependencyObject)this.PromoControl)) { return; } if (!string.IsNullOrEmpty(RegistryManager.Instance.PromotionId) || FeatureManager.Instance.IsPromotionFixed) { this.mPromotionImage.ImageName = Path.Combine(RegistryManager.Instance.ClientInstallDir, "Promotions/promotion.jpg"); this.mPromotionImageGrid.Background = (Brush) new SolidColorBrush(Color.FromArgb(byte.MaxValue, (byte)0, (byte)0, (byte)0)); } this.mBootStringIndex = new Random().Next(this.mBootStrings.Count); this.mBootStringTimer.Tick += new EventHandler(this.BootStringTimer_Tick); this.mBootStringTimer.Interval = 3000; BlueStacksUIBinding.Bind(this.BootText, this.mBootStrings[this.mBootStringIndex], ""); int num = RegistryManager.Instance.AvgBootTime / 500; if (num <= 0) { RegistryManager.Instance.AvgBootTime = 20000; RegistryManager.Instance.NoOfBootCompleted = 0; num = 40; } this.progressTimer.Tick += new EventHandler(this.ProgressTimer_Tick); this.progressTimer.Interval = num; this.progressTimer.Start(); if (PromotionObject.Instance == null) { PromotionObject.LoadDataFromFile(); } PromotionObject.BootPromotionHandler += new EventHandler(this.PromotionControl_BootPromotionHandler); }
private void HandleAnimation(BootPromotion promo) { PromotionControl.AnimateImage(this.mPromotionImage, promo.ImagePath); if (string.IsNullOrEmpty(promo.ButtonText)) { return; } this.mPromoButton.Visibility = Visibility.Visible; this.mPromoButton.Content = (object)promo.ButtonText; }
private void StopSlider() { try { if (!this.mRunPromotion) { return; } this.mRunPromotion = false; if (PromotionControl.sBootPromotionDisplayed == null || !PromotionControl.sBootPromotionDisplayed.Any <KeyValuePair <BootPromotion, int> >()) { return; } Dictionary <BootPromotion, int> bootPromos = PromotionControl.sBootPromotionDisplayed; PromotionControl.sBootPromotionDisplayed = (Dictionary <BootPromotion, int>)null; ThreadPool.QueueUserWorkItem((WaitCallback)(obj => PromotionControl.SendPromotionStats(bootPromos))); } catch (Exception ex) { Logger.Error("Exception aborting thread" + ex.ToString()); } }