PluginFormBase Class

The PluginFormBase class is the base class for plug-in dialogs. The class extends the FormBase class by adding communications with Tekla Structures.
Inheritance Hierarchy

Namespace:  Tekla.Structures.Dialog
Assembly:  Tekla.Structures.Dialog (in Tekla.Structures.Dialog.dll) Version: 2023.0.3
Syntax
public class PluginFormBase : FormBase

The PluginFormBase type exposes the following members.

Constructors
  NameDescription
Public methodPluginFormBase
Runs the FormBase constructor and loads the default .NET localization file (DotNetDialogStrings.ail).
Top
Properties
  NameDescription
Public propertyLocalization
The localization instance for the dialog. Each dialog has its own localization instance that has read the localization files needed for that dialog.
(Inherited from FormBase.)
Public propertyShowInTaskbar
Hides (shadows) the ShowInTaskbar property by setting the property to false.
Top
Methods
  NameDescription
Public methodApplyValues
Loads the dialog values from a file and performs Apply on the loaded values. To match the files to a certain dialog, the file suffix is set as the dialog type's name.
(Inherited from FormBase.)
Public methodGet
Gets the dialog values from the part that is currently selected in Tekla Structures.
Public methodGetConnectionStatus
Returns true if a proper connection to the Tekla Structures process has been established. Currently, there's no way to re-establish the connection.
(Inherited from FormBase.)
Public methodInitializeForm
Prepares the data storage for the dialog and scans through the fields.
(Inherited from FormBase.)
Public methodLoadValues
Loads the dialog values from a file. To match the files to a certain dialog, the file suffix is set as the dialog type's name.
(Inherited from FormBase.)
Public methodModifyValues
Loads the dialog values from a file and performs Modify on the loaded values. To match the files to a certain dialog, the file suffix is set as the dialog type's name.
(Inherited from FormBase.)
Public methodReloadForm
Reloads the dialog values.
Public methodSaveValues
Serializes the dialog values to an xml file.
(Inherited from FormBase.)
Public methodCode exampleSetAttributeValue
Sets a value for the given control. When the dialog is not shown, setting a property directly for a control (such as textBox1.Text = "text") will not work for controls that have a Tekla Structures AttributeTypeName set. This method is going to have to be used to set the value.
(Inherited from FormBase.)
Public methodShowForm
Displays the form.
(Inherited from FormBase.)
Public methodUpdateValues Obsolete.
Rereads and updates all the field values on the form.
(Inherited from FormBase.)
Top
Events
  NameDescription
Public eventAttributesLoadedFromModel
The AttributesLoadedFromModel event is triggered just after the attributes have been loaded from the model into the dialog.
Top
Examples
The following example shows a situation where a class is created by using inheritance from the PluginFormBase. Due to limited space a better example is located in the Open API Start-up Package in Extranet. The name of the example is FormPlugin.
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Tekla.Structures.Datatype;
using Tekla.Structures.Dialog;

public class Example1 : PluginFormBase
{
    private void InitializeComponent()
    {
        this.OkButton = new System.Windows.Forms.Button();
        this.ModifyButton = new System.Windows.Forms.Button();
        this.SuspendLayout();
        // 
        // OkButton
        // 
        this.structuresExtender.SetAttributeName(this.OkButton, null);
        this.structuresExtender.SetAttributeTypeName(this.OkButton, null);
        this.structuresExtender.SetBindPropertyName(this.OkButton, null);
        this.OkButton.Name = "OkButton";
        this.OkButton.Text = "OK";
        this.OkButton.Click += new System.EventHandler(this.OkButton_Click);
        // 
        // ModifyButton
        // 
        this.structuresExtender.SetAttributeName(this.ModifyButton, null);
        this.structuresExtender.SetAttributeTypeName(this.ModifyButton, null);
        this.structuresExtender.SetBindPropertyName(this.ModifyButton, null);
        this.ModifyButton.Name = "ModifyButton";
        this.ModifyButton.Text = "Modify";
        this.ModifyButton.Click += new System.EventHandler(this.ModifyButton_Click);
        // 
        // Example1
        // 
        this.structuresExtender.SetAttributeName(this, null);
        this.structuresExtender.SetAttributeTypeName(this, null);
        this.structuresExtender.SetBindPropertyName(this, null);
        this.Controls.Add(this.ModifyButton);
        this.Controls.Add(this.OkButton);
        this.Name = "Example1";
        this.ResumeLayout(false);
    }

    public Example1()
    {
        InitializeComponent();
    }

    private void OkButton_Click(object sender, EventArgs e)
    {
        this.Apply();
        this.Close();
    }

    private void ModifyButton_Click(object sender, EventArgs e)
    {
        this.Modify();
    }

    private System.Windows.Forms.Button OkButton;
    private System.Windows.Forms.Button ModifyButton;
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next