private void ReadChannel(byte channel) { var reading = readADC_SingleEnded(channel); ChannelChanged?.Invoke(this, new ChannelReadingDone { RawValue = reading, Channel = channel, SlaveAddress = _ads1115.ConnectionSettings.SlaveAddress }); }
public bool Save() { RegistryKey localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); try { RegistryKey subKey = localKey.OpenSubKey(@"SOFTWARE\Microsoft\Office\ClickToRun\Configuration", true); if (subKey == null) { localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); subKey = localKey.OpenSubKey(@"SOFTWARE\Microsoft\Office\ClickToRun\Configuration", true); if (subKey == null) { return(false); } } if (ClickToRunLanguage != null) { subKey.SetValue("ClientCulture", ClickToRunLanguage); } if (UpdateChannel != null) { object h = subKey.GetValue("UpdateChannel"); if (h != null) { string registData = h.ToString().ToLower(); if (registData != UpdateChannel) { RegistryKey tempSubKey = localKey.OpenSubKey(@"SOFTWARE\Microsoft\Office\ClickToRun\Configuration", true); tempSubKey.DeleteValue("UpdateUrl", false); tempSubKey.DeleteValue("UpdateToVersion", false); tempSubKey = localKey.OpenSubKey(@"SOFTWARE\Microsoft\Office\ClickToRun\Updates", true); tempSubKey.DeleteValue("UpdateToVersion", false); } } subKey.SetValue("UpdateChannel", UpdateChannel); subKey.SetValue("CDNBaseUrl", UpdateChannel); } foreach (InstalledProducts item in InstalledProductsList) { subKey.SetValue(item.ProductID + ".EmailAddress", ProductOwner); } subKey.SetValue("UpdateChannelChanged", ChannelChanged.ToString()); return(true); } catch (Exception ex) { throw ex; } finally { localKey.Close(); } }
private void DirectMessageList_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { var selectedItem = ((PrivateChannelViewModel)directMessageList.SelectedItem)?.PrivateChannel; if (directMessageList != null && selectedItem != null) { ChannelChanged?.Invoke(selectedItem); } } catch (Exception exception) { App.LogUnhandledError(exception); } }
/// <summary>Set the channel, using the zero indexed number</summary> /// <param name="channelIndex">A zero based number to switch to</param> public static void SetChannel(uint channelIndex) { var totalChannels = ChannelIndexList.Count; if (channelIndex > totalChannels) { channelIndex = (uint)totalChannels; } if (CurrentChannel != null && CurrentChannelIndex == channelIndex) { return; } LogDebug($"[TVCore] Setting channelIndex to {channelIndex}"); CurrentChannel = Channels.Find(x => x.Index == ChannelIndexList[(int)channelIndex]); CurrentChannelIndex = channelIndex; CurrentChannelProgrammes = Guide.Where(x => x.Channel == CurrentChannel.Id).ToList(); CurrentProgramme = CurrentChannelProgrammes.Find(x => x.Start <DateTime.UtcNow && x.Stop> DateTime.UtcNow); ChannelChanged?.Invoke(channelIndex); }
partial void ProcessEachChannelChanged(ChannelChanged notifies);
private void ExecuteChangeChannelCommand(Channel channel) { ChannelChanged?.Invoke(this, channel); }