private Binding(BindingConfiguration config, System.ServiceModel.Channels.Binding wcfBinding,
     Type endpointType, DataTypeSupport dataTypes)
 {
     Configuration = config;
     WcfBinding = wcfBinding;
     EndPointType = endpointType;
     DataTypes = dataTypes;
 }
Exemple #2
0
 private Binding(BindingConfiguration config, System.ServiceModel.Channels.Binding wcfBinding,
                 Type endpointType, DataTypeSupport dataTypes)
 {
     Configuration = config;
     WcfBinding    = wcfBinding;
     EndPointType  = endpointType;
     DataTypes     = dataTypes;
 }
Exemple #3
0
        /// <summary>
        /// Save a single object as cookie.
        /// Save in Response.
        /// </summary>
        /// <param name="Object">Pass the object</param>
        /// <param name="cookieName">Cookie name , pass null if constructor CookieName is valid.</param>
        /// <param name="checkBeforeExist">True: Don't save if already exist. </param>
        /// <param name="expiration"></param>
        public void Save(object Object, string cookieName, bool checkBeforeExist, DateTime expiration)
        {
            if (cookieName == null)
            {
                cookieName = CookieName;
            }
            var httpCookie = new HttpCookie(cookieName)
            {
                Expires = expiration
            };
            //createdCookie = true;
            //}
            var isSupport = DataTypeSupport.Support(Object);

            //is not null and don't support = complex
            if (Object != null && !isSupport)
            {
                //if not a primitive type and thus complex class
                List <ObjectProperty> list = ObjectToArray.ObjectToArrary.Get(Object);
                foreach (var item in list)
                {
                    if (DataTypeSupport.Support(item.Value) && item.Value != null)
                    {
                        httpCookie[item.Name] = item.Value.ToString();
                    }
                    else
                    {
                        httpCookie[item.Name] = null;
                    }
                }
            }
            else if (Object != null && isSupport)
            {
                // object exist but not a complex type of object.
                httpCookie.Value = (string)Object;
            }
            HttpContext.Current.Response.Cookies.Set(httpCookie); //only add unique cookies
        }
 internal static IBinding Create(BindingConfiguration config, System.ServiceModel.Channels.Binding wcfBinding,
     Type endpointType, DataTypeSupport dataTypes)
 {
     return new Binding(config, wcfBinding, endpointType, dataTypes);
 }
Exemple #5
0
 internal static IBinding Create(BindingConfiguration config, System.ServiceModel.Channels.Binding wcfBinding,
                                 Type endpointType, DataTypeSupport dataTypes)
 {
     return(new Binding(config, wcfBinding, endpointType, dataTypes));
 }