public override void OnSectionActivated() { _mcsServices = McsPolicyCheck(); mpCheckBoxStartMPTray.Checked = MPTrayCheck(); RefreshForm(); }
public override void OnSectionActivated() { _mcsServices = McsPolicyCheck(); _dvbVersion = GetDvbhotFixVersion(); _isStreamingOk = IsStreamingPortAvailable(); if (!_isStreamingOk) { CheckWindowsMediaSharingService(); } RefreshForm(); }
private static McsPolicyStatus McsPolicyManipulation(bool checkonly) { const string keyPath = "SOFTWARE\\Policies\\Microsoft\\WindowsMediaCenter"; RegistryKey key = Registry.LocalMachine.OpenSubKey(keyPath, !checkonly); if (checkonly) { if (key != null) { object objValue = key.GetValue("MediaCenter"); key.Close(); if (objValue != null && objValue.ToString() == "1") { _mcsServices = McsPolicyStatus.PolicyInPlace; } } } else { if (_mcsServices == McsPolicyStatus.PolicyInPlace) { key.DeleteValue("MediaCenter"); key.Close(); _mcsServices = McsPolicyStatus.ServicesStopped; } else { if (key == null) { key = Registry.LocalMachine.CreateSubKey(keyPath); } key.SetValue("MediaCenter", "1", RegistryValueKind.DWord); key.Close(); _mcsServices = McsPolicyStatus.PolicyInPlace; } } return(_mcsServices); }
private static McsPolicyStatus McsPolicyManipulation(bool checkonly) { const string keyPath = "SOFTWARE\\Policies\\Microsoft\\WindowsMediaCenter"; RegistryKey key = Registry.LocalMachine.OpenSubKey(keyPath, !checkonly); if (checkonly) { if (key != null) { object objValue = key.GetValue("MediaCenter"); key.Close(); if (objValue != null && objValue.ToString() == "1") { _mcsServices = McsPolicyStatus.PolicyInPlace; } } } else { if (_mcsServices == McsPolicyStatus.PolicyInPlace) { key.DeleteValue("MediaCenter"); key.Close(); _mcsServices = McsPolicyStatus.ServicesStopped; } else { if (key == null) { key = Registry.LocalMachine.CreateSubKey(keyPath); } key.SetValue("MediaCenter", "1", RegistryValueKind.DWord); key.Close(); _mcsServices = McsPolicyStatus.PolicyInPlace; } } return _mcsServices; }