public void Initialize() { // TODO : thread-saferty? _story = null; var httpContext = HttpContext.Current; ApplicationContext = new ApplicationContext(); ApplicationContext.ContextParameters = new Dictionary<string, object>(); ApplicationContext.ContextParameters.Add("requestType", httpContext.Request.RequestType); foreach (var item in httpContext.Request.Form.AllKeys) { ApplicationContext.ContextParameters.Add(item, httpContext.Request.Form[item]); } foreach (var item in httpContext.Request.QueryString.AllKeys) { ApplicationContext.ContextParameters.Add(item, httpContext.Request.QueryString[item]); } ApplicationContext.ContextParameters.Add("UserID", httpContext.Session["UserID"]); if (httpContext.Request.UrlReferrer != null) { ApplicationContext.ContextParameters.Add("UrlReferer", httpContext.Request.UrlReferrer.ToString()); } ApplicationContext.ContextParameters.Add("Url", httpContext.Request.RawUrl); }
protected override PointF MoveOffsetPoint(PointF location, IStoryItem sizeable) { return(new PointF(location.X + sizeable.Size.Width, 0)); }
protected override PointF MoveOffsetPoint(PointF location, IStoryItem sizeable) { return(new PointF(0, location.Y + sizeable.Size.Height)); }
/// <summary> /// Добавляет ячейку в набор для расположения /// </summary> /// <param name="wrapper"></param> public void Add(IStoryItem wrapper) { Sizeables.Add(wrapper); }
/// <summary> /// Перемещает опорную точку для расположения ячеек в наборе /// </summary> /// <param name="location">Текущее положение опорной точки</param> /// <param name="sizeable">Значение на которое нужно переместить точку</param> /// <returns>Точка смещенная согласно ориентации набора ячеек</returns> protected abstract PointF MoveOffsetPoint(PointF location, IStoryItem sizeable);
// TODO : thread-saferty? private void CheckStories() { HttpContext.Current.Items.Add("ForwardStory", false); foreach (var story in _boundedStories) { if (story.CheckStory(ApplicationContext)) { if (_story != null) { if (story.PassedRuleCount > _story.PassedRuleCount) { _story = story; } } else { _story = story; } //break; } } ApplicationContext.Story = _story; HttpContext.Current.Items["ForwardStory"] = _story != null; }