Example #1
0
        /// <summary>
        /// Handles <see cref="SciterBehavior.OnAttached"/>
        /// </summary>
        protected override void OnAttached(ElementEventArgs e)
        {
            base.OnAttached(e);

            if (_text != null)
                Element.Text = _text;
            else
                _text = Element.Text;
        }
Example #2
0
 /// <summary>
 /// Raises <see cref="Timer"/> event
 /// </summary>
 protected virtual void OnTimer(ElementEventArgs e)
 {
     if (HasEvents)
     {
         var handler = (EventHandler<ElementEventArgs>)Events[TimerEvent];
         if (handler != null)
         {
             e.Handled = true;
             handler(this, e);
         }
     }
 }
Example #3
0
 /// <summary>
 /// Handles timer event
 /// </summary>
 void ISciterBehavior.ProcessTimer(ElementEventArgs e)
 {
     OnTimer(e);
 }
Example #4
0
 /// <summary>
 /// Handles size changes
 /// </summary>
 void ISciterBehavior.ProcessSize(ElementEventArgs e)
 {
     OnSize(e);
 }
Example #5
0
 /// <summary>
 /// Handles scroll
 /// </summary>
 void ISciterBehavior.ProcessScroll(ElementEventArgs e)
 {
     e.Handled = false;
 }
Example #6
0
 /// <summary>
 /// Handles behavior initialization
 /// </summary>
 void ISciterBehavior.ProcessDettach(ElementEventArgs e)
 {
     e.Handled = true;
     OnDetached(e);
 }
Example #7
0
 /// <summary>
 /// Handles behavior initialization
 /// </summary>
 void ISciterBehavior.ProcessAttach(ElementEventArgs e)
 {
     e.Handled = true;
     OnAttached(e);
 }
Example #8
0
 /// <summary>
 /// Handles <see cref="SciterBehavior.OnDetached"/>
 /// </summary>
 protected override void OnDetached(ElementEventArgs e)
 {
     base.OnDetached(e);
 }
Example #9
0
        /// <summary>
        /// Handles <see cref="SciterBehavior.OnAttached"/>
        /// </summary>
        protected override void OnAttached(ElementEventArgs e)
        {
            var element = Element;
            element.SetState(_stateToSet, _stateToClear);

            if (_controlAttributes != null)
            {
                foreach (var item in _controlAttributes)
                {
                    element.Attributes[item.Key] = item.Value;
                }
            }

            if (_controlStyle != null)
            {
                foreach (var item in _controlStyle)
                {
                    element.Style[item.Key] = item.Value;
                }
            }

            base.OnAttached(e);
        }