.NET Customisation User Guide

.NET Customisation : How to Write a CAF Addin : The IAddin Interface
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;
#region IAddin Members
public string Description
get
return "Provides a simple attribute browser";
public string Name
get
return "AttributeBrowserAddin";
public void Start(ServiceManager serviceManager)
// Create Addins Windows
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);
// Clear attribute list
// Populate the attribute list with attributes of the current element
foreach (DbAttribute attribute in CurrentElement.Element.GetAttributes())
try
string elAsString = CurrentElement.Element.GetAsString(attribute);
catch (Exception exception)
string excMessage = exception.Message;
public void Stop()
#endregion

1974 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
AVEVA Logo