Example #1
0
        public static ChannelEntity CreateChannelEntity(string channelOrChannelGroupName2, bool isAwaitingConnectCallback, bool isChannelGroup, Dictionary <string, object> userState, PNLoggingMethod pnLog)
        {
            string channelOrChannelGroupName = channelOrChannelGroupName2.Trim();

            #if (ENABLE_PUBNUB_LOGGING)
            pnLog.WriteToLog(string.Format("CreateChannelEntity: channelOrChannelGroupName {0}, {1}", channelOrChannelGroupName.ToString(), channelOrChannelGroupName2.ToString()), PNLoggingMethod.LevelInfo);
            #endif

            if (!string.IsNullOrEmpty(channelOrChannelGroupName))
            {
                ChannelIdentity ci = new ChannelIdentity();
                ci.ChannelOrChannelGroupName = channelOrChannelGroupName;
                ci.IsPresenceChannel         = Utility.IsPresenceChannel(channelOrChannelGroupName);
                ci.IsChannelGroup            = isChannelGroup;

                ChannelParameters cp = new ChannelParameters();
                cp.IsAwaitingConnectCallback = isAwaitingConnectCallback;
                cp.UserState = userState;
                ChannelEntity ce = new ChannelEntity(ci, cp);

                return(ce);
            }
            else
            {
                #if (ENABLE_PUBNUB_LOGGING)
                pnLog.WriteToLog(string.Format("CreateChannelEntity: channelOrChannelGroupName empty, is channel group {0}", isChannelGroup.ToString()), PNLoggingMethod.LevelInfo);
                #endif

                return(null);
            }
        }
Example #2
0
 public ChannelEntity(ChannelIdentity channelID, ChannelParameters channelParams)
 {
     this.ChannelID     = channelID;
     this.ChannelParams = channelParams;
 }