/// ------------------------------------------------------------------------------------ /// <summary> /// Gets an instance of a class that serves up lexical entries from a FW database. /// </summary> /// ------------------------------------------------------------------------------------ private void CreateLexEntryServer() { s_assembly = Assembly.GetExecutingAssembly(); // Find a class type in the assembly that implements our desired interface. var type = s_assembly.GetTypes().SingleOrDefault(x => x.GetInterface("IPaLexicalInfo") != null); _lexEntryServer = (IPaLexicalInfo)s_assembly.CreateInstance(type.FullName); if (_lexEntryServer == null) { throw new Exception("Error creating instance of IPaLexicalInfo."); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Gets an instance of a class that serves up lexical entries from a FW database. /// </summary> /// ------------------------------------------------------------------------------------ private void CreateLexEntryServer() { if (!IsFwLoaded) { throw new Exception("FieldWorks is not installed."); } if (FieldWorksAssembly == null) { throw new Exception("Error loading FieldWorks.exe"); } // Find a class type in the assembly that implements our desired interface. var type = s_assembly.GetTypes().SingleOrDefault(x => x.GetInterface("IPaLexicalInfo") != null); _lexEntryServer = (IPaLexicalInfo)s_assembly.CreateInstance(type.FullName); if (_lexEntryServer == null) { throw new Exception("Error creating instance of IPaLexicalInfo."); } }