Working with System Assemblies of Foresight Analytics Platform

On installing Foresight Analytics Platform system Interop assemblies that contain implementation of the Fore.NET language are registered in the global assembly cache.

NOTE. These assemblies are saved to GAC_MSIL subdirectory. The assemblies that depend on the operating system bit count are placed to the GAC_32 or GAC_64 subdirectory.

For each assembly a folder is created in the cache with the following name format: Prognoz.Platform.Interop.<assembly name>. The subdirectory that depends on the operating system bit count contains 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, 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 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 context swap within assemblies. For example, use System.Xml instead of Prognoz.Platform.Interop.MsXml2 or System.IO instead of Prognoz.Platform.Interop.ForeIO.

An example of a link to the Metabase assembly is given below:

Import contents of the Metabase and ForeSystem assemblies:

Using ...;
Using Prognoz.Platform.Interop.Metabase;
Using Prognoz.Platform.Interop.ForeSystem;
Using ...;

Example of repository connection:

IMetabase Mb;

MetabaseManager manager = (new MetabaseManagerFactoryClass()).Active;

IMetabaseDefinitions defs = manager.Definitions;

defs.ReadFromRegistry();

IMetabaseDefinition MbDef = defs.FindById("PPREPOSITORY");

StandardSecurityPackage Package = new StandardSecurityPackageClass();

IPasswordCredentials Credentials = (IPasswordCredentials) Package.CreateCredentials(AuthenticationMode.amPassword);

Credentials.UserName = "PPRepository";

Credentials.Password = "PPRepository";

Mb = MbDef.OpenDefault(Credentials);

See also:

Using Foresight Analytics Platform Resources in Third-Party Applications