C# 클래스 MCAEmotiv.GUI.Extensions

Contains useful GUI-related extension methods
파일 보기 프로젝트 열기: madelson/Emotiv-Experimenter

공개 메소드들

메소드 설명
AddContextMenu ( this clb ) : void

Adds a useful context menu to a checked list box

AsyncWaitOnGUIThread ( this condition, System.Action onComplete ) : void

OnComplete will be invoked on the GUI thread when condition is true. This function need not be called from the GUI thread.

Center ( this rectangle ) : Point

The point at the center of the rectangle.

CenteredAround ( this size, Point location ) : Point

Returns the point where this is centered around the location.

ConstrainedTo ( this size, Size container ) : Size

If size fits inside the containing size, the original size is returned. Otherwise, a size is returned that is as large as possible, fits within the container, and has the same aspect ratio as the original size.

DrawArrow ( this graphics, Rectangle area, ArrowType arrowType, double ratio = 1.0/3.0 ) : void

Draws an arrow in the specified rectangle with the specified direction. Ratio is used on recursive calls withing this function to adjust the sizing of bidirectional arrows

DrawFixationCross ( this graphics, Point center ) : void

Draws a fixation cross centered at location

EnableValidation ( this textBox, bool>.Func isValid, System.Action onValidTextEntered = null ) : void

Adds fancy validation logic using isValid to determine the validity of the textbox's content. The onValidTextEntered function, if not null, is called from the TextChanged event only if the new text was valid.

GUIInvoke ( this action ) : void

Invokes the action on the GUI thread if necessary.

IsValid ( this textBox ) : bool

Returns true iff there is no validation function installed for the text box or if the current text value is declared valid by the installed validation function

ReverseTabOrder ( this control ) : void

Reverses the tab order of the control's children.

ToLabel ( this text, DockStyle dockStyle = DockStyle.Top, ContentAlignment align = ContentAlignment.TopLeft, bool autoSize = true ) : Label

Creates a label from text. The default DockStyle is set for usage in a top-down FlowLayoutPanel.

TryLoadImage ( this path, Image &image ) : bool

If Image.FromFile succeeds and the result is not null, returns true and assigns the loaded value to image. Otherwise, image is set to null and false is returned.

비공개 메소드들

메소드 설명
AsyncWaitOnGUIThreadHelper ( this condition, System.Action onComplete ) : void

메소드 상세

AddContextMenu() 공개 정적인 메소드

Adds a useful context menu to a checked list box
public static AddContextMenu ( this clb ) : void
clb this
리턴 void

AsyncWaitOnGUIThread() 공개 정적인 메소드

OnComplete will be invoked on the GUI thread when condition is true. This function need not be called from the GUI thread.
public static AsyncWaitOnGUIThread ( this condition, System.Action onComplete ) : void
condition this
onComplete System.Action
리턴 void

Center() 공개 정적인 메소드

The point at the center of the rectangle.
public static Center ( this rectangle ) : Point
rectangle this
리턴 Point

CenteredAround() 공개 정적인 메소드

Returns the point where this is centered around the location.
public static CenteredAround ( this size, Point location ) : Point
size this
location Point
리턴 Point

ConstrainedTo() 공개 정적인 메소드

If size fits inside the containing size, the original size is returned. Otherwise, a size is returned that is as large as possible, fits within the container, and has the same aspect ratio as the original size.
public static ConstrainedTo ( this size, Size container ) : Size
size this
container System.Drawing.Size
리턴 System.Drawing.Size

DrawArrow() 공개 정적인 메소드

Draws an arrow in the specified rectangle with the specified direction. Ratio is used on recursive calls withing this function to adjust the sizing of bidirectional arrows
public static DrawArrow ( this graphics, Rectangle area, ArrowType arrowType, double ratio = 1.0/3.0 ) : void
graphics this
area System.Drawing.Rectangle
arrowType ArrowType
ratio double
리턴 void

DrawFixationCross() 공개 정적인 메소드

Draws a fixation cross centered at location
public static DrawFixationCross ( this graphics, Point center ) : void
graphics this
center Point
리턴 void

EnableValidation() 공개 정적인 메소드

Adds fancy validation logic using isValid to determine the validity of the textbox's content. The onValidTextEntered function, if not null, is called from the TextChanged event only if the new text was valid.
public static EnableValidation ( this textBox, bool>.Func isValid, System.Action onValidTextEntered = null ) : void
textBox this
isValid bool>.Func
onValidTextEntered System.Action
리턴 void

GUIInvoke() 공개 정적인 메소드

Invokes the action on the GUI thread if necessary.
public static GUIInvoke ( this action ) : void
action this
리턴 void

IsValid() 공개 정적인 메소드

Returns true iff there is no validation function installed for the text box or if the current text value is declared valid by the installed validation function
public static IsValid ( this textBox ) : bool
textBox this
리턴 bool

ReverseTabOrder() 공개 정적인 메소드

Reverses the tab order of the control's children.
public static ReverseTabOrder ( this control ) : void
control this
리턴 void

ToLabel() 공개 정적인 메소드

Creates a label from text. The default DockStyle is set for usage in a top-down FlowLayoutPanel.
public static ToLabel ( this text, DockStyle dockStyle = DockStyle.Top, ContentAlignment align = ContentAlignment.TopLeft, bool autoSize = true ) : Label
text this
dockStyle DockStyle
align ContentAlignment
autoSize bool
리턴 System.Windows.Forms.Label

TryLoadImage() 공개 정적인 메소드

If Image.FromFile succeeds and the result is not null, returns true and assigns the loaded value to image. Otherwise, image is set to null and false is returned.
public static TryLoadImage ( this path, Image &image ) : bool
path this
image Image
리턴 bool