docs.unity.cn
    Show / Hide Table of Contents

    Class IPortEditor

    IPortEditor interface to support port editors.

    Inheritance
    Object
    IPortEditor
    PortEditor<T>
    Namespace: Mechatronics.SystemGraph
    Syntax
    [Serializable]
    public abstract class IPortEditor

    Constructors

    IPortEditor(INodeEditor, Type, String, String, String, Object, PortDirection, FieldExtra, Boolean)

    Initializes a new instance of the IPortEditor class.

    Declaration
    public IPortEditor(INodeEditor owner, Type type, string memberName, string displayName, string tooltip, object dataBind, PortDirection portDirection, FieldExtra fieldRW, bool promiscuous = false)
    Parameters
    Type Name Description
    INodeEditor owner

    The owner.

    Type type

    The type.

    String memberName

    Name of the member.

    String displayName

    The display name.

    String tooltip

    The tooltip.

    Object dataBind

    The data bind.

    PortDirection portDirection

    The port direction.

    FieldExtra fieldRW

    The field extra settings.

    Boolean promiscuous

    if set to true [promiscuous].

    Fields

    _acceptsConnections

    Accept connections when true

    Declaration
    protected bool _acceptsConnections
    Field Value
    Type Description
    Boolean

    _field

    The field type

    Declaration
    protected FieldType _field
    Field Value
    Type Description
    FieldType

    _gMapFnc

    The map of functions according to generics enclosed type.

    Declaration
    protected static Dictionary<Type, IPortEditor.tHandlerDescriptor> _gMapFnc
    Field Value
    Type Description
    Dictionary<Type, IPortEditor.tHandlerDescriptor>

    Properties

    AcceptsConnections

    Gets or sets a value indicating whether [accepts connections].

    Declaration
    public bool AcceptsConnections { get; set; }
    Property Value
    Type Description
    Boolean

    true if [accepts connections]; otherwise, false.

    ChildPorts

    Gets the child ports.

    Declaration
    public List<IPortEditor> ChildPorts { get; }
    Property Value
    Type Description
    List<IPortEditor>

    The child ports.

    DataBind

    Gets the data bind.

    Declaration
    public object DataBind { get; }
    Property Value
    Type Description
    Object

    The data bind.

    Descriptor

    Gets the descriptor.

    Declaration
    public PortDescriptor Descriptor { get; }
    Property Value
    Type Description
    PortDescriptor

    The descriptor.

    DisplayName

    Gets or sets the display name.

    Declaration
    public string DisplayName { get; set; }
    Property Value
    Type Description
    String

    The display name.

    EditorElement

    Gets or sets the editor element.

    Declaration
    public VisualElement EditorElement { get; set; }
    Property Value
    Type Description
    VisualElement

    The editor element.

    Field

    Gets or sets the field.

    Declaration
    public FieldType Field { get; set; }
    Property Value
    Type Description
    FieldType

    The field.

    FieldRW

    Gets or sets the field extra settings.

    Declaration
    public FieldExtra FieldRW { get; }
    Property Value
    Type Description
    FieldExtra

    The field extra settings.

    Guid

    Gets or sets the unique identifier.

    Declaration
    public string Guid { get; set; }
    Property Value
    Type Description
    String

    The unique identifier.

    IsChildPort

    Gets or sets a value indicating whether this instance is child port.

    Declaration
    public bool IsChildPort { get; set; }
    Property Value
    Type Description
    Boolean

    true if this instance is child port; otherwise, false.

    IsInputSlot

    Gets a value indicating whether this instance is input slot.

    Declaration
    public bool IsInputSlot { get; }
    Property Value
    Type Description
    Boolean

    true if this instance is input slot; otherwise, false.

    IsOutputSlot

    Gets a value indicating whether this instance is output slot.

    Declaration
    public bool IsOutputSlot { get; }
    Property Value
    Type Description
    Boolean

    true if this instance is output slot; otherwise, false.

    MemberName

    Gets or sets the name of the member.

    Declaration
    public string MemberName { get; protected set; }
    Property Value
    Type Description
    String

    The name of the member.

    Owner

    Gets the owner.

    Declaration
    public INodeEditor Owner { get; }
    Property Value
    Type Description
    INodeEditor

    The owner.

    PortDirection

    Gets or sets the port direction.

    Declaration
    public PortDirection PortDirection { get; set; }
    Property Value
    Type Description
    PortDirection

    The port direction.

    Promiscuous

    Gets a value indicating whether this IPortEditor is promiscuous.

    Declaration
    public bool Promiscuous { get; }
    Property Value
    Type Description
    Boolean

    true if promiscuous; otherwise, false.

    RootName

    Gets the name of the root.

    Declaration
    public string RootName { get; }
    Property Value
    Type Description
    String

    The name of the root.

    ToolTip

    Gets the tool tip.

    Declaration
    public string ToolTip { get; }
    Property Value
    Type Description
    String

    The tool tip.

    ValueType

    Gets the type of the value.

    Declaration
    public Type ValueType { get; }
    Property Value
    Type Description
    Type

    The type of the value.

    Methods

    ContainsTypeDefinition(Type)

    Determines whether the PortEditor contains a definition for type t.

    Declaration
    public static bool ContainsTypeDefinition(Type t)
    Parameters
    Type Name Description
    Type t

    The t.

    Returns
    Type Description
    Boolean

    true if contains type definition of the specified Type t; otherwise, false.

    DefaultRefreshEditor(IPortEditor, VisualElement, Boolean)

    Default refresh editor handler.

    Declaration
    public static bool DefaultRefreshEditor(IPortEditor self, VisualElement port, bool forceHide)
    Parameters
    Type Name Description
    IPortEditor self

    This instance.

    VisualElement port

    The port.

    Boolean forceHide

    if set to true [force hide].

    Returns
    Type Description
    Boolean

    true if editor refreshed, false otherwise.

    Finalize()

    Finalizer

    Declaration
    protected void Finalize()

    GetPortID()

    Gets the port identifier.

    Declaration
    public virtual long GetPortID()
    Returns
    Type Description
    Int64

    UniqueId of the port.

    IsCompatibleWith(Port, Port, IPortEditor)

    Determines whether port anchor is compatible with the specified candidate port anchor.

    Declaration
    public bool IsCompatibleWith(Port startAnchor, Port candidateAnchor, IPortEditor otherPortDescription)
    Parameters
    Type Name Description
    Port startAnchor

    The start anchor.

    Port candidateAnchor

    The candidate anchor.

    IPortEditor otherPortDescription

    The other port description.

    Returns
    Type Description
    Boolean

    true if compatible; otherwise, false.

    IsCompatibleWithSlotType(Type)

    Determines whether [is compatible with slot type] [the specified input type].

    Declaration
    public virtual bool IsCompatibleWithSlotType(Type inputType)
    Parameters
    Type Name Description
    Type inputType

    Type of the input.

    Returns
    Type Description
    Boolean

    true if [is compatible with slot type] [the specified input type]; otherwise, false.

    IsFieldAllowingEditor(VisualElement)

    Determines whether [is field allowing editor] [the specified port].

    Declaration
    public bool IsFieldAllowingEditor(VisualElement port)
    Parameters
    Type Name Description
    VisualElement port

    The port.

    Returns
    Type Description
    Boolean

    true if [is field allowing editor] [the specified port]; otherwise, false.

    PortValueChange()

    Signal port value change event.

    Declaration
    protected virtual void PortValueChange()

    RefreshEditor(Boolean)

    Refreshes the editor.

    Declaration
    public abstract void RefreshEditor(bool forceHide = false)
    Parameters
    Type Name Description
    Boolean forceHide

    if set to true [force hide].

    RegisterPortEvent()

    Registers the port event.

    Declaration
    protected void RegisterPortEvent()

    SignalDestroy()

    Signals destruction of the PortEditor.

    Declaration
    public void SignalDestroy()

    SpawnEditor(VisualElement)

    Spawns the editor.

    Declaration
    public abstract void SpawnEditor(VisualElement port)
    Parameters
    Type Name Description
    VisualElement port

    The port.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, October 18, 2022
    Terms of use