Exemplo n.º 1
0
        private HtmlTag renderInlineReverse()
        {
            _htmlRoot = new HtmlTag("div").AddClass("CC_editor_root");
            if (_rootId.IsNotEmpty())
            {
                _htmlRoot.Id(_rootId);
            }
            if (_rootClasses != null && _rootClasses.Any())
            {
                _htmlRoot.AddClasses(_rootClasses);
            }
            EditorLabelExpression <VIEWMODEL> labelBuilder = new EditorLabelExpression <VIEWMODEL>(_generator, _expression);
            EditorInputExpression <VIEWMODEL> inputBuilder = new EditorInputExpression <VIEWMODEL>(_generator, _expression);

            addInternalCssClasses(labelBuilder, inputBuilder);
            hideElements(_htmlRoot, labelBuilder, inputBuilder);
            addIds(labelBuilder, inputBuilder);
            addCustomLabel(labelBuilder);
            HtmlTag label = labelBuilder.LeadingColon().ToHtmlTag();
            HtmlTag input = inputBuilder.ToHtmlTag();

            _htmlRoot.Children.Add(input);
            _htmlRoot.Children.Add(label);
            return(_htmlRoot);
        }
Exemplo n.º 2
0
//        private bool checkAuthentication()
//        {
//            _authorizationService = ObjectFactory.Container.GetInstance<IAuthorizationService>();
//            _sessionContext = ObjectFactory.Container.GetInstance<ICCSessionContext>();
//            var user = _sessionContext.GetCurrentUser();
//            return _authorizationService.IsAllowed(user, _operation);
//        }

        private HtmlTag renderStandard()
        {
            _htmlRoot = new HtmlTag("div");
            _htmlRoot.AddClass(_noClear ? "editor_root_no_clear" : "editor_root");
            if (_rootId.IsNotEmpty())
            {
                _htmlRoot.Id(_rootId);
            }
            if (_rootClasses != null && _rootClasses.Any())
            {
                _htmlRoot.AddClasses(_rootClasses);
            }
            EditorLabelExpression <VIEWMODEL>  labelBuilder = new EditorLabelExpression <VIEWMODEL>(_generator, _expression);
            IEditorInputExpression <VIEWMODEL> inputBuilder;

            if (_dropdown)
            {
                inputBuilder = new DropdownInputExpression <VIEWMODEL>(_generator, _expression, _dropdownWithItems);
            }
            else
            {
                inputBuilder = new EditorInputExpression <VIEWMODEL>(_generator, _expression);
            }
            addInternalCssClasses(labelBuilder, inputBuilder);
            hideElements(_htmlRoot, labelBuilder, inputBuilder);
            addIds(labelBuilder, inputBuilder);
            addCustomLabel(labelBuilder);
            if (_readOnly)
            {
                inputBuilder.ReadOnly();
            }
            HtmlTag input = inputBuilder.ToHtmlTag();
            HtmlTag label = labelBuilder.ToHtmlTag();

            _htmlRoot.Children.Add(label);
            _htmlRoot.Children.Add(input);
            addFlagToHtmlRoot(input.FirstChild());
            return(_htmlRoot);
        }