コード例 #1
0
        void InterpolationTabCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.Remove)
            {
                try
                {
                    foreach (object item in e.OldItems)
                    {
                        InterpolationTabUIObject iTabObject = item as InterpolationTabUIObject;

                        // use the data access layer to delete the wrapped data object
                        dataAccessLayer.DeleteInterpolationTab(iTabObject.GetDataObject());
                    }
                }
                catch (Exception ex)
                {
                    App.Log.LogException(ex);

                    if (PersistenceError != null)
                    {
                        PersistenceError(this, ex);
                    }
                }
            }
        }
コード例 #2
0
        void InterpolationTabItemEndEdit(IEditableObject sender)
        {
            InterpolationTabUIObject iTabObject = sender as InterpolationTabUIObject;

            try
            {
                if (iTabObject.TankId == 0)
                {
                    iTabObject.TankId = currTankId;
                }
                // use the data access layer to update the wrapped data object
                dataAccessLayer.UpdateInterpolationTab(iTabObject.GetDataObject());
            }
            catch (Exception ex)
            {
                App.Log.LogException(ex);

                if (PersistenceError != null)
                {
                    PersistenceError(this, ex);
                }
            }
        }