Working with System Assemblies of Foresight Analytics Platform

When preparing for development and installing required distributions, the global assembly cache registers system Interop assemblies that allow for working with resources of Foresight Analytics Platform in third-party development environments.

NOTE. Assemblies will be placed to the GAC_MSIL directory. The assemblies that depend on the operating system bitness are placed to the GAC_32 or GAC_64 subdirectory.

For each assembly a folder is created in cache with the following name format: Prognoz.Platform.Interop.<assembly name>. The subdirectory that depends on the operating system bitness contains the Prognoz.Platform.Forms.Net and Prognoz.Platfrom.WInForms.Utils assemblies.

These assemblies can be used in any environment based on the .NET Framework platform. To work with Foresight Analytics Platform assemblies, add a link to the required assembly from the global assembly cache. In import area of the code add a string using syntax of the selected language to import types of the selected assembly. This will allow you to use unqualified identifiers to refer to types.

NOTE. It is not recommended to use Foresight Analytics Platform assemblies, for which there are analogs in .NET Framework, because it may increase application working time due to execution of context swap within assemblies. For example, use System.Xml instead of Prognoz.Platform.Interop.MsXml2 or System.IO instead of Prognoz.Platform.Interop.ForeIO.

The example of a link to the Metabase assembly:

Import contents of the Metabase and ForeSystem assemblies:

using ...; 
using Prognoz.Platform.Interop.Metabase;
using Prognoz.Platform.Interop.ForeSystem;
using ...;

The example of repository connection:

IMetabase Mb;
MetabaseManager manager = (new MetabaseManagerFactoryClass()).Active;
IMetabaseDefinitions defs = manager.Definitions;
defs.ReadFromRegistry();
IMetabaseDefinition MbDef = defs.FindById("TEST_REPOSITORY");
StandardSecurityPackage Package = new StandardSecurityPackageClass();
IPasswordCredentials Credentials = (IPasswordCredentials) Package.CreateCredentials(AuthenticationMode.amPassword);
Credentials.UserName = "User";
Credentials.Password = "Password";
Mb = MbDef.OpenDefault(Credentials);

See also:

Working with C#