public SetUpAboutToBeShownEventArgs(IntPtr unmanagedEventData) : base(unmanagedEventData) { ShowObjectType show_type = (ShowObjectType)Marshal.ReadInt32(RawEventData, EventOffset.ShowType); ObjectID = (uint)Marshal.ReadInt32(RawEventData, EventOffset.ObjectID); switch (show_type) { case Toolbox.ShowObjectType.FullSpec: { var ev = (NativeToolbox.ShowObjectFullSpecEvent) Marshal.PtrToStructure(RawEventData, typeof(NativeToolbox.ShowObjectFullSpecEvent)); ShowSpec = new ShowObjectFull(new OS.Rect(ref ev.Spec.Visible), new OS.Coord(ref ev.Spec.Scroll), ev.Spec.BehindWindow, 0, 0, 0); break; } case Toolbox.ShowObjectType.TopLeft: { var ev = (NativeToolbox.ShowObjectTopLeftEvent) Marshal.PtrToStructure(RawEventData, typeof(NativeToolbox.ShowObjectTopLeftEvent)); ShowSpec = new ShowObjectTopLeft(new OS.Coord(ref ev.Spec.TopLeft)); break; } case Toolbox.ShowObjectType.Default: case Toolbox.ShowObjectType.Centre: case Toolbox.ShowObjectType.AtPointer: ShowSpec = new ShowObjectSpec(show_type); break; default: ShowSpec = null; break; } }
/*! \brief Create the event arguments from the raw event data. */ public MenuAboutToBeShownEventArgs(IntPtr unmanagedEventData) : base(unmanagedEventData) { ShowObjectType show_type = (ShowObjectType)Marshal.ReadInt32(RawEventData, EventOffset.ShowType); switch (show_type) { case Toolbox.ShowObjectType.FullSpec: case Toolbox.ShowObjectType.TopLeft: var ev = (NativeToolbox.ShowObjectTopLeftEvent) Marshal.PtrToStructure(RawEventData, typeof(NativeToolbox.ShowObjectTopLeftEvent)); ShowSpec = new ShowObjectTopLeft(new OS.Coord(ref ev.Spec.TopLeft)); break; case Toolbox.ShowObjectType.Default: ShowSpec = new ShowObjectSpec(Toolbox.ShowObjectType.Default); break; default: ShowSpec = null; break; } }
public ShowObjectSpec(ShowObjectType type) { Type = type; }