src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/DomainClasses/EntityDesignerViewModel.cs
/// <summary>
///     This is called whenever there is a change that originates from the the DSL surface.  The
///     changes are packaged up and the ModelController is used to make the changes to the model.
/// </summary>
/// <param name="e"></param>
This is called whenever there is a change that originates from the the DSL surface.  The
changes are packaged up and the ModelController is used to make the changes to the model.
This is called whenever there is a change that originates from the the DSL surface . The changes are packaged up and the ModelController is used to make the changes to the model .
internal void OnTransactionCommited(TransactionCommitEventArgs e)
        {
            if (_reloading)
            {
                return;
            }
            var changeContext = ViewModelChangeContext.GetExistingContext(e.Transaction);
            if (changeContext != null
                && changeContext.ViewModelChanges.Count > 0)
            {
                var context = EditingContext;
                var service = context.GetEFArtifactService();
                var viewModelChanges = changeContext.ViewModelChanges.OfType<ViewModelChange>().ToList();
                Debug.Assert(
                    changeContext.ViewModelChanges.Count == viewModelChanges.Count,
                    "Not all changes from the view model were of type ViewModleChange");
                try
                {
                    SortAndOptimizeViewModelChanges(viewModelChanges);
                    ProcessViewModelChanges(e.Transaction.Name, viewModelChanges);
                }
                catch (Exception ex)
                {
                    ClearAndReloadDiagram();
                    if (ex is FileNotEditableException)
                    {
                        service.Artifact.IsDirty = false;
                    }
                    throw;
                }
            }
        }
internal void OnTransactionCommited ( TransactionCommitEventArgs e ) { if ( _reloading ) { return ; } var changeContext = ViewModelChangeContext . GetExistingContext ( e . Transaction ) ; if ( changeContext != null && changeContext . ViewModelChanges . Count > 0 ) { var context = EditingContext ; var service = context . GetEFArtifactService ( ) ; var viewModelChanges = changeContext . ViewModelChanges . OfType < ViewModelChange > ( ) . ToList ( ) ; Debug . Assert ( changeContext . ViewModelChanges . Count == viewModelChanges . Count , " " ) ; try { SortAndOptimizeViewModelChanges ( viewModelChanges ) ; ProcessViewModelChanges ( e . Transaction . Name , viewModelChanges ) ; } catch ( Exception ex ) { ClearAndReloadDiagram ( ) ; if ( ex is FileNotEditableException ) { service . Artifact . IsDirty = false ; } throw ; } } }
This is called whenever there is a change that originates from the the DSL surface.
This is called whenever there is a change that originates from the the DSL surface .
// these changes will now be invoked, which will create the appropriate EFObjects // and push changes down to the XLinq tree
e
TransactionCommitEventArgs
None