Gorgon
Show / Hide Table of Contents

Class EditorToolBaseForm

The base form used for krypton tool plug ins.

Inheritance
object
MarshalByRefObject
Component
Control
ScrollableControl
ContainerControl
Form
EditorToolBaseForm
Implements
IDropTarget
ISynchronizeInvoke
IWin32Window
IBindableComponent
IComponent
IDisposable
IContainerControl
Inherited Members
Form.SetVisibleCore(bool)
Form.Activate()
Form.ActivateMdiChild(Form)
Form.AddOwnedForm(Form)
Form.AdjustFormScrollbars(bool)
Form.Close()
Form.CreateControlsInstance()
Form.CreateHandle()
Form.DefWndProc(ref Message)
Form.ProcessMnemonic(char)
Form.CenterToParent()
Form.CenterToScreen()
Form.LayoutMdi(MdiLayout)
Form.OnActivated(EventArgs)
Form.OnBackgroundImageChanged(EventArgs)
Form.OnBackgroundImageLayoutChanged(EventArgs)
Form.OnClosing(CancelEventArgs)
Form.OnClosed(EventArgs)
Form.OnFormClosed(FormClosedEventArgs)
Form.OnCreateControl()
Form.OnDeactivate(EventArgs)
Form.OnEnabledChanged(EventArgs)
Form.OnEnter(EventArgs)
Form.OnFontChanged(EventArgs)
Form.OnHandleCreated(EventArgs)
Form.OnHandleDestroyed(EventArgs)
Form.OnHelpButtonClicked(CancelEventArgs)
Form.OnLayout(LayoutEventArgs)
Form.OnMaximizedBoundsChanged(EventArgs)
Form.OnMaximumSizeChanged(EventArgs)
Form.OnMinimumSizeChanged(EventArgs)
Form.OnInputLanguageChanged(InputLanguageChangedEventArgs)
Form.OnInputLanguageChanging(InputLanguageChangingEventArgs)
Form.OnVisibleChanged(EventArgs)
Form.OnMdiChildActivate(EventArgs)
Form.OnMenuStart(EventArgs)
Form.OnMenuComplete(EventArgs)
Form.OnPaint(PaintEventArgs)
Form.OnResize(EventArgs)
Form.OnDpiChanged(DpiChangedEventArgs)
Form.OnGetDpiScaledSize(int, int, ref Size)
Form.OnRightToLeftLayoutChanged(EventArgs)
Form.OnShown(EventArgs)
Form.OnTextChanged(EventArgs)
Form.ProcessCmdKey(ref Message, Keys)
Form.ProcessDialogKey(Keys)
Form.ProcessDialogChar(char)
Form.ProcessKeyPreview(ref Message)
Form.ProcessTabKey(bool)
Form.RemoveOwnedForm(Form)
Form.Select(bool, bool)
Form.GetScaledBounds(Rectangle, SizeF, BoundsSpecified)
Form.ScaleControl(SizeF, BoundsSpecified)
Form.SetBoundsCore(int, int, int, int, BoundsSpecified)
Form.SetClientSizeCore(int, int)
Form.SetDesktopBounds(int, int, int, int)
Form.SetDesktopLocation(int, int)
Form.Show(IWin32Window)
Form.ShowDialog()
Form.ShowDialog(IWin32Window)
Form.ToString()
Form.UpdateDefaultButton()
Form.OnResizeBegin(EventArgs)
Form.OnResizeEnd(EventArgs)
Form.OnStyleChanged(EventArgs)
Form.ValidateChildren()
Form.ValidateChildren(ValidationConstraints)
Form.WndProc(ref Message)
Form.AcceptButton
Form.ActiveForm
Form.ActiveMdiChild
Form.AllowTransparency
Form.AutoScroll
Form.AutoSize
Form.AutoSizeMode
Form.AutoValidate
Form.BackColor
Form.FormBorderStyle
Form.CancelButton
Form.ClientSize
Form.ControlBox
Form.CreateParams
Form.DefaultImeMode
Form.DefaultSize
Form.DesktopBounds
Form.DesktopLocation
Form.DialogResult
Form.HelpButton
Form.Icon
Form.IsMdiChild
Form.IsMdiContainer
Form.IsRestrictedWindow
Form.KeyPreview
Form.Location
Form.MaximizedBounds
Form.MaximumSize
Form.MainMenuStrip
Form.Menu
Form.MinimumSize
Form.MaximizeBox
Form.MdiChildren
Form.MdiParent
Form.MergedMenu
Form.MinimizeBox
Form.Modal
Form.Opacity
Form.OwnedForms
Form.Owner
Form.RestoreBounds
Form.RightToLeftLayout
Form.ShowInTaskbar
Form.ShowIcon
Form.ShowWithoutActivation
Form.Size
Form.SizeGripStyle
Form.StartPosition
Form.Text
Form.TopLevel
Form.TopMost
Form.TransparencyKey
Form.WindowState
Form.AutoSizeChanged
Form.AutoValidateChanged
Form.HelpButtonClicked
Form.MaximizedBoundsChanged
Form.MaximumSizeChanged
Form.MinimumSizeChanged
Form.Activated
Form.Deactivate
Form.FormClosing
Form.FormClosed
Form.Load
Form.MdiChildActivate
Form.MenuComplete
Form.MenuStart
Form.InputLanguageChanged
Form.InputLanguageChanging
Form.RightToLeftLayoutChanged
Form.Shown
Form.DpiChanged
Form.ResizeBegin
Form.ResizeEnd
ContainerControl.OnAutoValidateChanged(EventArgs)
ContainerControl.OnParentChanged(EventArgs)
ContainerControl.PerformAutoScale()
ContainerControl.Validate()
ContainerControl.Validate(bool)
ContainerControl.AutoScaleDimensions
ContainerControl.AutoScaleFactor
ContainerControl.AutoScaleMode
ContainerControl.BindingContext
ContainerControl.CanEnableIme
ContainerControl.ActiveControl
ContainerControl.CurrentAutoScaleDimensions
ContainerControl.ParentForm
ScrollableControl.ScrollStateAutoScrolling
ScrollableControl.ScrollStateHScrollVisible
ScrollableControl.ScrollStateVScrollVisible
ScrollableControl.ScrollStateUserHasScrolled
ScrollableControl.ScrollStateFullDrag
ScrollableControl.GetScrollState(int)
ScrollableControl.OnMouseWheel(MouseEventArgs)
ScrollableControl.OnRightToLeftChanged(EventArgs)
ScrollableControl.OnPaintBackground(PaintEventArgs)
ScrollableControl.OnPaddingChanged(EventArgs)
ScrollableControl.SetDisplayRectLocation(int, int)
ScrollableControl.ScrollControlIntoView(Control)
ScrollableControl.ScrollToControl(Control)
ScrollableControl.OnScroll(ScrollEventArgs)
ScrollableControl.SetAutoScrollMargin(int, int)
ScrollableControl.SetScrollState(int, bool)
ScrollableControl.AutoScrollMargin
ScrollableControl.AutoScrollPosition
ScrollableControl.AutoScrollMinSize
ScrollableControl.DisplayRectangle
ScrollableControl.HScroll
ScrollableControl.HorizontalScroll
ScrollableControl.VScroll
ScrollableControl.VerticalScroll
ScrollableControl.Scroll
Control.GetAccessibilityObjectById(int)
Control.SetAutoSizeMode(AutoSizeMode)
Control.GetAutoSizeMode()
Control.GetPreferredSize(Size)
Control.AccessibilityNotifyClients(AccessibleEvents, int)
Control.AccessibilityNotifyClients(AccessibleEvents, int, int)
Control.BeginInvoke(Delegate)
Control.BeginInvoke(Delegate, params object[])
Control.BringToFront()
Control.Contains(Control)
Control.CreateAccessibilityInstance()
Control.CreateGraphics()
Control.CreateControl()
Control.DestroyHandle()
Control.DoDragDrop(object, DragDropEffects)
Control.DrawToBitmap(Bitmap, Rectangle)
Control.EndInvoke(IAsyncResult)
Control.FindForm()
Control.GetTopLevel()
Control.RaiseKeyEvent(object, KeyEventArgs)
Control.RaiseMouseEvent(object, MouseEventArgs)
Control.Focus()
Control.FromChildHandle(IntPtr)
Control.FromHandle(IntPtr)
Control.GetChildAtPoint(Point, GetChildAtPointSkip)
Control.GetChildAtPoint(Point)
Control.GetContainerControl()
Control.GetNextControl(Control, bool)
Control.GetStyle(ControlStyles)
Control.Hide()
Control.InitLayout()
Control.Invalidate(Region)
Control.Invalidate(Region, bool)
Control.Invalidate()
Control.Invalidate(bool)
Control.Invalidate(Rectangle)
Control.Invalidate(Rectangle, bool)
Control.Invoke(Delegate)
Control.Invoke(Delegate, params object[])
Control.InvokePaint(Control, PaintEventArgs)
Control.InvokePaintBackground(Control, PaintEventArgs)
Control.IsKeyLocked(Keys)
Control.IsInputChar(char)
Control.IsInputKey(Keys)
Control.IsMnemonic(char, string)
Control.LogicalToDeviceUnits(int)
Control.LogicalToDeviceUnits(Size)
Control.ScaleBitmapLogicalToDevice(ref Bitmap)
Control.NotifyInvalidate(Rectangle)
Control.InvokeOnClick(Control, EventArgs)
Control.OnAutoSizeChanged(EventArgs)
Control.OnBackColorChanged(EventArgs)
Control.OnBindingContextChanged(EventArgs)
Control.OnCausesValidationChanged(EventArgs)
Control.OnContextMenuChanged(EventArgs)
Control.OnContextMenuStripChanged(EventArgs)
Control.OnCursorChanged(EventArgs)
Control.OnDockChanged(EventArgs)
Control.OnForeColorChanged(EventArgs)
Control.OnNotifyMessage(Message)
Control.OnParentBackColorChanged(EventArgs)
Control.OnParentBackgroundImageChanged(EventArgs)
Control.OnParentBindingContextChanged(EventArgs)
Control.OnParentCursorChanged(EventArgs)
Control.OnParentEnabledChanged(EventArgs)
Control.OnParentFontChanged(EventArgs)
Control.OnParentForeColorChanged(EventArgs)
Control.OnParentRightToLeftChanged(EventArgs)
Control.OnParentVisibleChanged(EventArgs)
Control.OnPrint(PaintEventArgs)
Control.OnTabIndexChanged(EventArgs)
Control.OnTabStopChanged(EventArgs)
Control.OnClick(EventArgs)
Control.OnClientSizeChanged(EventArgs)
Control.OnControlAdded(ControlEventArgs)
Control.OnControlRemoved(ControlEventArgs)
Control.OnLocationChanged(EventArgs)
Control.OnDoubleClick(EventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragOver(DragEventArgs)
Control.OnDragLeave(EventArgs)
Control.OnDragDrop(DragEventArgs)
Control.OnGiveFeedback(GiveFeedbackEventArgs)
Control.InvokeGotFocus(Control, EventArgs)
Control.OnGotFocus(EventArgs)
Control.OnHelpRequested(HelpEventArgs)
Control.OnInvalidated(InvalidateEventArgs)
Control.OnKeyDown(KeyEventArgs)
Control.OnKeyPress(KeyPressEventArgs)
Control.OnKeyUp(KeyEventArgs)
Control.OnLeave(EventArgs)
Control.InvokeLostFocus(Control, EventArgs)
Control.OnLostFocus(EventArgs)
Control.OnMarginChanged(EventArgs)
Control.OnMouseDoubleClick(MouseEventArgs)
Control.OnMouseClick(MouseEventArgs)
Control.OnMouseCaptureChanged(EventArgs)
Control.OnMouseDown(MouseEventArgs)
Control.OnMouseEnter(EventArgs)
Control.OnMouseLeave(EventArgs)
Control.OnDpiChangedBeforeParent(EventArgs)
Control.OnDpiChangedAfterParent(EventArgs)
Control.OnMouseHover(EventArgs)
Control.OnMouseMove(MouseEventArgs)
Control.OnMouseUp(MouseEventArgs)
Control.OnMove(EventArgs)
Control.OnQueryContinueDrag(QueryContinueDragEventArgs)
Control.OnRegionChanged(EventArgs)
Control.OnPreviewKeyDown(PreviewKeyDownEventArgs)
Control.OnSizeChanged(EventArgs)
Control.OnChangeUICues(UICuesEventArgs)
Control.OnSystemColorsChanged(EventArgs)
Control.OnValidating(CancelEventArgs)
Control.OnValidated(EventArgs)
Control.RescaleConstantsForDpi(int, int)
Control.PerformLayout()
Control.PerformLayout(Control, string)
Control.PointToClient(Point)
Control.PointToScreen(Point)
Control.PreProcessMessage(ref Message)
Control.PreProcessControlMessage(ref Message)
Control.ProcessKeyEventArgs(ref Message)
Control.ProcessKeyMessage(ref Message)
Control.RaiseDragEvent(object, DragEventArgs)
Control.RaisePaintEvent(object, PaintEventArgs)
Control.RecreateHandle()
Control.RectangleToClient(Rectangle)
Control.RectangleToScreen(Rectangle)
Control.ReflectMessage(IntPtr, ref Message)
Control.Refresh()
Control.ResetMouseEventArgs()
Control.ResetText()
Control.ResumeLayout()
Control.ResumeLayout(bool)
Control.Scale(SizeF)
Control.Select()
Control.SelectNextControl(Control, bool, bool, bool, bool)
Control.SendToBack()
Control.SetBounds(int, int, int, int)
Control.SetBounds(int, int, int, int, BoundsSpecified)
Control.SizeFromClientSize(Size)
Control.SetStyle(ControlStyles, bool)
Control.SetTopLevel(bool)
Control.RtlTranslateAlignment(HorizontalAlignment)
Control.RtlTranslateAlignment(LeftRightAlignment)
Control.RtlTranslateAlignment(ContentAlignment)
Control.RtlTranslateHorizontal(HorizontalAlignment)
Control.RtlTranslateLeftRight(LeftRightAlignment)
Control.RtlTranslateContent(ContentAlignment)
Control.Show()
Control.SuspendLayout()
Control.Update()
Control.UpdateBounds()
Control.UpdateBounds(int, int, int, int)
Control.UpdateBounds(int, int, int, int, int, int)
Control.UpdateZOrder()
Control.UpdateStyles()
Control.OnImeModeChanged(EventArgs)
Control.AccessibilityObject
Control.AccessibleDefaultActionDescription
Control.AccessibleDescription
Control.AccessibleName
Control.AccessibleRole
Control.AllowDrop
Control.Anchor
Control.AutoScrollOffset
Control.LayoutEngine
Control.BackgroundImage
Control.BackgroundImageLayout
Control.Bottom
Control.Bounds
Control.CanFocus
Control.CanRaiseEvents
Control.CanSelect
Control.Capture
Control.CausesValidation
Control.CheckForIllegalCrossThreadCalls
Control.ClientRectangle
Control.CompanyName
Control.ContainsFocus
Control.ContextMenu
Control.ContextMenuStrip
Control.Controls
Control.Created
Control.Cursor
Control.DataBindings
Control.DefaultBackColor
Control.DefaultCursor
Control.DefaultFont
Control.DefaultForeColor
Control.DefaultMargin
Control.DefaultMaximumSize
Control.DefaultMinimumSize
Control.DefaultPadding
Control.DeviceDpi
Control.IsDisposed
Control.Disposing
Control.Dock
Control.DoubleBuffered
Control.Enabled
Control.Focused
Control.Font
Control.FontHeight
Control.ForeColor
Control.Handle
Control.HasChildren
Control.Height
Control.IsHandleCreated
Control.InvokeRequired
Control.IsAccessible
Control.IsMirrored
Control.Left
Control.Margin
Control.ModifierKeys
Control.MouseButtons
Control.MousePosition
Control.Name
Control.Parent
Control.ProductName
Control.ProductVersion
Control.RecreatingHandle
Control.Region
Control.RenderRightToLeft
Control.ResizeRedraw
Control.Right
Control.RightToLeft
Control.ScaleChildren
Control.Site
Control.TabIndex
Control.TabStop
Control.Tag
Control.Top
Control.TopLevelControl
Control.ShowKeyboardCues
Control.ShowFocusCues
Control.UseWaitCursor
Control.Visible
Control.Width
Control.PreferredSize
Control.Padding
Control.ImeMode
Control.ImeModeBase
Control.PropagatingImeMode
Control.BackColorChanged
Control.BackgroundImageChanged
Control.BackgroundImageLayoutChanged
Control.BindingContextChanged
Control.CausesValidationChanged
Control.ClientSizeChanged
Control.ContextMenuChanged
Control.ContextMenuStripChanged
Control.CursorChanged
Control.DockChanged
Control.EnabledChanged
Control.FontChanged
Control.ForeColorChanged
Control.LocationChanged
Control.MarginChanged
Control.RegionChanged
Control.RightToLeftChanged
Control.SizeChanged
Control.TabIndexChanged
Control.TabStopChanged
Control.TextChanged
Control.VisibleChanged
Control.Click
Control.ControlAdded
Control.ControlRemoved
Control.DragDrop
Control.DragEnter
Control.DragOver
Control.DragLeave
Control.GiveFeedback
Control.HandleCreated
Control.HandleDestroyed
Control.HelpRequested
Control.Invalidated
Control.PaddingChanged
Control.Paint
Control.QueryContinueDrag
Control.QueryAccessibilityHelp
Control.DoubleClick
Control.Enter
Control.GotFocus
Control.KeyDown
Control.KeyPress
Control.KeyUp
Control.Layout
Control.Leave
Control.LostFocus
Control.MouseClick
Control.MouseDoubleClick
Control.MouseCaptureChanged
Control.MouseDown
Control.MouseEnter
Control.MouseLeave
Control.DpiChangedBeforeParent
Control.DpiChangedAfterParent
Control.MouseHover
Control.MouseMove
Control.MouseUp
Control.MouseWheel
Control.Move
Control.PreviewKeyDown
Control.Resize
Control.ChangeUICues
Control.StyleChanged
Control.SystemColorsChanged
Control.Validating
Control.Validated
Control.ParentChanged
Control.ImeModeChanged
Component.Dispose()
Component.GetService(Type)
Component.Events
Component.Container
Component.DesignMode
Component.Disposed
MarshalByRefObject.MemberwiseClone(bool)
MarshalByRefObject.GetLifetimeService()
MarshalByRefObject.InitializeLifetimeService()
MarshalByRefObject.CreateObjRef(Type)
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Editor.UI.Views
Assembly: Gorgon.Editor.API.dll
Syntax
public class EditorToolBaseForm : Form, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
Remarks

Developers who use to create tool plug ins for the editor should use this form as the base for their UI. It provides functionality to make setting up and rendering easier, and will perform any necessary clean up on behalf of the developer.

Constructors

| Edit this page View Source

EditorToolBaseForm()

Initializes a new instance of the EditorToolBaseForm class.

Declaration
public EditorToolBaseForm()

Properties

| Edit this page View Source

GraphicsContext

Property to return the graphics context for the application.

Declaration
[Browsable(false)]
protected IGraphicsContext GraphicsContext { get; }
Property Value
Type Description
IGraphicsContext
| Edit this page View Source

IsDesignTime

Property to return whether the form is in designer mode or not.

Declaration
[Browsable(false)]
protected bool IsDesignTime { get; }
Property Value
Type Description
bool
| Edit this page View Source

RenderControl

Property to set or return the control that will receive the rendering output from the swap chain.

Declaration
[Browsable(true)]
public Control RenderControl { get; set; }
Property Value
Type Description
Control
Remarks

This property can only be set through the designer. Setting it at runtime will do nothing.

| Edit this page View Source

Renderer

Property to return the currently active tool renderer.

Declaration
[Browsable(false)]
protected IToolRenderer Renderer { get; }
Property Value
Type Description
IToolRenderer
| Edit this page View Source

SwapChain

Property to return the swap chain for the tool render panel.

Declaration
[Browsable(false)]
protected GorgonSwapChain SwapChain { get; }
Property Value
Type Description
GorgonSwapChain

Methods

| Edit this page View Source

AddRenderer(string, IToolRenderer)

Function to register a new renderer with the view.

Declaration
protected void AddRenderer(string name, IToolRenderer renderer)
Parameters
Type Name Description
string name

The name of the renderer.

IToolRenderer renderer

The renderer to register.

Remarks

Some tool plug ins will require the rendered view to change depending on state. For example, a specific tool is selected and the view needs to switch to a portion of the tool UI. In such cases it is not practical to have a single renderer performing all manner of state changes, so this method provides a means of passing different renderer instances to the view.

Developers of the tool plug ins should register these renderers in the OnSetupGraphics(IGraphicsContext, GorgonSwapChain) method so that the renderers are available right away. Failure to do so can lead to broken rendering.

Exceptions
Type Condition
ArgumentNullException

Thrown when the name, or the renderer parameter is null.

ArgumentEmptyException

Thrown when the name parameter is empty.

ArgumentException

Thrown if a renderer is already registered with the same name.

See Also
IToolRenderer
| Edit this page View Source

Dispose(bool)

Clean up any resources being used.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

true if managed resources should be disposed; otherwise, false.

Overrides
Form.Dispose(bool)
| Edit this page View Source

HasRenderer(string)

Function to determine if a renderer with the specified name is registered.

Declaration
protected bool HasRenderer(string name)
Parameters
Type Name Description
string name

The name of the renderer to evaluate.

Returns
Type Description
bool

true if the renderer is registered, false if not.

| Edit this page View Source

OnAfterRender()

Function called after rendering ends.

Declaration
protected virtual void OnAfterRender()
Remarks

Developers can use this method to perform operations immediately after rendering the tool UI.

| Edit this page View Source

OnBeforeRender()

Function called before rendering begins.

Declaration
protected virtual void OnBeforeRender()
Remarks

Developers can use this method to perform last minute updates prior to rendering the tool UI.

| Edit this page View Source

OnFormClosing(FormClosingEventArgs)

Raises the FormClosing event.

Declaration
protected override void OnFormClosing(FormClosingEventArgs e)
Parameters
Type Name Description
FormClosingEventArgs e

A FormClosingEventArgs that contains the event data.

Overrides
Form.OnFormClosing(FormClosingEventArgs)
| Edit this page View Source

OnLoad(EventArgs)

Raises the Load event.

Declaration
protected override void OnLoad(EventArgs e)
Parameters
Type Name Description
EventArgs e

An EventArgs that contains the event data.

Overrides
Form.OnLoad(EventArgs)
| Edit this page View Source

OnPropertyChanged(string)

Function called when a property was changed on the data context.

Declaration
protected virtual void OnPropertyChanged(string propertyName)
Parameters
Type Name Description
string propertyName

The name of the property that was changed.

Remarks

Developers should override this method when detecting property changes on the data context instead of assigning their own event handlers.

| Edit this page View Source

OnPropertyChanging(string)

Function called when a property is changing on the data context.

Declaration
protected virtual void OnPropertyChanging(string propertyName)
Parameters
Type Name Description
string propertyName

The name of the property that is changing.

Remarks

Developers should override this method when detecting property changes on the data context instead of assigning their own event handlers.

| Edit this page View Source

OnRenderWindowDragDrop(DragEventArgs)

Function to handle a drag drop event on the render control.

Declaration
protected virtual void OnRenderWindowDragDrop(DragEventArgs e)
Parameters
Type Name Description
DragEventArgs e

The event arguments.

Remarks

Tool plug in developers can override this method to handle a drop event when an item is dropped into the rendering area on the view.

| Edit this page View Source

OnRenderWindowDragEnter(DragEventArgs)

Function to handle a drag enter event on the render control.

Declaration
protected virtual void OnRenderWindowDragEnter(DragEventArgs e)
Parameters
Type Name Description
DragEventArgs e

The event arguments.

Remarks

Tool plug in developers can override this method to handle a drag enter event when an item is dragged into the rendering area on the view.

| Edit this page View Source

OnRenderWindowDragOver(DragEventArgs)

Function to handle a drag over event on the render control.

Declaration
protected virtual void OnRenderWindowDragOver(DragEventArgs e)
Parameters
Type Name Description
DragEventArgs e

The event arguments.

Remarks

Tool plug in developers can override this method to handle a drag over event when an item is dragged over the rendering area on the view.

| Edit this page View Source

OnResetDataContext()

Function called when the view should be reset by a null data context.

Declaration
protected virtual void OnResetDataContext()
Remarks

Developers should override this method to return the form back to its original state.

| Edit this page View Source

OnSetDataContext(IEditorTool)

Function to assign the data context to this object.

Declaration
protected void OnSetDataContext(IEditorTool dataContext)
Parameters
Type Name Description
IEditorTool dataContext

The data context to assign.

Remarks

Applications must call this method when setting their own data context. Otherwise, some functionality will not work.

| Edit this page View Source

OnSetupGraphics(IGraphicsContext, GorgonSwapChain)

Function to perform custom graphics set up.

Declaration
protected virtual void OnSetupGraphics(IGraphicsContext graphicsContext, GorgonSwapChain swapChain)
Parameters
Type Name Description
IGraphicsContext graphicsContext

The graphics context for the application.

GorgonSwapChain swapChain

The swap chain used to render into the UI.

Remarks

This method allows tool plug in implementors to setup additional functionality for custom graphics rendering.

Resources created by this method should be cleaned up in the OnShutdownGraphics() method.

See Also
OnShutdownGraphics()
| Edit this page View Source

OnShutdownGraphics()

Function to perform clean up when graphics operations are shutting down.

Declaration
protected virtual void OnShutdownGraphics()
Remarks

Any resources created in the OnSetupGraphics(IGraphicsContext, GorgonSwapChain) method must be disposed of here.

| Edit this page View Source

OnSwitchRenderer(IToolRenderer)

Function called when the renderer is switched.

Declaration
protected virtual void OnSwitchRenderer(IToolRenderer renderer)
Parameters
Type Name Description
IToolRenderer renderer

The current renderer.

| Edit this page View Source

OnUnassignEvents()

Function to unassign events for the data context.

Declaration
protected virtual void OnUnassignEvents()
Remarks

If the developer assigns events to the data context, child data contexts, or other event capable controls, they should unassign the events here to avoid event leakage.

| Edit this page View Source

SetupGraphics(IGraphicsContext, bool)

Function to set up the graphics interface for this window.

Declaration
public void SetupGraphics(IGraphicsContext context, bool allowBackgroundRendering = true)
Parameters
Type Name Description
IGraphicsContext context

The application graphics context provided by the plug in.

bool allowBackgroundRendering

[Optional] true to allow the graphics functionality to render even if the form does not have focus, false to pause rendering.

Remarks

This method will initialize the graphics sub system for the control (if required) so that users may use the Gorgon drawing functionality in their tool plug in. The method should be called immediately after creating the form to reduce any possibility of issues.

Implementors who wish to perform their own graphics initialization may override the OnSetupGraphics(IGraphicsContext, GorgonSwapChain) method for setup, and OnShutdownGraphics() method for clean up.

Prior to calling this method, the RenderControl property must be set or an exception will be thrown.

Exceptions
Type Condition
ArgumentNullException

Thrown when the context parameter is null.

GorgonException

Thrown if the RenderControl property is not set to a non-null value.

| Edit this page View Source

SwitchRenderer(string)

Function to switch to another registered renderer.

Declaration
protected void SwitchRenderer(string name)
Parameters
Type Name Description
string name

The name of the renderer to switch to.

Remarks

Developers will this method to switch between renderer types (if multiple renderers are used) to denote editor state.

Exceptions
Type Condition
ArgumentNullException

Thrown when the name parameter is null.

ArgumentEmptyException

Thrown when the name parameter is empty.

ArgumentException

Thrown if no renderer with the specified name was found.

Implements

IDropTarget
ISynchronizeInvoke
IWin32Window
IBindableComponent
IComponent
IDisposable
IContainerControl

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
GorgonControlExtensions.GetAncestor<T>(Control)
GorgonControlExtensions.GetFirstAncestor<T>(Control)
GorgonControlExtensions.GetForm<T>(Control)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author