Beispiel #1
0
        private bool SetDimensions(FlashControl flash)
        {
            if (selectedAdvertArgs.AdProperties == null)
            {
                return(false);
            }

            string widthProperty  = (string)selectedAdvertArgs.AdProperties[widthKeyPropertyName];
            string heightProperty = (string)selectedAdvertArgs.AdProperties[heightKeyPropertyName];

            int width;
            int height;

            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);
        }
Beispiel #2
0
        private void RenderFlashBanner(HtmlTextWriter writer)
        {
            if (selectedAdvertArgs == null)
            {
                return;
            }

            if (String.IsNullOrEmpty(selectedAdvertArgs.ImageUrl))
            {
                return;
            }

            FlashControl flash = new FlashControl();

            flash.FlashUrl = selectedAdvertArgs.ImageUrl;

            if (!String.IsNullOrEmpty(wmode))
            {
                flash.WMode = wmode;
            }

            if (!String.IsNullOrEmpty(this.ID))
            {
                flash.ID = this.ClientID;
            }

            if (!this.Enabled)
            {
                flash.Enabled = false;
            }

            if (!SetDimensions(flash))
            {
                flash.Width  = this.Width;
                flash.Height = this.Height;
            }

            flash.RenderControl(writer);
        }