.NET Customisation
User Guide
using Aveva.ApplicationFramework;
using Aveva.ApplicationFramework.Presentation;
using Aveva.Core.Presentation;
using Aveva.Core.Database;
namespace Aveva.Core.Samples
public class AttributeBrowserAddin : IAddin
private DockedWindow attributeListWindow;
private AttributeListControl attributeListControl;
public string Description
return "Provides a simple attribute browser";
return "AttributeBrowserAddin";
public void Start(ServiceManager serviceManager)
attributeListControl = new AttributeListControl();
// Create a docked window to host an AttributeListControl
attributeListWindow = windowManager.CreateDockedWindow("Aveva.AttributeBrowser.AttributeList", "Attributes", attributeListControl, DockedPosition.Right);
// Docked windows created at addin start should ensure their layout is saved between sessions.
// Create and register addins commands
ShowAttributeBrowserCommand showCommand = new ShowAttributeBrowserCommand(attributeListWindow);
CurrentElement.CurrentElementChanged += new CurrentElementChangedEventHandler(CurrentElement_CurrentElementChanged);
void CurrentElement_CurrentElementChanged(object sender, CurrentElementChangedEventArgs e)
// Set the window title to the name of the element.
string windowTitle = "Attributes of element " + CurrentElement.Element.GetAsString(DbAttributeInstance.FLNM);
// Populate the attribute list with attributes of the current element
foreach (DbAttribute attribute in CurrentElement.Element.GetAttributes())
string elAsString = CurrentElement.Element.GetAsString(attribute);
catch (Exception exception)
string excMessage = exception.Message;