Ejemplo n.º 1
0
        public override void Load(Stream stream, Format format, Handler handler)
        {
            if (loader != null)
            {
                loader.Dispose();
                loader = null;
            }

            bool loaded     = false;
            var  animFormat = format as AnimatedFormat;

            if (handler != null && !EditMode && Info.AnimationEnabled && animFormat != null)
            {
                if (AnimateView)
                {
                    // use thread to load
                    LoadingAnimated(stream, format, handler);

                    loader = new DocumentThreadLoader(this, handler, stream, format);
                    loaded = true;
                    if (handler != null)
                    {
                        handler.BackgroundLoaded();
                    }
                }
            }
            if (!loaded)
            {
                base.Load(stream, format, handler);
                loaded = true;
            }
        }
Ejemplo n.º 2
0
 public override void Close()
 {
     if (loader != null)
     {
         loader.Dispose();
         loader = null;
     }
 }
Ejemplo n.º 3
0
        protected override void Dispose(bool disposing)
        {
            if (loader != null)
            {
                loader.Dispose();
                //Console.WriteLine ("STOPPED!");
                loader = null;
            }

            base.Dispose(disposing);
        }