STK AgUtPluginSend comments on this topic.
GetPluginConfig Method (IAgUtPluginConfig)
See Also
pAttrBuilder
This object is used to build a container for the plugin's configurable parameters.
Windows





Windows & Linux

Description

Get an attribute container of the configuration settings.

Syntax

[Visual Basic .NET]
Public Function GetPluginConfig( _
    ByVal pAttrBuilder As IAgAttrBuilder _
) As Object
[C#]
public Object GetPluginConfig(
    IAgAttrBuilder pAttrBuilder
);
[Managed C++]
public: IUnknown^ GetPluginConfig(
    IAgAttrBuilder ^ pAttrBuilder
);
[Unmanaged C++]
public: HRESULT GetPluginConfig(
    IAgAttrBuilder * pAttrBuilder,
    IUnknown ** ppDispScope
);
[Java]
public Object getPluginConfig(
    IAgAttrBuilder pAttrBuilder
);

Parameters

pAttrBuilder
This object is used to build a container for the plugin's configurable parameters.

Return Type

The plugin should return the container that is built. See IAgAttrBuilder.

Remarks

This call is made by the application on the plugin component, during user configuration of the plugin's parameters, using the application user interface. The component will be given the IAgAttrBuilder argument so that it can declare its configurable parameters, if any.

See Also

Example

Add an Attribute that provides a combobox of values from which the user can choose.
[C#]
//Add the following code to your plugin
public object Choice { get; set; }
public object[] Choices = new object[4] { "0", "1", "2", "3" };


public object GetPluginConfig(AGI.Attr.AgAttrBuilder pAttrBuilder)
{
    if (m_AgAttrScope == null)
    {
        m_AgAttrScope = pAttrBuilder.NewScope();
        pAttrBuilder.AddChoicesDispatchProperty(m_AgAttrScope, "Choice", "A property", "Choice", Choices);
    }

    return m_AgAttrScope;
}
Add an Attribute that provides a combobox of values populated by a function from which the user can choose.
[C#]
//Add the following code to your plugin
public object Choice { get; set; }
public object[] Choices
{
    get
    {
        return new object[4] { "0", "1", "2", "3" };
    }
}


public object GetPluginConfig(AGI.Attr.AgAttrBuilder pAttrBuilder)
{
    if (m_AgAttrScope == null)
    {
        m_AgAttrScope = pAttrBuilder.NewScope();
        pAttrBuilder.AddChoicesFuncDispatchProperty(m_AgAttrScope, "Choice", "A property", "Choice", "Choices");
    }

    return m_AgAttrScope;
}
Add an Attribute that provides a combobox of values from which the user can choose.
[Visual Basic .NET]
'Add the following code to your plugin
Public _choice As Object
Public Property Choice() As Object Implements IExample1.Choice
    Get
        Return _choice
    End Get
    Set(ByVal value As Object)
        _choice = value
    End Set
End Property
Public Choices() As Object = New Object(3) {"0", "1", "2", "3"}


Public Function GetPluginConfig(ByVal pAttrBuilder As AGI.Attr.AgAttrBuilder) As Object Implements IAgUtPluginConfig.GetPluginConfig
    If m_AgAttrScope = Nothing Then
        m_AgAttrScope = pAttrBuilder.NewScope()
        pAttrBuilder.AddChoicesDispatchProperty(m_AgAttrScope, "Choice", "A property", "Choice", Choices)
    End If

    Return m_AgAttrScope
End Function
Add an Attribute that provides a combobox of values populated by a function from which the user can choose.
[Visual Basic .NET]
'Add the following code to your plugin
      Public _choice As Object
      Public Property Choice() As Object Implements IExample2.Choice
          Get
              Return _choice
          End Get
          Set(ByVal value As Object)
              _choice = value
          End Set
      End Property
      Public ReadOnly Property Choices() As Object() Implements IExample2.Choices
          Get
              Return New Object(3) {"0", "1", "2", "3"}
          End Get
      End Property


Public Function GetPluginConfig(ByVal pAttrBuilder As AGI.Attr.AgAttrBuilder) As Object Implements IAgUtPluginConfig.GetPluginConfig
    If m_AgAttrScope = Nothing Then
        m_AgAttrScope = pAttrBuilder.NewScope()
        pAttrBuilder.AddChoicesFuncDispatchProperty(m_AgAttrScope, "Choice", "A property", "Choice", "Choices")
    End If

    Return m_AgAttrScope
End Function
© 2024 Analytical Graphics, Inc. All Rights Reserved.