コード例 #1
0
        private void Dispose(bool disposing)
        {
            DebugOutput("~~~~~~~~~~~~~~~~~~~~~~ InPlaceEditor.Dispose(" + disposing + ")" ENTER);
#if DO_CLEANUP
            if (EditingEndedObserver != null)
            {
                DebugOutput("  ~!~!~!~! InPlaceEditor.Dispose: removing end edit observer");
                NSNotificationCenter.DefaultCenter.RemoveObserver(EditingEndedObserver);
                EditingEndedObserver.Dispose();
                EditingEndedObserver = null;
            }
            if (EditingTextChanged != null)
            {
                DebugOutput("  ~!~!~!~! InPlaceEditor.Dispose: removing edit text changed observer");
                NSNotificationCenter.DefaultCenter.RemoveObserver(EditingTextChanged);
                EditingTextChanged.Dispose();
                EditingTextChanged = null;
            }
            if (EditingStartedObserver != null)
            {
                DebugOutput("  ~!~!~!~! InPlaceEditor.Dispose: removing edit started observer");
                NSNotificationCenter.DefaultCenter.RemoveObserver(EditingStartedObserver);
                EditingStartedObserver.Dispose();
                EditingStartedObserver = null;
            }
#endif // DO_CLEANUP
            if (KeyMonitor != null)
            {
                DebugOutput("  ~!~!~!~! InPlaceEditor.Dispose: removing key monitor");
                NSEvent.RemoveMonitor(KeyMonitor);
                KeyMonitor.Dispose();
                KeyMonitor = null;
            }
            DebugOutput("~~~~~~~~~~~~~~~~~~~~~~ InPlaceEditor.Dispose(" + disposing + ") EXIT");
        }
コード例 #2
0
        private void CellTextEditEnded(NSNotification notification)
        {
            DebugOutput("---------------------- CellEdit ended");
#if ENABLE_INPLACEEDIT_TRACE
            if (notification != null)
            {
                var editor = notification.UserInfo.ValueForKey(FieldEditorKey) as NSTextView;
                var value  = editor == null ? "<null editor>" : editor.Value;
                DebugOutput("  -!-!-!-! CellEdit ended: Notification field editor value: " + value);
            }
#endif // ENABLE_INPLACEEDIT_TRACE
#if DO_CLEANUP
            if (EditingEndedObserver != null)
            {
                DebugOutput("  -!-!-!-! CellEdit ended: Removing end edit observer");
                NSNotificationCenter.DefaultCenter.RemoveObserver(EditingEndedObserver);
                EditingEndedObserver.Dispose();
                EditingEndedObserver = null;
            }
            if (EditingTextChanged != null)
            {
                DebugOutput(" -!-!-!-! CellEdit ended: Removing edit text changed observer");
                NSNotificationCenter.DefaultCenter.RemoveObserver(EditingTextChanged);
                EditingTextChanged.Dispose();
                EditingTextChanged = null;
            }
            if (EditingStartedObserver != null)
            {
                DebugOutput("  -!-!-!-! CellEdit ended: Removing edit started observer");
                NSNotificationCenter.DefaultCenter.RemoveObserver(EditingStartedObserver);
                EditingStartedObserver.Dispose();
                EditingStartedObserver = null;
            }
#endif // DO_CLEANUP
            if (KeyMonitor != null)
            {
                DebugOutput("  -!-!-!-! CellEdit ended: Removing key event monitor");
                NSEvent.RemoveMonitor(KeyMonitor);
                KeyMonitor.Dispose();
                KeyMonitor = null;
            }
            EditingObject = null;
            LiveValue     = null;
            TextStorage   = null; // do NOT dispose this - it refers to the storage maintained by Owner
            DebugOutput("---------------------- CellEdit ended: Finished");
        }