Exemple #1
0
 public ChannelGroups(ChannelGroups other) : this(msclPINVOKE.new_ChannelGroups__SWIG_1(ChannelGroups.getCPtr(other)), true)
 {
     if (msclPINVOKE.SWIGPendingException.Pending)
     {
         throw msclPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #2
0
 public ChannelGroupsEnumerator(ChannelGroups collection)
 {
     collectionRef = collection;
     currentIndex  = -1;
     currentObject = null;
     currentSize   = collectionRef.Count;
 }
Exemple #3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (UID != null)
         {
             hashCode = hashCode * 59 + UID.GetHashCode();
         }
         if (Label != null)
         {
             hashCode = hashCode * 59 + Label.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Category != null)
         {
             hashCode = hashCode * 59 + Category.GetHashCode();
         }
         if (Listed != null)
         {
             hashCode = hashCode * 59 + Listed.GetHashCode();
         }
         if (SupportedBridgeTypeUIDs != null)
         {
             hashCode = hashCode * 59 + SupportedBridgeTypeUIDs.GetHashCode();
         }
         if (Bridge != null)
         {
             hashCode = hashCode * 59 + Bridge.GetHashCode();
         }
         if (Channels != null)
         {
             hashCode = hashCode * 59 + Channels.GetHashCode();
         }
         if (ChannelGroups != null)
         {
             hashCode = hashCode * 59 + ChannelGroups.GetHashCode();
         }
         if (ConfigParameters != null)
         {
             hashCode = hashCode * 59 + ConfigParameters.GetHashCode();
         }
         if (ParameterGroups != null)
         {
             hashCode = hashCode * 59 + ParameterGroups.GetHashCode();
         }
         if (Properties != null)
         {
             hashCode = hashCode * 59 + Properties.GetHashCode();
         }
         if (ExtensibleChannelTypeIds != null)
         {
             hashCode = hashCode * 59 + ExtensibleChannelTypeIds.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #4
0
 public void SetRange(int index, ChannelGroups values)
 {
     msclPINVOKE.ChannelGroups_SetRange(swigCPtr, index, ChannelGroups.getCPtr(values));
     if (msclPINVOKE.SWIGPendingException.Pending)
     {
         throw msclPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #5
0
        public ChannelGroups channelGroups()
        {
            ChannelGroups ret = new ChannelGroups(msclPINVOKE.NodeFeatures_channelGroups(swigCPtr), true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #6
0
        public static ChannelGroups Repeat(ChannelGroup value, int count)
        {
            global::System.IntPtr cPtr = msclPINVOKE.ChannelGroups_Repeat(ChannelGroup.getCPtr(value), count);
            ChannelGroups         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new ChannelGroups(cPtr, true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #7
0
        public ChannelGroups GetRange(int index, int count)
        {
            global::System.IntPtr cPtr = msclPINVOKE.ChannelGroups_GetRange(swigCPtr, index, count);
            ChannelGroups         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new ChannelGroups(cPtr, true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public void InitChannelGroups()
        {
            IList <IChannelGroup> channelGroups;
            var tvHandler = ServiceRegistration.Get <ITvHandler>(false);

            if (tvHandler != null && tvHandler.ChannelAndGroupInfo.GetChannelGroups(out channelGroups))
            {
                ChannelGroups.Clear();
                ChannelGroups.AddRange(FilterGroups(channelGroups));
                ChannelGroups.FireListChanged();

                int selectedChannelGroupId = tvHandler.ChannelAndGroupInfo.SelectedChannelGroupId;
                if (tvHandler.ChannelAndGroupInfo != null && selectedChannelGroupId != 0)
                {
                    ChannelGroups.MoveTo(group => group.ChannelGroupId == selectedChannelGroupId);
                }

                ChannelGroups.FireCurrentChanged(-1);
            }
        }
Exemple #9
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Uid != null?Uid.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Listed.GetHashCode();
                hashCode = (hashCode * 397) ^ (SupportedBridgeTypeUiDs != null
                               ? SupportedBridgeTypeUiDs.GetHashCode()
                               : 0);
                hashCode = (hashCode * 397) ^ Bridge.GetHashCode();
                hashCode = (hashCode * 397) ^ (Channels != null ? Channels.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ChannelGroups != null ? ChannelGroups.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ConfigParameters != null ? ConfigParameters.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ParameterGroups != null ? ParameterGroups.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Properties != null ? Properties.GetHashCode() : 0);
                return(hashCode);
            }
        }
Exemple #10
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ChannelGroups obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Exemple #11
0
        void StartPresenceHeartbeat(bool pause, int pauseTime)
        {
            try {
                string channelsJsonState;
                int    allNonPresenceChannelsOrChannelGroupsCount;
                string channels;
                string channelGroups;

                if (RunIndependentOfSubscribe)
                {
                    channelsJsonState = State;
                    allNonPresenceChannelsOrChannelGroupsCount = ((ChannelGroups.Length > 0)?ChannelGroups.Split(',').Count():0) + ((Channels.Length > 0)?Channels.Split(',').Count():0);
                    Debug.Log("allNonPresenceChannelsOrChannelGroupsCount:" + allNonPresenceChannelsOrChannelGroupsCount);
                    channels      = Channels;
                    channelGroups = ChannelGroups;
                }
                else
                {
                    channelsJsonState = PubNubInstance.SubscriptionInstance.CompiledUserState;
                    allNonPresenceChannelsOrChannelGroupsCount = PubNubInstance.SubscriptionInstance.AllNonPresenceChannelsOrChannelGroups.Count;
                    channels      = Helpers.GetNamesFromChannelEntities(PubNubInstance.SubscriptionInstance.AllNonPresenceChannelsOrChannelGroups, false);
                    channelGroups = Helpers.GetNamesFromChannelEntities(PubNubInstance.SubscriptionInstance.AllNonPresenceChannelsOrChannelGroups, true);
                }

                if (allNonPresenceChannelsOrChannelGroupsCount > 0)
                {
                    isPresenceHearbeatRunning = true;
                    Uri request = BuildRequests.BuildPresenceHeartbeatRequest(
                        channels,
                        channelGroups,
                        channelsJsonState,
                        this.PubNubInstance,
                        null
                        );

                    RequestState requestState = new RequestState();
                    requestState.OperationType = PNOperationType.PNPresenceHeartbeatOperation;
                    requestState.URL           = request.OriginalString;
                    requestState.Timeout       = PubNubInstance.PNConfig.NonSubscribeTimeout;
                    requestState.Pause         = pauseTime;
                    requestState.Reconnect     = pause;

                    #if (ENABLE_PUBNUB_LOGGING)
                    this.PubNubInstance.PNLog.WriteToLog(string.Format("presenceheartbeat: /presence/ request.OriginalString {0} ", request.OriginalString), PNLoggingMethod.LevelError);
                    #endif

                    webRequestId = webRequest.Run(requestState);

                    #if (ENABLE_PUBNUB_LOGGING)
                    this.PubNubInstance.PNLog.WriteToLog(string.Format("StartPresenceHeartbeat: PresenceHeartbeat running, {0} ", pauseTime), PNLoggingMethod.LevelInfo);
                    #endif
                }
                #if (ENABLE_PUBNUB_LOGGING)
                else
                {
                    this.PubNubInstance.PNLog.WriteToLog(string.Format("StartPresenceHeartbeat: AllNonPresenceChannelsOrChannelGroups < 0 "), PNLoggingMethod.LevelInfo);
                }
                #endif
            }
            catch (Exception ex) {
                #if (ENABLE_PUBNUB_LOGGING)
                this.PubNubInstance.PNLog.WriteToLog(string.Format("StartPresenceHeartbeat: PresenceHeartbeat exception {0}", ex.ToString()), PNLoggingMethod.LevelError);
                #endif
            }
        }
Exemple #12
0
 internal void WriteChannelGroups(byte[] array, ref int index)
 {
     ChannelGroups.Write(array, ref index);
 }
Exemple #13
0
        /// <summary>
        /// Returns true if ThingTypeDTO instances are equal
        /// </summary>
        /// <param name="input">Instance of ThingTypeDTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ThingTypeDTO input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     UID == input.UID ||
                     (UID != null &&
                      UID.Equals(input.UID))
                     ) &&
                 (
                     Label == input.Label ||
                     (Label != null &&
                      Label.Equals(input.Label))
                 ) &&
                 (
                     Description == input.Description ||
                     (Description != null &&
                      Description.Equals(input.Description))
                 ) &&
                 (
                     Category == input.Category ||
                     (Category != null &&
                      Category.Equals(input.Category))
                 ) &&
                 (
                     Listed == input.Listed ||
                     (Listed != null &&
                      Listed.Equals(input.Listed))
                 ) &&
                 (
                     SupportedBridgeTypeUIDs == input.SupportedBridgeTypeUIDs ||
                     SupportedBridgeTypeUIDs != null &&
                     SupportedBridgeTypeUIDs.SequenceEqual(input.SupportedBridgeTypeUIDs)
                 ) &&
                 (
                     Bridge == input.Bridge ||
                     (Bridge != null &&
                      Bridge.Equals(input.Bridge))
                 ) &&
                 (
                     Channels == input.Channels ||
                     Channels != null &&
                     Channels.SequenceEqual(input.Channels)
                 ) &&
                 (
                     ChannelGroups == input.ChannelGroups ||
                     ChannelGroups != null &&
                     ChannelGroups.SequenceEqual(input.ChannelGroups)
                 ) &&
                 (
                     ConfigParameters == input.ConfigParameters ||
                     ConfigParameters != null &&
                     ConfigParameters.SequenceEqual(input.ConfigParameters)
                 ) &&
                 (
                     ParameterGroups == input.ParameterGroups ||
                     ParameterGroups != null &&
                     ParameterGroups.SequenceEqual(input.ParameterGroups)
                 ) &&
                 (
                     Properties == input.Properties ||
                     Properties != null &&
                     Properties.SequenceEqual(input.Properties)
                 ) &&
                 (
                     ExtensibleChannelTypeIds == input.ExtensibleChannelTypeIds ||
                     ExtensibleChannelTypeIds != null &&
                     ExtensibleChannelTypeIds.SequenceEqual(input.ExtensibleChannelTypeIds)
                 ));
        }