Exemplo n.º 1
0
        /// <summary>
        /// Handles notifications from instrnic behaviors
        /// </summary>
        protected override void OnBehaviorEvent(BehaviorEventArgs e)
        {
            if (e.Phase == Phase.Bubbling && e.BehaviorEvent == BehaviorEventType.ButtonPress)
            {
                OnClick(EventArgs.Empty);
            }

            base.OnBehaviorEvent(e);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles notifications from instrnic behaviors
        /// </summary>
        protected override void OnBehaviorEvent(BehaviorEventArgs e)
        {
            if (e.Phase == Phase.Bubbling && e.BehaviorEvent == BehaviorEventType.ButtonStateChanged)
            {
                OnValueChanged(EventArgs.Empty);
            }

            base.OnBehaviorEvent(e);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handles notifications from instrnic behaviors
        /// </summary>
        protected override void OnBehaviorEvent(BehaviorEventArgs e)
        {
            base.OnBehaviorEvent(e);

            if (e.Phase == Phase.Bubbling && e.BehaviorEvent == BehaviorEventType.ButtonStateChanged)
            {
                OnCheckedChanged(EventArgs.Empty);
                e.Handled = true;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Handles notifications from instrnic behaviors
        /// </summary>
        protected override void OnBehaviorEvent(BehaviorEventArgs e)
        {
            if (e.Phase == Phase.Bubbling && e.BehaviorEvent == BehaviorEventType.EditValueChanged)
            {
                _text = Element.Text;
                OnTextChanged(EventArgs.Empty);
            }

            base.OnBehaviorEvent(e);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Handles <see cref="SciterBehavior.BehaviorEvent"/>
        /// </summary>
        protected override void OnBehaviorEvent(BehaviorEventArgs e)
        {
            base.OnBehaviorEvent(e);

            if (e.Phase == Phase.Bubbling && e.BehaviorEvent == BehaviorEventType.SelectSelectionChanged)
            {
                var container = GetItemsContainer();
                var index     = container.IndexOf(e.Source);

                DataManager.Position = index;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Handles <see cref="Behavior"/> events
        /// </summary>        
        protected override void OnBehaviorEvent(BehaviorEventArgs e)
        {
            if (e.Phase == Phase.Bubbling && (e.BehaviorEvent == BehaviorEventType.ActivateChild))
            {
                var item = FindTargetItem(e.Element, e.Target);
                if (item != null)
                {
                    SetCurrentItem(e.Element, item);
                    e.Handled = true;
                }
            }

            base.OnBehaviorEvent(e);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Handles <see cref="Behavior"/> events
        /// </summary>
        protected override void OnBehaviorEvent(BehaviorEventArgs e)
        {
            if (e.Phase == Phase.Bubbling && (e.BehaviorEvent == BehaviorEventType.ActivateChild))
            {
                var item = FindTargetItem(e.Element, e.Target);
                if (item != null)
                {
                    SetCurrentItem(e.Element, item);
                    e.Handled = true;
                }
            }

            base.OnBehaviorEvent(e);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Handles behavior event
        /// </summary>
        unsafe static partial void Behavior_HandleBehaviorEvent(ISciterBehavior behavior, IntPtr he, IntPtr prms, ref bool handled)
        {
            var datantf = (BEHAVIOR_EVENT_PARAMS *)prms;
            var e       = new BehaviorEventArgs(Element.Create(he), (Phase)datantf->cmd & Phase.All)
            {
                Source        = Element.Create(datantf->he),
                Target        = Element.Create(datantf->heTarget),
                BehaviorEvent = (BehaviorEventType)datantf->cmd & (BehaviorEventType) ~Phase.All,
                Reason        = (BehaviorEventReason)datantf->reason
            };

            behavior.ProcessBehaviorEvent(e);

            handled = e.Handled;
        }