Пример #1
0
 public override void ApplyToBalloon(ClientBalloon balloon)
 {
     if (balloon.OverlayType == this.OverlayType)
     {
         balloon.OverlayType = OverlayType.White;
     }
     else
     {
         balloon.OverlayType = this.OverlayType;
     }
 }
 public virtual void GenerateTextContent(ClientBalloon balloon)
 {
 }
 public virtual void GenerateCaption(ClientBalloon balloon)
 {
 }
        protected void GenerateQR(ClientBalloon balloon)
        {
            BalloonContentCache cacheEntry = balloon.BalloonContentCache;
            bool imageUpdated = false;
            if ((cacheEntry[CacheType.QRCode] == null) && !String.IsNullOrEmpty(balloon.Url))
            {
                cacheEntry[CacheType.QRCode] = ImageGenerator.GenerateQRCode(balloon.Url);
                imageUpdated = true;
            }

            if (imageUpdated || cacheEntry[CacheType.Content] == null)
            {
                GenerateTextContent(balloon);
            }
        }
        protected void GenerateImage(ClientBalloon balloon)
        {
            BalloonContentCache cacheEntry = balloon.BalloonContentCache;
            bool imageUpdated = false;
            if (cacheEntry[CacheType.WebImage] == null)
            {
                cacheEntry[CacheType.WebImage] = ImageGenerator.GenerateFromWeb(balloon.ImageUrl);
                imageUpdated = true;
            }

            if (imageUpdated || cacheEntry[CacheType.Content] == null)
            {
                GenerateTextContent(balloon);
            }
        }
 protected virtual void Close()
 {
     this.visibleBalloon = null;
     if (OnClose != null) { OnClose(this, null); }
 }
        public void SetBalloon(ClientBalloon balloon)
        {
            visibleBalloon = balloon;

            // When a new visible balloon is set, kick off the initialisation stuff
            if (visibleBalloon != null) { Initialise(); }
        }
Пример #8
0
        protected void GenerateImage(ClientBalloon balloon)
        {
            BalloonContentCache cacheEntry = balloon.BalloonContentCache;
            bool imageUpdated = false;
            if (cacheEntry[CacheType.WebImage] == null)
            {
                try
                {
                    cacheEntry[CacheType.WebImage] = ImageGenerator.GenerateFromWeb(balloon.ImageUrl);
                    imageUpdated = true;
                }
                catch (System.Net.WebException)
                {
                    // ignore errors (no internet connection?), the image will be downloaded later
                }
            }

            if (imageUpdated || cacheEntry[CacheType.Content] == null)
            {
                GenerateTextContent(balloon);
            }
        }
Пример #9
0
 public override void GenerateTextContent(ClientBalloon balloon)
 {
     BalloonContentCache cacheEntry = balloon.BalloonContentCache;
     cacheEntry[CacheType.Content] = HtmlRenderer.RenderContent(balloon);
 }
Пример #10
0
 public override void GenerateCaption(ClientBalloon balloon)
 {
     BalloonContentCache cacheEntry = balloon.BalloonContentCache;
     cacheEntry[CacheType.Caption] = HtmlRenderer.RenderCaption(balloon.Label);
 }