private void CreateMethodRegion()
        {
            var methodRegion = new DotNetMethodRegion(Model, ModelItem, SourceRegion, NamespaceRegion)
            {
                SelectedMethod = null
            };

            methodRegion.SourceChangedAction = () =>
            {
                if (methodRegion.SelectedMethod != null)
                {
                    if (methodRegion.SelectedMethod.ID == Guid.Empty)
                    {
                        methodRegion.SelectedMethod.ID = Guid.NewGuid();
                    }
                    bool hasUnselectedValue = MethodsToRunList.Any(methodToolRegion => methodToolRegion.SelectedMethod == null);
                    if (!hasUnselectedValue)
                    {
                        CreateMethodRegion();
                    }
                }
            };
            methodRegion.PropertyChanged += DotNetMethodRegionOnPropertyChanged;
            methodRegion.ErrorsHandler   += (sender, list) =>
            {
                List <ActionableErrorInfo> errorInfos =
                    list.Select(error => new ActionableErrorInfo(new ErrorInfo
                {
                    ErrorType = ErrorType.Critical,
                    Message   = error
                }, () => { })).ToList();
                UpdateDesignValidationErrors(errorInfos);
                Errors = new List <IActionableErrorInfo>(errorInfos);
            };
            AddToMethodsList(methodRegion);
        }
        private List <IPluginAction> GetActionsToRun()
        {
            var pluginActions = MethodsToRunList.Where(region => region.SelectedMethod != null).Select(region => region.SelectedMethod);

            return(pluginActions.ToList());
        }