private bool SetDimensions(FlashControl flash) { int width; int height; if (this.selectedAdvertArgs.AdProperties == null) { return false; } string widthProperty = (string)this.selectedAdvertArgs.AdProperties[this.widthKeyPropertyName].ToString(); string heightProperty = (string)this.selectedAdvertArgs.AdProperties[this.heightKeyPropertyName].ToString(); if (!int.TryParse(widthProperty, out width)) { return false; } if (!int.TryParse(heightProperty, out height)) { return false; } flash.Width = Math.Abs(width); flash.Height = Math.Abs(height); return true; }
private void RenderFlashBanner(HtmlTextWriter writer) { if ((this.selectedAdvertArgs != null) && !string.IsNullOrEmpty(this.selectedAdvertArgs.ImageUrl)) { FlashControl flash = new FlashControl { FlashUrl = this.selectedAdvertArgs.ImageUrl + "?clickTAG=" + this.selectedAdvertArgs.NavigateUrl.Replace("~/Advertiser/",string.Empty) }; if (!string.IsNullOrEmpty(this.wmode)) { flash.WMode = this.wmode; } if (!string.IsNullOrEmpty(this.ID)) { flash.ID = this.ClientID; } if (!this.Enabled) { flash.Enabled = false; } if (!this.SetDimensions(flash)) { flash.Width = this.Width; flash.Height = this.Height; } flash.RenderControl(writer); } }