/// <summary>
        /// Initializes a new instance of the <see cref="FakeHttpSessionState"/> class.
        /// </summary>
        public FakeHttpSessionState()
        {
            this.sessionItems = new NameObjectCollection<object>(StringComparer.InvariantCultureIgnoreCase);
            this.staticObjects = new HttpStaticObjectsCollectionWrapper(new HttpStaticObjectsCollection());

            this.cookieMode = HttpCookieMode.UseCookies;
            this.isNewSession = true;
            this.mode = SessionStateMode.InProc;
            this.sessionID = Guid.NewGuid().ToString("N");
        }
 public virtual void SetPath(NameObjectCollection path)
 {
     while (this.Controls.Count > 1)
     {
         this.Retract();
     }
     foreach (var comp in path)
     {
         this.Expand(comp.Key, comp.Value);
     }
 }
        /// <summary>
        /// 将指定的集合合并到当前集合
        /// </summary>
        /// <param name="newCollection">要合并到当前集合的新集合</param>
        public virtual void MergeFrom(NameObjectCollection newCollection)
        {
            if (newCollection == null || newCollection.Count == 0)
            {
                return;
            }

            for (int i = 0; i < newCollection.Count; i++)
            {
                this[newCollection.GetKey(i)] = newCollection[i];
            }
        }
        /// <summary>
        /// 将指定的集合合并到当前集合
        /// </summary>
        /// <param name="newCollection">要合并到当前集合的新集合</param>
        public virtual void MergeFrom(NameObjectCollection newCollection)
        {
            if (newCollection == null || newCollection.Count == 0) return;

            for (int i = 0; i < newCollection.Count; i++)
            {
                this[newCollection.GetKey(i)] = newCollection[i];
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FakeHttpFileCollection"/> class.
 /// </summary>
 public FakeHttpFileCollection()
 {
     this.collection = new NameObjectCollection<HttpPostedFileBase>(StringComparer.InvariantCultureIgnoreCase);
 }
Exemple #6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mode"></param>
        /// <param name="message"></param>
        /// <param name="warning"></param>
        /// <param name="returnUrls"></param>
        /// <param name="autoJumpSeconds"></param>
        /// <param name="tipLogin"></param>
        /// <param name="returnValue">对话框的返回值</param>
        internal protected void _ShowInfo(string mode, string message, bool htmlEncodeMessage, bool warning, JumpLinkCollection returnUrls, int autoJumpSeconds, bool tipLogin,object returnValue)
        {


            if (message == null)
            {
                if (mode == "success")
                    message = "操作成功";
                else if (mode == "error")
                    message = "发生错误";
            }

            if (returnUrls == null)
                returnUrls = new JumpLinkCollection();

            if (returnUrls.Count == 0)
            {
                string defaultReturn = null;

                if (Request.UrlReferrer != null)
                {
                    if (StringUtil.StartsWithIgnoreCase(Request.UrlReferrer.OriginalString, Globals.FullAppRoot + "/"))
                        defaultReturn = Request.UrlReferrer.PathAndQuery;
                }

                if (defaultReturn == null)
                    defaultReturn = BbsRouter.GetIndexUrl();

                returnUrls.Add(DefaultReturnText, defaultReturn, true);
            }

            if (htmlEncodeMessage)
                message = StringUtil.HtmlEncode(message);

            message = scriptRegex.Replace(message, "<$1bbsmax");
            message = iframeRegex.Replace(message, "<$1bbsmax");

            NameObjectCollection parms = new NameObjectCollection();
            parms.Add("mode", mode);
            parms.Add("message", message);
            parms.Add("returnUrls", returnUrls);
            parms.Add("autoJumpSeconds", autoJumpSeconds);
            parms.Add("tipLogin", tipLogin);
            parms.Add("warning", warning);
            parms.Add("ReturnValue", returnValue);
            Display(InfoPageSrc, true, parms);
        }