Search Results for

    Show / Hide Table of Contents

    Class ModelToolWindowController

    An base controller for any view that is purely hosted within a tool window (see https://help.lemonedge.com/tool-windows/) and works against a ToolWindowItem

    Inheritance
    object
    ModelViewController
    ModelToolWindowController
    AuditHistory
    EntityTabOrSelectedItemView
    LayoutDesigner
    Implements
    IModelViewController
    IHasToggleStatus
    IDisposable
    Inherited Members
    ModelViewController.InitAsync()
    ModelViewController.GetCurrentDisplayedItem(object)
    ModelViewController.Redisplay()
    ModelViewController.Clear()
    ModelViewController.CloseController()
    ModelViewController.OnTrackedItemChanged(object, string)
    ModelViewController.GetCanWrite(object)
    ModelViewController.ShouldDisplayItem(object)
    ModelViewController.RemoveHandlers(object)
    ModelViewController.AddHandlers(object)
    ModelViewController.RemoveCommand(ViewCommand)
    ModelViewController.RemoveCommands<TOfType>()
    ModelViewController.InsertCommand(ViewCommand, int)
    ModelViewController.InsertCommand(ViewCommand, ViewCommand, ViewCommand)
    ModelViewController.UpdateAllCommands()
    ModelViewController.GetNestedViews()
    ModelViewController.RootController
    ModelViewController.ServiceContext
    ModelViewController.UIContext
    ModelViewController.CanWrite
    ModelViewController.ListenToChanges
    ModelViewController.TrackChanges
    ModelViewController.CheckIsLockedForCanWrite
    ModelViewController.DisplayIfNull
    ModelViewController.CurrentDisplayedItem
    ModelViewController.View
    ModelViewController.Commands
    ModelViewController.ContextHelpURL
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Client.Core.Views.Core
    Assembly: LemonEdge.ClientCore.dll
    Syntax
    public abstract class ModelToolWindowController : ModelViewController, IModelViewController, IHasToggleStatus, IDisposable

    Constructors

    ModelToolWindowController(IModelView)

    Creates a new ModelToolWindowController

    Declaration
    public ModelToolWindowController(IModelView view)
    Parameters
    Type Name Description
    IModelView view

    The view this controller works with

    Properties

    CurrentDisplayedLayout

    The current active layout this tool window is operating against

    Declaration
    protected IModelLayoutDisplayer CurrentDisplayedLayout { get; }
    Property Value
    Type Description
    IModelLayoutDisplayer

    CurrentToolWindowItem

    The tool window item this layout is displaying

    Declaration
    protected ToolWindowItem CurrentToolWindowItem { get; }
    Property Value
    Type Description
    ToolWindowItem

    IsToggled

    If toggled, indicates this view is working against the selected item wthin a grid of the currently active layout displayer. Otherwise it is just working against the main item of the layout displayer itself.

    Declaration
    public bool IsToggled { get; }
    Property Value
    Type Description
    bool

    SelectedItemForSubViews

    The currently active IModelLayoutDisplayer main displayed item, or the selected grid item within it

    Declaration
    public override object SelectedItemForSubViews { get; }
    Property Value
    Type Description
    object
    Overrides
    ModelViewController.SelectedItemForSubViews

    TrackLayoutTabChanging

    Indicates this view needs to track the current active tab of the layout this tool window is working against.

    This is required for view based tool windows such as the LayoutDesigner

    The default value is false

    Declaration
    protected virtual bool TrackLayoutTabChanging { get; }
    Property Value
    Type Description
    bool

    TrackViewSelectedItems

    Indicates this view should have a command that allows the user to switch between the tool window working against the item of the currently active IModelLayoutDisplayer, or the selected grid item within it

    The default value is false

    Declaration
    protected virtual bool TrackViewSelectedItems { get; }
    Property Value
    Type Description
    bool

    Methods

    AddHandlers(IModelLayoutDisplayer)

    Adds the handlers for tracking TrackLayoutTabChanging and TrackViewSelectedItems options

    Declaration
    protected virtual void AddHandlers(IModelLayoutDisplayer item)
    Parameters
    Type Name Description
    IModelLayoutDisplayer item

    The currently active layout this tool window is working against

    DisplayItem(object)

    Tracks any required events on the active layout specified from TrackViewSelectedItems and TrackLayoutTabChanging

    Declaration
    public override Task DisplayItem(object item)
    Parameters
    Type Name Description
    object item

    The current ToolWindowItem being displayed against this view

    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    Overrides
    ModelViewController.DisplayItem(object)

    DisplayToolWindow(object)

    Must be implemented by the inheriting controller to display the associated view

    Declaration
    public abstract Task DisplayToolWindow(object item)
    Parameters
    Type Name Description
    object item

    The current item against the active layout, or selected grid item within the layout, this tool window is working against

    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    DisplayUI()

    Calls DisplayToolWindow(object) with the appropriate current active layout item, or grid item within the active layout (if TrackViewSelectedItems has been toggled by the yser)

    Declaration
    public override sealed Task DisplayUI()
    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    Overrides
    ModelViewController.DisplayUI()

    Dispose()

    Declaration
    public void Dispose()

    Dispose(bool)

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

    InitCommands(IList<ViewCommand>)

    If TrackViewSelectedItems is true this adds a tool window command that toggles between this view working against the item of the currently active IModelLayoutDisplayer, or the selected grid item within it

    Declaration
    protected override void InitCommands(IList<ViewCommand> commands)
    Parameters
    Type Name Description
    IList<ViewCommand> commands

    The current list of commands for this view

    Overrides
    ModelViewController.InitCommands(IList<ViewCommand>)

    OnTabChanged(IModelLayoutDisplayerController, LayoutTabChangedEventArgs)

    Is called when the current tab against the currently active layout has been changed by the user

    Only called if TrackLayoutTabChanging is true

    Declaration
    protected virtual void OnTabChanged(IModelLayoutDisplayerController source, LayoutTabChangedEventArgs e)
    Parameters
    Type Name Description
    IModelLayoutDisplayerController source

    The active layout displayer this tool window view is working against

    LayoutTabChangedEventArgs e

    The arguments of the tab that has changed

    OnViewItemChanged(IModelLayoutDisplayerController, LayoutSubViewItemChangedEventArgs)

    Is called when the currently active layout displayer has a view within it that has selected a different item to work against (typically a IBaseGrid view)

    Only called if TrackViewSelectedItems is true

    Declaration
    protected virtual void OnViewItemChanged(IModelLayoutDisplayerController source, LayoutSubViewItemChangedEventArgs e)
    Parameters
    Type Name Description
    IModelLayoutDisplayerController source

    The owning layout displayer this view is contained within

    LayoutSubViewItemChangedEventArgs e

    The sub item changed event args detailing the newly selected item within a view

    RemoveHandlers(IModelLayoutDisplayer)

    Removes the handlers for tracking TrackLayoutTabChanging and TrackViewSelectedItems options

    Declaration
    protected virtual void RemoveHandlers(IModelLayoutDisplayer item)
    Parameters
    Type Name Description
    IModelLayoutDisplayer item

    The currently active layout this tool window is working against

    ToggleViewingViewSelectedItems()

    Toggles between this view working against the current main item of the current active layout and the selected item within a grid within the layout itself

    Declaration
    public void ToggleViewingViewSelectedItems()

    ViewSelectedItemsUpdate(bool)

    Called whenever the user toggles between viewing the selected items within a grid row, and the item for the layout itself

    Declaration
    public virtual void ViewSelectedItemsUpdate(bool viewingSelectedItem)
    Parameters
    Type Name Description
    bool viewingSelectedItem

    Indicates if the toolwindow is viewing selected items in a grid or not

    Events

    ToggleChanged

    Indicates the user has toggled between this view working against the current main item of the current active layout and the selected item within a grid within the layout itself

    Declaration
    public event EventHandler<EventArgs> ToggleChanged
    Event Type
    Type Description
    EventHandler<EventArgs>

    Implements

    IModelViewController
    IHasToggleStatus
    IDisposable

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.