public static void RegisterCustomRenderer(ControlType controlType, IControlRenderer renderer)
 {
     if (ControlRenderers == null)
     {
         InitialiseFormControls();
     }
     ControlRenderers[controlType] = renderer;
 }
Exemplo n.º 2
0
        protected ItemsContainer(IControlRenderer renderer = null) : base(
                renderer
                ?? new ItemsContainerRenderer( ))
        {
            Items = new ObservableCollection <Control> ( );
            Items.CollectionChanged += Items_CollectionChanged;

            Children = new ReadOnlyCollection <Control> (Items);
        }
Exemplo n.º 3
0
 public Grid(IControlRenderer renderer) : base(renderer ?? new ItemsContainerRenderer( ))
 {
     Rows = new ObservableCollection <Row> ( );
     Rows.CollectionChanged += ColumnsRows_CollectionChanged;
     Columns = new ObservableCollection <Column> ( );
     Columns.CollectionChanged += ColumnsRows_CollectionChanged;
     ItemsAdded   += Grid_ItemsAdded;
     ItemsRemoved += Grid_ItemsRemoved;
 }
Exemplo n.º 4
0
        public override void InitializeControl(Control control)
        {
            IControlRenderer renderer = GetRenderer(control);

            if (renderer != null)
            {
                renderer.InitializeControl(control);
            }
        }
Exemplo n.º 5
0
        // Public members

        public override void PaintControl(Control control, ControlPaintArgs e)
        {
            IControlRenderer renderer = GetRenderer(control);

            if (renderer is null)
            {
                PaintGenericControl(e);
            }
            else
            {
                renderer.PaintControl(control, e);
            }
        }
Exemplo n.º 6
0
 /// <summary>
 ///     Creates a new RadioButton
 /// </summary>
 /// <param name="renderer">
 ///     The
 ///     <code>ControlRenderer</code>
 ///     to use. If null a new instance of
 ///     <code>RadioButtonRenderer</code>
 ///     will be used.
 /// </param>
 /// <exception cref="ArgumentException">
 ///     Thrown if the
 ///     <code>ControlRenderer</code>
 ///     which should be set already has an other
 ///     Control assigned
 /// </exception>
 public RadioButton(IControlRenderer renderer = null) : base(renderer ?? new RadioButtonRenderer( ))
 {
     State            = CheckState.Unchecked;
     CheckedChanging += OnCheckedChanging;
 }
Exemplo n.º 7
0
 public void SetRenderer <T>(IControlRenderer <T> renderer) where T : Control
 {
     customRenderers[typeof(T)] = renderer;
 }
Exemplo n.º 8
0
 public ConsolePresenter(IControlRenderer renderer) : base(renderer)
 {
 }
Exemplo n.º 9
0
 public ContainerBase(IControlRenderer renderer) : base(renderer)
 {
 }
 public UserPaintStyleApplicator(IStyleSheet styleSheet, IControlRenderer controlRenderer, StyleApplicatorOptions options = StyleApplicatorOptions.Default) :
     base(styleSheet, options)
 {
     this.controlRenderer = controlRenderer;
     toolTipRenderer      = new ToolTipRenderer(styleSheet, styleRenderer);
 }
Exemplo n.º 11
0
 internal ControlRenderer(IControlRenderer renderer)
 {
     _renderer = renderer;
 }
Exemplo n.º 12
0
 public void RegisterRenderer(Type t, IControlRenderer renderer)
 {
     renderersDictionary.Add(t, renderer);
 }
Exemplo n.º 13
0
 /// <summary>
 ///     Creates a new
 ///     <code>Label</code>
 /// </summary>
 /// <param name="renderer">
 ///     The
 ///     <code>ControlRenderer</code>
 ///     to use. If null a new instance of
 ///     <code>LabelRenderer</code>
 ///     will be used.
 /// </param>
 /// <exception cref="ArgumentException">
 ///     Thrown if the
 ///     <code>ControlRenderer</code>
 ///     which should be set already has an other
 ///     Control assigned
 /// </exception>
 public Label(IControlRenderer renderer = null) : base(renderer ?? new LabelRenderer( ))
 {
 }
Exemplo n.º 14
0
 public void RegisterRenderer(Type t,IControlRenderer renderer)
 {
     renderersDictionary.Add(t,renderer);
 }
Exemplo n.º 15
0
 public RelativePanel(IControlRenderer renderer) : base(renderer ?? new ItemsContainerRenderer( ))
 {
 }
Exemplo n.º 16
0
        public static IHtmlString MultipleChoiceFor <TControl>(this KenticoForm html, TControl control, IControlRenderer customRenderer) where TControl : IControl

        {
            var renderedControl = customRenderer.Render(control);

            return(MvcHtmlString.Create(renderedControl.ToString()));
        }
Exemplo n.º 17
0
        public static IHtmlString UploadFor <TControl>(this KenticoForm html, TControl control, IControlRenderer customRenderer) where TControl : IControl
        {
            var renderedControl = customRenderer.Render(control);

            return(MvcHtmlString.Create(renderedControl));
        }
Exemplo n.º 18
0
 /// <summary>
 ///     Creates a new
 ///     <code>Canvas</code>
 /// </summary>
 /// <param name="renderer">
 ///     The
 ///     <code>ControlRenderer</code>
 ///     to use. If null a new instance of
 ///     <code>PanelRenderer</code>
 ///     will be used.
 /// </param>
 /// <exception cref="ArgumentException">
 ///     Thrown if the
 ///     <code>ControlRenderer</code>
 ///     which should be set already has an other
 ///     Control assigned
 /// </exception>
 public Canvas(IControlRenderer renderer = null) : base(renderer)
 {
     ItemsAdded   += Canvas_ItemsAdded;
     ItemsRemoved += Canvas_ItemsRemoved;
 }
Exemplo n.º 19
0
 protected override void DrawControl(IControlRenderer renderer)
 {
     if (!string.IsNullOrEmpty(this.Text))
         renderer.DrawString(this.Font, this.Text, this.Position, this.ForegroundColor);
 }
Exemplo n.º 20
0
 public void RegisterRenderer(Type t,IControlRenderer renderer)
 {
     renderer.UnitMulitipier = unitMultipilier;
     renderersDictionary.Add(t,renderer);
 }
Exemplo n.º 21
0
 public StackPanel(IControlRenderer renderer = null) : base(renderer ?? new ItemsContainerRenderer( ))
 {
 }
Exemplo n.º 22
0
        public static IHtmlString UploadFor(this KenticoForm html, IForm model, string controlName, IControlRenderer customRenderer)
        {
            var control         = model.Controls.FirstOrDefault(ctrl => ctrl.Name.Equals(controlName, StringComparison.OrdinalIgnoreCase));
            var renderedControl = customRenderer.Render(control);

            return(MvcHtmlString.Create(renderedControl));
        }
Exemplo n.º 23
0
        public static IHtmlString CalendarFor(this KenticoForm html, IControl control, IControlRenderer customRenderer)
        {
            var renderedControl = customRenderer.Render(control);

            return(MvcHtmlString.Create(renderedControl));
        }
Exemplo n.º 24
0
 internal void SetControlRenderer(IControlRenderer controlRenderer)
 {
     _controlRenderer = new ControlRenderer(controlRenderer);
 }
Exemplo n.º 25
0
 public HorizontalStackPanel(IControlRenderer renderer = null) : base(
         renderer
         ?? new ItemsContainerRenderer <
             HorizontalStackPanel> ( ))
 {
 }