コード例 #1
0
            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;
            }
コード例 #2
0
ファイル: ChannelExtensions.cs プロジェクト: xSke/PluralKit
 public static bool IsThread(this Channel.ChannelType type) =>
 type is Channel.ChannelType.GuildPublicThread