internal static ServerTextChannel CreateFromJson(ChannelJson json, [CanBeNull] object state)
 {
     return((ServerTextChannel)ChannelUtils.CreateFromJson(json, state) ?? throw new ArgumentOutOfRangeException(nameof(json), "Incorrect JSON type."));
 }
Exemple #2
0
 internal DirectMessageTextChannel(ChannelJson json, ulong ogId) : base(json, ogId)
 {
 }
 internal ServerTextChannel(ChannelJson json, ulong ogId) : base(json, ogId)
 {
     _oldPins = null;
     _opMutex = new SemaphoreSlim(1);
 }
Exemple #4
0
 public static void PopulateInstance(IChannel obj, ChannelJson json, [CanBeNull] object state)
 {
     Switch(json, state, (json2, state2) => TextChannel.Populate((TextChannel)obj, json2, state2), (json2, state2) => TextChannel.Populate((TextChannel)obj, json2, state2), (json2, state2) => ChannelCategory.Populate((ChannelCategory)obj, json2, state2));
 }
Exemple #5
0
 public static void Switch(ChannelJson json, [CanBeNull] object state, Action <ChannelJson, object> serverText, Action <ChannelJson, object> directMessageText, Action <ChannelJson, object> serverCategory)
 {
     Switch(json, state, WrapAction(serverText), WrapAction(directMessageText), WrapAction(serverCategory));
 }
Exemple #6
0
 public static T Switch <T>(ChannelJson json, [CanBeNull] object state, Func <ChannelJson, object, T> serverText, Func <ChannelJson, object, T> directMessageText, Func <ChannelJson, object, T> serverCategory)
 {
     return(Switch(json.type, state, json, serverText, directMessageText, serverCategory));
 }
Exemple #7
0
 internal abstract void Populate(ChannelJson json, [CanBeNull] object state);
Exemple #8
0
 // Don't call these from outside derived classes
 internal static void Populate(TextChannel obj, ChannelJson json, [CanBeNull] object state)
 {
     obj.Populate(json, state);
 }