コード例 #1
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (UniqueName != null)
            {
                p.Add(new KeyValuePair <string, string>("UniqueName", UniqueName));
            }

            if (DefaultTtl != null)
            {
                p.Add(new KeyValuePair <string, string>("DefaultTtl", DefaultTtl.ToString()));
            }

            if (CallbackUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("CallbackUrl", Serializers.Url(CallbackUrl)));
            }

            if (GeoMatchLevel != null)
            {
                p.Add(new KeyValuePair <string, string>("GeoMatchLevel", GeoMatchLevel.ToString()));
            }

            if (NumberSelectionBehavior != null)
            {
                p.Add(new KeyValuePair <string, string>("NumberSelectionBehavior", NumberSelectionBehavior.ToString()));
            }

            if (InterceptCallbackUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("InterceptCallbackUrl", Serializers.Url(InterceptCallbackUrl)));
            }

            if (OutOfSessionCallbackUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("OutOfSessionCallbackUrl", Serializers.Url(OutOfSessionCallbackUrl)));
            }

            if (ChatInstanceSid != null)
            {
                p.Add(new KeyValuePair <string, string>("ChatInstanceSid", ChatInstanceSid.ToString()));
            }

            return(p);
        }
コード例 #2
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (UniqueName != null)
            {
                p.Add(new KeyValuePair <string, string>("UniqueName", UniqueName));
            }

            if (DefaultTtl != null)
            {
                p.Add(new KeyValuePair <string, string>("DefaultTtl", DefaultTtl.Value.ToString()));
            }

            if (CallbackUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("CallbackUrl", CallbackUrl.AbsoluteUri.TrimEnd('/')));
            }

            if (GeoMatchLevel != null)
            {
                p.Add(new KeyValuePair <string, string>("GeoMatchLevel", GeoMatchLevel.ToString()));
            }

            if (NumberSelectionBehavior != null)
            {
                p.Add(new KeyValuePair <string, string>("NumberSelectionBehavior", NumberSelectionBehavior.ToString()));
            }

            if (InterceptCallbackUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("InterceptCallbackUrl", InterceptCallbackUrl.AbsoluteUri.TrimEnd('/')));
            }

            if (OutOfSessionCallbackUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("OutOfSessionCallbackUrl", OutOfSessionCallbackUrl.AbsoluteUri.TrimEnd('/')));
            }

            return(p);
        }