예제 #1
0
        /// <summary>Attempts to get a graphic from the given location using this protocol.</summary>
        /// <param name="package">The image request. GotGraphic must be called on this when the protocol is done.</param>
        /// <param name="path">The location of the file to retrieve using this protocol.</param>
        public override void OnGetGraphic(ImagePackage package)
        {
            // Get from cache and apply to package:
            package.Contents = ImageCache.Get(package.location.Path);

            // Ok!
            package.Done();
        }
예제 #2
0
        /// <summary>Attempts to get a graphic from the given location using this protocol.</summary>
        /// <param name="package">The image request. GotGraphic must be called on this when the protocol is done.</param>
        /// <param name="path">The location of the file to retrieve using this protocol.</param>
        public override void OnGetGraphic(ImagePackage package, FilePath path)
        {
            if (path.Filetype == "spa")
            {
                // Grab a runtime SPA:
                package.GotGraphic(SPA.Get(path.Path));
                return;
            }

            package.GotGraphic(ImageCache.Get(path.Path));
        }