SDK UI
Overview
Some time ago there was a rationalisation of the UI components offered in the RM .Net SDK, the result of which is that some options that were available in the COM SDK are no longer to be found. For example the ability to view an electronic document via Record.ViewUI no longer exists.
What can you do?
As of RM 8.1 the following UI classes exist in the .Net SDK:
- ObjectSelector,
- PropertyEditor, and
- DesktopHelper
Some Code
The following extracts come form this very simple sample project.
Edit Record Properties
Record record = new Record(_database, 9000000000); if (HP.HPTRIM.SDK.PropertyEditor.EditModal(GetDesktopWindow(), record)) { record.Save(); }
Select Records
TrimMainObjectSearch search = new TrimMainObjectSearch(_database, BaseObjectTypes.Record); search.SelectAll(); TrimMainObjectSearch selectedSearch = ObjectSelector.SelectMany(GetDesktopWindow(), search);
Select Database
DesktopHelper helper = new DesktopHelper(); Database newDatabase = helper.SelectDatabase(GetDesktopWindow(), false, false); if (newDatabase != null) { _database.Dispose(); _database = newDatabase; }
Written on March 7, 2016