Beispiel #1
0
        public void TestSciterElement()
        {
            SciterElement el  = SciterElement.Create("div");
            SciterElement el2 = SciterElement.Attach(el.Handle);

            Assert.IsTrue(el == el2);
        }
 internal static KeyArgs ToEventArgs(this SciterBehaviors.KEY_PARAMS @params)
 {
     return(new KeyArgs
     {
         Event = (KeyEvent) unchecked ((int)@params.cmd),
         KeyboardState = (KeyboardStates) unchecked ((int)@params.alt_state),
         KeyCode = unchecked ((int)@params.key_code),
         TargetElement = @params.target.Equals(IntPtr.Zero) ? null : SciterElement.Attach(@params.target)
     });
 }
 internal static FocusArgs ToEventArgs(this SciterBehaviors.FOCUS_PARAMS @params)
 {
     return(new FocusArgs
     {
         Event = (FocusEvents) unchecked ((int)@params.cmd),
         TargetElement = @params.target.Equals(IntPtr.Zero) ? null : SciterElement.Attach(@params.target),
         Cancel = @params.cancel,
         IsMouseClick = @params.by_mouse_click
     });
 }
 internal static ScrollEventArgs ToEventArgs(this SciterBehaviors.SCROLL_PARAMS @params)
 {
     return(new ScrollEventArgs
     {
         Event = (ScrollEvents) unchecked ((int)@params.cmd),
         TargetElement = @params.target.Equals(IntPtr.Zero) ? null : SciterElement.Attach(@params.target),
         Position = @params.pos,
         Source = (ScrollSource) unchecked ((int)@params.source),
         IsVertical = @params.vertical,
         Reason = unchecked ((int)@params.reason)
     });
 }
 internal static ExchangeArgs ToEventArgs(this SciterBehaviors.EXCHANGE_PARAMS @params)
 {
     return(new ExchangeArgs
     {
         Event = (ExchangeEvent) unchecked ((int)@params.cmd),
         ElementPosition = new SciterPoint(@params.pos.X, @params.pos.Y),
         ViewPosition = new SciterPoint(@params.pos_view.X, @params.pos_view.Y),
         TargetElement = @params.target.Equals(IntPtr.Zero) ? null : SciterElement.Attach(@params.target),
         SourceElement = @params.source.Equals(IntPtr.Zero) ? null : SciterElement.Attach(@params.target),
         Mode = (DragAndDropMode) unchecked ((int)@params.mode),
         Value = SciterCore.SciterValue.Attach(@params.data)
     });
 }
 internal static GestureArgs ToEventArgs(this SciterBehaviors.GESTURE_PARAMS @params)
 {
     return(new GestureArgs
     {
         Event = (GestureEvent) unchecked ((int)@params.cmd),
         TargetElement = @params.target.Equals(IntPtr.Zero) ? null : SciterElement.Attach(@params.target),
         Flags = unchecked ((int)@params.flags),
         DeltaTime = unchecked ((int)@params.delta_time),
         DeltaV = @params.delta_v,
         ElementPosition = new SciterPoint(@params.pos.X, @params.pos.Y),
         ViewPosition = new SciterPoint(@params.pos_view.X, @params.pos_view.Y),
         DeltaXY = new SciterSize(@params.delta_xy.cx, @params.delta_xy.cy),
     });
 }
 internal static MouseArgs ToEventArgs(this SciterBehaviors.MOUSE_PARAMS @params)
 {
     return(new MouseArgs
     {
         Event = (MouseEvents) unchecked ((int)@params.cmd),
         Cursor = (CursorType) unchecked ((int)@params.cursor_type),
         ButtonState = (MouseButton) unchecked ((int)@params.button_state),
         DragMode = (DraggingMode) unchecked ((int)@params.dragging_mode),
         DragTarget = @params.dragging.Equals(IntPtr.Zero) ? null : SciterElement.Attach(@params.dragging),
         ElementPosition = new SciterPoint(@params.pos.X, @params.pos.Y),
         ViewPosition = new SciterPoint(@params.pos_view.X, @params.pos_view.Y),
         KeyboardState = (KeyboardStates) unchecked ((int)@params.alt_state),
         TargetElement = @params.target.Equals(IntPtr.Zero) ? null : SciterElement.Attach(@params.target),
         IsOverIcon = @params.is_on_icon
     });
 }