 | MatrixDataProviderExtension Class |
Inheritance HierarchySystemObject CTExtensions.InterfacesMatrixDataProviderExtension Namespace: CTExtensions.InterfacesAssembly: CTInterface (in CTInterface.dll) Version: 25.0
Syntaxpublic abstract class MatrixDataProviderExtension : IExtensionInterface
Public MustInherit Class MatrixDataProviderExtension
Implements IExtensionInterface
The MatrixDataProviderExtension type exposes the following members.
Constructors
Methods | Name | Description |
---|
 | GetParent |
Must implement. Return parent CTExtension of this extension interface.
|
 | OverrideMatrixData |
Allows overriding matrix data (Revisions, CustomScopes) for files when the CT Core
is about to read and cache it. Enables custom data sourcing for Revisions and CustomScopes.
|
Top
Example
This example shows how to override Revision (or CustomScope) data with a
CTExtension that
has
MatrixDataProviderExtension capability.
Language: C#
Class name: RevisionsExtension
using ATR.CT.CTInterface;
using CTExtensions;
using CTExtensions.Interfaces;
using CTEngineLib;
using System.Collections.Generic;
using System;
namespace Example
{
public class RevisionsExtension : CTExtension
{
private RevisionProvider moRevisionProvider = null;
public override bool Hook(CTInterface oCTInterface)
{
return false;
}
public override void UnHook(CTInterface oCTInterface)
{
}
public override IExtensionInterface[] GetInterface2(ctExtensionInterface eInterface)
{
if (eInterface == ctExtensionInterface.ctExtensionInterfaceMatrixDataProvider)
{
if (moRevisionProvider == null)
moRevisionProvider = new RevisionProvider(this);
return new[] { moRevisionProvider };
}
return null;
}
class RevisionProvider : MatrixDataProviderExtension
{
RevisionsExtension moParent;
public RevisionProvider(RevisionsExtension parent)
{
moParent = parent;
}
public override ICTExtension GetParent()
{
return moParent;
}
public override bool OverrideMatrixData(string bsFilename, string bsConfiguration, ctPropertyScope eScope, string bsData, ref string pbsOverriddenData)
{
bool bOverride = false;
if (eScope == ctPropertyScope.ctPropertyScopeRevision)
{
var headers = new Dictionary<string, string>(StringComparer.CurrentCultureIgnoreCase)
{
{ "revision", "Revision" },
{ "description", "Description" },
{ "designer", "Approved By" }
};
var data = new MatrixData(headers);
var row = data.AddRow();
row.SetValue("revision", "A");
row.SetValue("description", "Here's Johnny!");
row.SetValue("designer", "Jack Nicholson");
row = data.AddRow();
row.SetValue("revision", "B");
row.SetValue("description", "Say 'hello' to my little friend!");
row.SetValue("designer", "Al Pacino");
row = data.AddRow();
row.SetValue("revision", "C");
row.SetValue("description", "Revision you can't refuse.");
row.SetValue("designer", "Marlon Brando");
pbsOverriddenData = data.ToString();
bOverride = true;
}
return bOverride;
}
}
}
}
Revision HistoryDate | Version | Description |
---|
- | 2022 SP1 | First Release |
See Also