Ejemplo n.º 1
0
        protected override bool OnEvent(SciterElement sourceElement, SciterElement targetElement,
                                        BehaviorEvents type, IntPtr reason, SciterValue data, string eventName)
        {
            //if (type == BehaviorEvents.DocumentReady)
            //	this.Host.ConnectToInspector();

            _logger?.LogDebug($"{nameof(OnEvent)}: {nameof(type)}: {type}; {nameof(eventName)}: {eventName}; {nameof(data)}: {data.AsString()}");
            return(base.OnEvent(sourceElement, targetElement, type, reason, data, eventName));
        }
Ejemplo n.º 2
0
        protected override bool OnEvent(SciterElement sourceElement, SciterElement targetElement,
                                        BehaviorEvents type, IntPtr reason, SciterValue data, string eventName)
        {
            if (type == BehaviorEvents.DocumentReady)
            {
                //Host.ConnectToInspector();
            }

            _logger?.LogTrace(
                "{NameOfMethod}(sourceElement: {SourceElement}; targetElement: {TargetElement}; type: {Type}; data: {DataString}; eventName: {EventName})",
                nameof(OnEvent), sourceElement?.Tag, targetElement?.Tag, type, data.AsString(), eventName);

            return(base.OnEvent(sourceElement, targetElement, type, reason, data, eventName));
        }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sourceElement"><para>Source element e.g. in SELECTION_CHANGED it is new selected &lt;option&gt;, in MENU_ITEM_CLICK it is menu item (LI) element</para></param>
 /// <param name="targetElement"><para>Target element, in MENU_ITEM_CLICK this is owner element that caused this menu - e.g. context menu owner<br/>In scripting this field named as Event.owner</para></param>
 /// <param name="eventType"></param>
 /// <param name="reason"><para>CLICK_REASON or EDIT_CHANGED_REASON - UI action causing change.<br/>In case of custom event notifications this may be any application specific value.</para></param>
 /// <param name="data"><para>Auxiliary data accompanied with the event. E.g. FORM_SUBMIT event is using this field to pass collection of values.</para></param>
 /// <param name="eventName"><para>name of custom event (when <paramref name="eventType"/> == <see cref="SciterBehaviors.BEHAVIOR_EVENTS.CUSTOM"/>)</para></param>
 /// <returns></returns>
 protected virtual bool OnEvent(SciterElement sourceElement, SciterElement targetElement,
                                BehaviorEvents eventType, IntPtr reason, SciterValue data, string eventName)
 {
     return(false);
 }
Ejemplo n.º 4
0
        protected override bool OnEvent(SciterElement sourceElement, SciterElement targetElement, BehaviorEvents type, IntPtr reason,
                                        SciterValue data, string eventName)
        {
            switch (type)
            {
            case BehaviorEvents.ElementExpanded:
                expandOption(targetElement);
                targetElement.CallMethod("optionExpanded", targetElement.Value);
                return(true);

            case BehaviorEvents.ElementCollapsed:

                collapseOption(targetElement);
                targetElement.CallMethod("optionCollapsed", targetElement.Value);
                return(true);
            }

            return(base.OnEvent(sourceElement, targetElement, type, reason, data, eventName));
        }
Ejemplo n.º 5
0
 protected override bool OnEvent(SciterElement sourceElement, SciterElement targetElement, BehaviorEvents type, IntPtr reason,
                                 SciterValue data, string eventName)
 {
     return(base.OnEvent(sourceElement, targetElement, type, reason, data, eventName));
 }
Ejemplo n.º 6
0
        protected override bool OnEvent(SciterElement sourceElement, SciterElement targetElement, BehaviorEvents eventType, IntPtr reason,
                                        SciterValue data, string eventName)
        {
            switch (eventName)
            {
            case "waiting":
                if (data.IsString)
                {
                    //element.SetHtml($"<text>{value.AsString()}</text>");
                    //source.SetAttributeValue("waiting", "true");
                }
                else if (data.IsBool)
                {
                    //source.SetAttributeValue("waiting", (string) null);
                    //element.ClearText();
                }

                break;
            }

            return(base.OnEvent(sourceElement, targetElement, eventType, reason, data, eventName));
        }
Ejemplo n.º 7
0
 protected override bool OnEvent(SciterElement sourceElement, SciterElement targetElement,
                                 BehaviorEvents type, IntPtr reason, SciterValue data, string eventName)
 {
     _logger?.LogDebug($"{nameof(OnEvent)}: {nameof(type)}: {type}; {nameof(eventName)}: {eventName}; {nameof(data)}: {data.AsString()}");
     return(base.OnEvent(sourceElement, targetElement, type, reason, data, eventName));
 }
Ejemplo n.º 8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sourceElement"><para>Source element e.g. in SELECTION_CHANGED it is new selected &lt;option&gt;, in MENU_ITEM_CLICK it is menu item (LI) element</para></param>
        /// <param name="targetElement"><para>Target element, in MENU_ITEM_CLICK this is owner element that caused this menu - e.g. context menu owner<br/>In scripting this field named as Event.owner</para></param>
        /// <param name="type"></param>
        /// <param name="reason"><para>CLICK_REASON or EDIT_CHANGED_REASON - UI action causing change.<br/>In case of custom event notifications this may be any application specific value.</para></param>
        /// <param name="data"><para>Auxiliary data accompanied with the event. E.g. FORM_SUBMIT event is using this field to pass collection of values.</para></param>
        /// <param name="eventName"><para>name of custom event (when <paramref name="type"></paramref>  == <see cref="BehaviorEvents"/>)</para></param>
        /// <returns></returns>
        protected override bool OnEvent(SciterElement sourceElement, SciterElement targetElement, BehaviorEvents type,
                                        IntPtr reason,
                                        SciterValue data, string eventName)
        {
            if (type == BehaviorEvents.Custom)
            {
                _callbackAction?.Invoke(eventName, sourceElement, targetElement, data);
            }

            return(base.OnEvent(sourceElement, targetElement, type, reason, data, eventName));
        }