Exemplo n.º 1
0
        public void Handle(ThreadEntity CurrentThreadEntity, Page.PageAbstract CurrentPageClass, HTMLContainer ContentContainer)
        {
            _threadEntity = CurrentThreadEntity;
            _threadEntity.ControlIndex += 1;
            _dataBuilder.Init(_tagList);
            _datastring = _dataBuilder.HandleData(CurrentPageClass);
            if (!_xsltLoaded || _threadEntity.WebSetting.DebugMode)
            {
                _xsltstring = HandleXSLT();
            }
            HTMLContainer _temp = new HTMLContainer(ContentContainer.Encoding);

            _xsltstring = _dataBuilder.InsertParameter(_xsltstring);
            if (!string.IsNullOrEmpty(_xsltParameter))
            {
                _xsltstring = InsertParameter(_xsltstring, CurrentPageClass);
            }
            _temp.Write(HandleHTML(_datastring, _xsltstring));

            if (_enableScript && _temp.Length > 0)
            {
                Control.ControlAnalyze _controls = new ControlAnalyze(CurrentThreadEntity, this.Map, true);
                _controls.SetContent(_temp.ToArray());
                _controls.Analyze();
                _temp.Clear();
                _controls.Handle(CurrentPageClass, _temp);
            }
            ContentContainer.Write(_temp);
            _threadEntity.ControlIndex -= 1;
        }
Exemplo n.º 2
0
        public void Handle(ThreadEntity CurrentThreadEntity, Page.PageAbstract CurrentPageClass)
        {
            _threadEntity = CurrentThreadEntity;
            _innerHTML.Clear();
            _threadEntity.ControlIndex++;
            Xy.Tools.Web.UrlAnalyzer _url = CurrentThreadEntity.URL;
            if (_webSetting == null)
            {
                _webSetting = CurrentPageClass.WebSetting;
            }
            if (_webSetting.AutoUrl)
            {
                _webSetting.UpdateDomain(CurrentThreadEntity.URL.Site);
            }
            URLManage.URLItem _urlItem = new URLManage.URLItem(_file, _type, _threadEntity.URLItem.Regex.ToString(), _threadEntity.URLItem.Mime, _enableScript, _enableCache, _threadEntity.URLItem.ContentType.ToString(), _threadEntity.URLItem.Age.Minutes);
            ThreadEntity      _entity  = new ThreadEntity(CurrentThreadEntity.WebContext, _webSetting, _urlItem, _url, true);

            _entity.Handle(_extValues);
            if (_entity.Content.HasContent)
            {
                _innerHTML.Write(_entity.Content);
            }
            _threadEntity.ControlIndex--;
        }
Exemplo n.º 3
0
        //public void AppendToLog(string param) { _innerResponse.AppendToLog(param); }

        //public string ApplyAppPathModifier(string virtualPath) { return _innerResponse.ApplyAppPathModifier(virtualPath); }

        //public void BinaryWrite(byte[] buffer) { _innerResponse.BinaryWrite(buffer); }

        public void Clear()
        {
            _content.Clear();
        }
Exemplo n.º 4
0
        public void Handle(ThreadEntity CurrentThreadEntity, Page.PageAbstract CurrentPageClass, HTMLContainer ContentContainer)
        {
            _threadEntity = CurrentThreadEntity;
            if (_webConfig == null)
            {
                _webConfig = CurrentPageClass.WebSetting;
            }
            _threadEntity.ControlIndex += 1;
            HTMLContainer _innerHTML = new HTMLContainer(ContentContainer.Encoding);

            _fillContentDelegate(_settingProperty, CurrentThreadEntity, CurrentPageClass, _innerHTML);

            switch (_mode)
            {
            case TagMode.Get:
                break;

            case TagMode.Compare:
                bool   _passed    = false;
                string _dataValue = _innerHTML.ToString();
                _innerHTML.Clear();
                switch (_compareMode)
                {
                case CompareMode.Equal:
                    if (string.Compare(_dataValue, _compareValue) == 0)
                    {
                        _passed = true;
                    }
                    break;

                case CompareMode.NotEqual:
                    if (string.Compare(_dataValue, _compareValue) != 0)
                    {
                        _passed = true;
                    }
                    break;

                case CompareMode.Greater:
                    if (string.Compare(_dataValue, _compareValue) > 0)
                    {
                        _passed = true;
                    }
                    break;

                case CompareMode.Lesser:
                    if (string.Compare(_dataValue, _compareValue) < 0)
                    {
                        _passed = true;
                    }
                    break;

                case CompareMode.GreaterAndEqual:
                    if (string.Compare(_dataValue, _compareValue) >= 0)
                    {
                        _passed = true;
                    }
                    break;

                case CompareMode.LesserAndEqual:
                    if (string.Compare(_dataValue, _compareValue) <= 0)
                    {
                        _passed = true;
                    }
                    break;
                }
                if (_passed)
                {
                    _innerHTML.Write(_innerData);
                }
                break;

            case TagMode.Exist:
                if (_innerHTML.Length > 0)
                {
                    _innerHTML.Clear();
                    _innerHTML.Write(_innerData);
                }
                break;

            case TagMode.NotExist:
                if (_innerHTML.Length > 0)
                {
                    _innerHTML.Clear();
                }
                else
                {
                    _innerHTML.Write(_innerData);
                }
                break;
            }

            if (_innerHTML.Length == 0 && !string.IsNullOrEmpty(_defaultValue))
            {
                ContentContainer.Write(_defaultValue);
            }
            else
            {
                if (_enableScript)
                {
                    Control.ControlAnalyze _controls = new ControlAnalyze(CurrentThreadEntity, this.Map, _useInnerTag);
                    _controls.SetContent(_innerHTML.ToArray());
                    _controls.Analyze();
                    _controls.Handle(CurrentPageClass, ContentContainer);
                }
                else
                {
                    ContentContainer.Write(_innerHTML);
                }
            }
            _threadEntity.ControlIndex -= 1;
        }
Exemplo n.º 5
0
        public void Handle(ThreadEntity CurrentThreadEntity, Page.PageAbstract CurrentPageClass, HTMLContainer ContentContainer)
        {
            _threadEntity = CurrentThreadEntity;
            _threadEntity.ControlIndex += 1;
            _dataBuilder.Init(_tagList);
            _datastring = _dataBuilder.HandleData(CurrentPageClass);

            HTMLContainer _temp = new HTMLContainer(ContentContainer.Encoding);

            if (!_xsltLoaded || _threadEntity.WebSetting.DebugMode) {
                _xsltCache = HandleXSLT();
            }
            _xsltString = _xsltCache;
            _xsltString = _dataBuilder.InsertParameter(_xsltString);
            if (!string.IsNullOrEmpty(_xsltParameter)) {
                _xsltString = InsertParameter(_xsltString, CurrentPageClass);
            }
            _temp.Write(HandleHTML(_datastring, _xsltString));

            if (_enableScript && _temp.Length > 0) {
                Control.ControlAnalyze _controls = new ControlAnalyze(CurrentThreadEntity, this.Map, true);
                _controls.SetContent(_temp.ToArray());
                _controls.Analyze();
                _temp.Clear();
                _controls.Handle(CurrentPageClass, _temp);
            }
            ContentContainer.Write(_temp);
            _threadEntity.ControlIndex -= 1;
        }