public static SpellerInteropBase CreateInstance() { SpellerInteropBase result = null; bool flag = false; try { result = new WinRTSpellerInterop(); flag = true; } catch (PlatformNotSupportedException) { flag = false; } catch (NotSupportedException) { flag = true; } if (!flag) { try { result = new NLGSpellerInterop(); } catch (Exception ex) when(ex is DllNotFoundException || ex is EntryPointNotFoundException) { return(null); } return(result); } return(result); }
public static SpellerInteropBase CreateInstance() { SpellerInteropBase spellerInterop = null; bool winRTSupport = false; try { spellerInterop = new WinRTSpellerInterop(); winRTSupport = true; } catch (PlatformNotSupportedException) { winRTSupport = false; } catch (NotSupportedException) { // Any other exception besides PlatformNotSupportedException // indicates that WinRT API's are supportable on this OS // platform, but failed to initialize for some reason. winRTSupport = true; } if (!winRTSupport) { try { spellerInterop = new NLGSpellerInterop(); } catch (Exception ex) when (ex is DllNotFoundException || ex is EntryPointNotFoundException) { return(null); } } return(spellerInterop); }