Example #1
0
        /// <summary>Sends the request off and defines a callback to run when the result is ready.</summary>
        /// <param name="imageReady">The callback to run when the graphic has been retrieved.
        /// Note that the callback must check if the result is <see cref="PowerUI.ImagePackage.Ok"/>.</param>
        public void Get(OnImageReady imageReady)
        {
            ImageReady += imageReady;

            if (string.IsNullOrEmpty(Url))
            {
                ImageReady(this);
                return;
            }

            // Exception - Is it an animation that has been cached?
            if (File.Filetype == "spa")
            {
                // Might already be loaded - let's check:
                SPA animation = SPA.Get(Url);
                if (animation != null)
                {
                    //It's already been loaded - use that.
                    GotGraphic(animation);
                    return;
                }
            }

            // Do we have a file protocol handler available?
            FileProtocol fileProtocol = File.Handler;

            if (fileProtocol != null)
            {
                fileProtocol.OnGetGraphic(this, File);
            }
        }
		/// <summary>Sends the request off and defines a callback to run when the result is ready.</summary>
		/// <param name="imageReady">The callback to run when the graphic has been retrieved.
		/// Note that the callback must check if the result is <see cref="PowerUI.ImagePackage.Ok"/>.</param>
		public void Get(OnImageReady imageReady){
			ImageReady+=imageReady;
			
			if(string.IsNullOrEmpty(Url)){
				ImageReady(this);
				return;
			}
			
			// Exception - Is it an animation that has been cached?
			if(File.Filetype=="spa"){
				// Might already be loaded - let's check:
				SPA animation=SPA.Get(Url);
				if(animation!=null){
					//It's already been loaded - use that.
					GotGraphic(animation);
					return;
				}
			}
			
			// Do we have a file protocol handler available?
			FileProtocol fileProtocol=File.Handler;
			if(fileProtocol!=null){
				fileProtocol.OnGetGraphic(this,File);
			}
		}