Example #1
0
    // document().undoManager().setActionName should be called after this is called.
    public void updatePaletteExponent(NSNumber newValue)
    {
        NSNumber oldValue = NSNumber.Create(m_paletteExponent);
        undoManager().registerUndoWithTarget_selector_object(this, "updatePaletteExponent:", oldValue);

        m_paletteExponent = newValue.floatValue();

        NSNotificationCenter.defaultCenter().postNotificationName_object(
            StateChanged, DocChange.Create(this, ChangeType.PaletteExponent));
    }
Example #2
0
        public void onDelayedAction(NSNumber id)
        {
            Action action = null;
            lock (m_lock)
            {
                action = m_delayedActions[id.intValue()];
                Unused.Value = m_delayedActions.Remove(id.intValue());
            }

            try
            {
                action();
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("Ignoring BeginInvoke exception: ");	// TODO: this kind of sucks, however appkit doesn't do any better if we let the exception escape
                Console.Error.WriteLine("{0}", e);
            }
        }