Last active
August 29, 2015 14:15
-
-
Save cromica/081e3052975416fc8ae7 to your computer and use it in GitHub Desktop.
Sample code on how you can get a file type component builder using SDL Studio Core API - this sample is obtaining the xml template builder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IExtensionPoint extensionPoint = PluginManager.DefaultPluginRegistry.GetExtensionPoint<FileTypeComponentBuilderAttribute>(); | |
foreach (IExtension extension in extensionPoint.Extensions) | |
{ | |
IFileTypeComponentBuilder extensionFileTypeComponentBuilder = (IFileTypeComponentBuilder) extension.CreateInstance(); | |
extensionFileTypeComponentBuilder.FileTypeManager = fileTypeManager; | |
IFileTypeInformation extensionFileTypeInformation = extensionFileTypeComponentBuilder.BuildFileTypeInformation(string.Empty); | |
string extensionFileTypeDefinitionId = extensionFileTypeInformation.FileTypeDefinitionId.Id; | |
FileTypeComponentBuilderAttribute attr = extension.ExtensionAttribute as FileTypeComponentBuilderAttribute; | |
if (Equals(extensionFileTypeDefinitionId, "XML v 1.2.0.0") && attr.IsTemplate) | |
{ | |
//Do something with the file type component builder | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment