Пример #1
0
 public NativeApiComponent(IHostApplication host, NativeApiLibrary library, String typeName, String componentName)
 {
     _host   = host;
     _object = NativeApiProxy.GetClassObject(library.Module, componentName,
                                             (wcode, source, descr, scode) => _host.Echo("ОШИБКА: " + S(source) + " - " + S(descr), Status(wcode)),
                                             (source, message, data) => _host.Echo("СОБЫТИЕ: " + S(source) + " - " + S(message) + " - " + S(data)),
                                             (status) => _host.Echo("СТАТУС: " + S(status))
                                             );
     DefineType(TypeManager.GetTypeByName(typeName));
 }
Пример #2
0
        public static bool Register(String filepath, String identifier)
        {
            if (_libraries.ContainsKey(identifier))
            {
                return(false);
            }
            var library = new NativeApiLibrary(filepath, identifier);

            if (library.Loaded)
            {
                _libraries.Add(identifier, library);
            }
            return(library.Loaded);
        }