C# 클래스 BrightIdeasSoftware.MappedImageRenderer

This class maps a data value to an image that should be drawn for that value.

It is useful for drawing data that is represented as an enum or boolean.

상속: BaseRenderer
파일 보기 프로젝트 열기: soywiz/cspspemu

공개 메소드들

메소드 설명
Add ( Object value, Object image ) : void

Register the image that should be drawn when our Aspect has the data value.

Boolean ( Object trueImage, Object falseImage ) : MappedImageRenderer

Return a renderer that draw boolean values using the given images

MappedImageRenderer ( ) : System

Make a new empty renderer

MappedImageRenderer ( Object keysAndImages ) : System

Build a renderer from the given array of keys and their matching images

MappedImageRenderer ( Object key, Object image ) : System

Make a new renderer that will show the given image when the given key is the aspect value

MappedImageRenderer ( Object key1, Object image1, Object key2, Object image2 ) : System

Make a new renderer that will show the given images when it receives the given keys

Render ( Graphics g, Rectangle r ) : void

Render our value

TriState ( Object trueImage, Object falseImage, Object nullImage ) : MappedImageRenderer

Return a renderer that draw tristate boolean values using the given images

보호된 메소드들

메소드 설명
RenderCollection ( Graphics g, Rectangle r, ICollection imageSelectors ) : void

Draw a collection of images

RenderOne ( Graphics g, Rectangle r, Object selector ) : void

Draw one image

메소드 상세

Add() 공개 메소드

Register the image that should be drawn when our Aspect has the data value.
public Add ( Object value, Object image ) : void
value Object Value that the Aspect must match
image Object An ImageSelector -- an int, string or image
리턴 void

Boolean() 공개 정적인 메소드

Return a renderer that draw boolean values using the given images
public static Boolean ( Object trueImage, Object falseImage ) : MappedImageRenderer
trueImage Object Draw this when our data value is true
falseImage Object Draw this when our data value is false
리턴 MappedImageRenderer

MappedImageRenderer() 공개 메소드

Make a new empty renderer
public MappedImageRenderer ( ) : System
리턴 System

MappedImageRenderer() 공개 메소드

Build a renderer from the given array of keys and their matching images
public MappedImageRenderer ( Object keysAndImages ) : System
keysAndImages Object An array of key/image pairs
리턴 System

MappedImageRenderer() 공개 메소드

Make a new renderer that will show the given image when the given key is the aspect value
public MappedImageRenderer ( Object key, Object image ) : System
key Object The data value to be matched
image Object The image to be shown when the key is matched
리턴 System

MappedImageRenderer() 공개 메소드

Make a new renderer that will show the given images when it receives the given keys
public MappedImageRenderer ( Object key1, Object image1, Object key2, Object image2 ) : System
key1 Object
image1 Object
key2 Object
image2 Object
리턴 System

Render() 공개 메소드

Render our value
public Render ( Graphics g, Rectangle r ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
리턴 void

RenderCollection() 보호된 메소드

Draw a collection of images
protected RenderCollection ( Graphics g, Rectangle r, ICollection imageSelectors ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
imageSelectors ICollection
리턴 void

RenderOne() 보호된 메소드

Draw one image
protected RenderOne ( Graphics g, Rectangle r, Object selector ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
selector Object
리턴 void

TriState() 공개 정적인 메소드

Return a renderer that draw tristate boolean values using the given images
public static TriState ( Object trueImage, Object falseImage, Object nullImage ) : MappedImageRenderer
trueImage Object Draw this when our data value is true
falseImage Object Draw this when our data value is false
nullImage Object Draw this when our data value is null
리턴 MappedImageRenderer