示例#1
0
        public void Save()
        {
            if (_o == null)
            {
                throw new Exception("Cannot Save because ObjectSaverButton has not been set up yet, call SetupFor first (e.g. in your SetDatabaseObject method) ");
            }

            if (BeforeSave != null)
            {
                if (!BeforeSave(_o))
                {
                    return;
                }
            }

            _o.SaveToDatabase();
            _activator.RefreshBus.Publish(this, new RefreshObjectEventArgs(_o));
            Enable(false);

            SetReadyToUndo();

            if (AfterSave != null)
            {
                AfterSave();
            }
        }