コード例 #1
0
        void ErrorWindow_ErrorHandler(Kitware.VTK.vtkObject sender, Kitware.VTK.vtkObjectEventArgs e)
        {
            string s = "unknown";

            if (e.CallData != IntPtr.Zero)
            {
                s = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(e.CallData);
            }

            System.Diagnostics.Debug.Write(System.String.Format(
                                               "ErrorWindow_ErrorHandler called: sender='{0}' e='{1}' s='{2}'", sender, e, s));
        }
コード例 #2
0
        void PrintEvent(Kitware.VTK.vtkObject sender, Kitware.VTK.vtkObjectEventArgs e)
        {
            int[]  pos     = this.Interactor.GetEventPosition();
            string keysym  = this.Interactor.GetKeySym();
            sbyte  keycode = this.Interactor.GetKeyCode();

            string line = String.Format("{0} ({1},{2}) ('{3}',{4}) {5} data='0x{6:x8}'{7}",
                                        Kitware.VTK.vtkCommand.GetStringFromEventId(e.EventId),
                                        pos[0], pos[1],
                                        keysym, keycode,
                                        e.Caller.GetClassName(), e.CallData.ToInt32(), System.Environment.NewLine);

            System.Diagnostics.Debug.Write(line);
            this.textEvents.AppendText(line);
        }