Esempio 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;
        }
Esempio n. 2
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;
        }
Esempio n. 3
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;
        }