private void GetDeviceChannelInfo(Func <string, StringBuilder, int, int> f, ref Channel[] dst, Channel.ChannelType type, ref int indexOffset) { var bufferNames = new StringBuilder(10000); var result = f(Name, bufferNames, bufferNames.Capacity - 1); if (result < 0) { throw new SystemException($"Could not query lines of type {type} for nidaq device " + Name); } var indexCounter = indexOffset; dst = bufferNames.ToString() .Split(',') .Select(s => new Channel(indexCounter++, this, s.Trim(), type)) .ToArray(); indexOffset = indexCounter; }
public static bool IsThread(this Channel.ChannelType type) => type is Channel.ChannelType.GuildPublicThread