void ServiceThreadHandler() { try { Debug.Print("ServiceThreadHandler"); needsShutdown.Reset(); NetInfo.StoreChangedNetworkSettings(); WmiBase.Reset(); Debug.Print("WMI Check"); if (WmiBase.Check()) { starting = true; WmiCapableServiceThreadHandler(); starting = false; running = true; } else { running = false; WaitHandle[] waitHandles = new WaitHandle[] { (new WmiIncapableThread()).Incapable, needsShutdown }; Debug.Print("Waiting for WMI capability to begin"); try { EventLog.WriteEntry(Branding.Instance.getString("BRANDING_errNoWMI")); } catch { }; int activehandle = WaitHandle.WaitAny(waitHandles); Debug.Print("Received event"); if (activehandle == 0) { try { EventLog.WriteEntry(Branding.Instance.getString("BRANDING_errNoWMI")); } catch { }; starting = true; WmiCapableServiceThreadHandler(); starting = false; running = true; } } } catch (Exception e) { HandleException("Main Service Thread", e); } }
void onAddrChange(Object sender, EventArgs e) { try { updateNetworkInfo(); NetInfo.StoreChangedNetworkSettings(); WmiBase.Singleton.Kick(); } catch (System.Management.ManagementException x) { if (x.ErrorCode != ManagementStatus.AccessDenied) { exceptionhandler.HandleException("Network Information", x); } } catch (Exception ex) { exceptionhandler.HandleException("Network Information", ex); } }
public bool Refresh(bool force) { updateNetworkInfo(); NetInfo.StoreChangedNetworkSettings(); return(true); }