示例#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;
        }
示例#2
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;
        }
        public void Handle(ThreadEntity CurrentThreadEntity, Page.PageAbstract CurrentPageClass, HTMLContainer ContentContainer)
        {
            _threadEntity = CurrentThreadEntity;
            _threadEntity.ControlIndex += 1;
            HTMLContainer _innerHTML = new HTMLContainer(ContentContainer.Encoding);

            if (CurrentPageClass is Page.UserPage)
            {
                Page.UserPage up = (Page.UserPage)CurrentPageClass;
                if (up.CurrentUser != null)
                {
                    if ((_hasPowerIndex > 0 && up.CurrentUser.HasPower(_hasPowerIndex)) || (!string.IsNullOrEmpty(_hasPowerKey) && up.CurrentUser.HasPower(_hasPowerKey)))
                    {
                        if (_inGroupIndex > 0 || !string.IsNullOrEmpty(_inGroupKey))
                        {
                            if (up.CurrentUser.InGroup(_inGroupIndex) || up.CurrentUser.InGroup(_inGroupKey))
                            {
                                _innerHTML.Write(_innerData);
                            }
                        }
                        else
                        {
                            _innerHTML.Write(_innerData);
                        }
                    }
                    else if ((_inGroupIndex > 0 && up.CurrentUser.InGroup(_inGroupIndex)) || (!string.IsNullOrEmpty(_hasPowerKey) && up.CurrentUser.InGroup(_inGroupKey)))
                    {
                        _innerHTML.Write(_innerData);
                    }
                }
            }
            if (_innerHTML.Length == 0 && !string.IsNullOrEmpty(_noPowerMessage))
            {
                ContentContainer.Write(_noPowerMessage);
            }
            else
            {
                if (_enableScript)
                {
                    Control.ControlAnalyze _controls = Cache.PageAnalyze.GetInstance(CurrentThreadEntity, CurrentPageClass, this.Map);
                    if (!_controls.IsHandled || CurrentPageClass.WebSetting.DebugMode)
                    {
                        _controls.SetContent(_innerHTML.ToArray());
                        _controls.Analyze();
                    }
                    _controls.Handle(CurrentPageClass, ContentContainer);
                }
                else
                {
                    ContentContainer.Write(_innerHTML);
                }
            }
            _threadEntity.ControlIndex -= 1;
        }
示例#4
0
        public void Handle(ThreadEntity CurrentThreadEntity, Page.PageAbstract CurrentPageClass, HTMLContainer ContentContainer)
        {
            _threadEntity = CurrentThreadEntity;
            _threadEntity.ControlIndex += 1;
            string _content = string.Empty;

            if (_preEnableScript && _innerData.Length > 0)
            {
                Control.ControlAnalyze _controls = Cache.PageAnalyze.GetInstance(CurrentThreadEntity, CurrentPageClass, this.Map);
                if (!_controls.IsHandled || CurrentPageClass.WebSetting.DebugMode)
                {
                    _controls.SetContent(_innerData.ToArray());
                    _controls.Analyze();
                }
                HTMLContainer _temp = new HTMLContainer(_innerData.Encoding);
                _controls.Handle(CurrentPageClass, _temp);
                _content = _temp.ToString();
            }
            else
            {
                _content = _innerData.ToString();
            }
            if (_append)
            {
                string _originalContent = string.Empty;
                if (CurrentPageClass.PageData[_dataName] != null)
                {
                    _originalContent = CurrentPageClass.PageData[_dataName].GetDataString();
                }
                CurrentPageClass.PageData.Add(_dataName, _originalContent + _content);
            }
            else
            {
                CurrentPageClass.PageData.Add(_dataName, _content);
            }

            _threadEntity.ControlIndex -= 1;
        }
示例#5
0
 public string BuildHtmlString()
 {
     return(_threadEntity.WebSetting.Encoding.GetString(_innerHTML.ToArray()));
 }
示例#6
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;
        }
示例#7
0
 public void SetContent(HTMLContainer content)
 {
     _content = content.ToArray();
     _contentChanged = true;
 }
示例#8
0
 public void SetContent(HTMLContainer content)
 {
     _content        = content.ToArray();
     _contentChanged = true;
 }
示例#9
0
 public void Handle(ThreadEntity CurrentThreadEntity, Page.PageAbstract CurrentPageClass, HTMLContainer ContentContainer)
 {
     _threadEntity = CurrentThreadEntity;
     _threadEntity.ControlIndex += 1;
     HTMLContainer _innerHTML = new HTMLContainer(ContentContainer.Encoding);
     if (CurrentPageClass is Page.UserPage) {
         Page.UserPage up = (Page.UserPage)CurrentPageClass;
         if (up.CurrentUser != null) {
             if ((_hasPowerIndex > 0 && up.CurrentUser.HasPower(_hasPowerIndex)) || (!string.IsNullOrEmpty(_hasPowerKey) && up.CurrentUser.HasPower(_hasPowerKey))) {
                 if (_inGroupIndex > 0 || !string.IsNullOrEmpty(_inGroupKey)) {
                     if (up.CurrentUser.InGroup(_inGroupIndex) || up.CurrentUser.InGroup(_inGroupKey)) {
                         _innerHTML.Write(_innerData);
                     }
                 } else {
                     _innerHTML.Write(_innerData);
                 }
             } else if ((_inGroupIndex > 0 && up.CurrentUser.InGroup(_inGroupIndex)) || (!string.IsNullOrEmpty(_hasPowerKey) && up.CurrentUser.InGroup(_inGroupKey))) {
                 _innerHTML.Write(_innerData);
             }
         }
     }
     if (_innerHTML.Length == 0 && !string.IsNullOrEmpty(_noPowerMessage)) {
         ContentContainer.Write(_noPowerMessage);
     } else {
         if (_enableScript) {
             Control.ControlAnalyze _controls = Cache.PageAnalyze.GetInstance(CurrentThreadEntity, CurrentPageClass, this.Map);
             if (!_controls.IsHandled || CurrentPageClass.WebSetting.DebugMode) {
                 _controls.SetContent(_innerHTML.ToArray());
                 _controls.Analyze();
             }
             _controls.Handle(CurrentPageClass, ContentContainer);
         } else {
             ContentContainer.Write(_innerHTML);
         }
     }
     _threadEntity.ControlIndex -= 1;
 }