public object GetObject(KnownCOMObject kf, bool comFallback) { try { //TODO: might be better to call _mreFilterBlock.WaitOne with a small value (e.g. 1000) and surface an actionalbe result if it fails so the UI can signal a potentially long running process if (_mreFilterBlock.WaitOne(GetConfiguration().COMConfig.LoadWait)) { _logger.Debug("URCOMLoader is not blocking."); return(this.CreateObjectFromPath(kf.ObjectPath, kf.Clsid, true, comFallback)); } else { _logger.Debug("URCOMLoader is blocking, failed to load object"); return(null); } } catch (COMException ex) { throw ex; } catch (Exception ex) { Console.WriteLine("Could not load {0} - {1}: {2}", kf.Clsid, kf.ObjectPath, ex.Message); return(null); } }
public object GetObject(KnownCOMObject kf, bool comFallback) { try { return(this.CreateObjectFromPath(kf.ObjectPath, kf.Clsid, true, comFallback)); } catch (COMException ex) { throw ex; } catch (Exception ex) { Console.WriteLine("Could not load {0} - {1}: {2}", kf.Clsid, kf.ObjectPath, ex.Message); return(null); } }